Patchwork D1905: strip: use in-place revset formatspec instead of %-formatting ourselves

login
register
mail settings
Submitter phabricator
Date Jan. 18, 2018, 4:12 p.m.
Message ID <differential-rev-PHID-DREV-bgyvlvwgzt33zcmszpnw-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26909/
State Superseded
Headers show

Comments

phabricator - Jan. 18, 2018, 4:12 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Caught by Yuya during review of https://phab.mercurial-scm.org/D1884.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1905

AFFECTED FILES
  hgext/strip.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 1, 2018, 9:22 p.m.
martinvonz added inline comments.

INLINE COMMENTS

> strip.py:218
>              # between the working context and uctx
> -            descendantrevs = repo.revs("%s::." % uctx.rev())
> +            descendantrevs = repo.revs("%s::.", uctx.rev())
>              changedfiles = []

I would expect "%d" with a revision number (such as  uctx.rev()). I saw that that's also what Yuya suggested on https://phab.mercurial-scm.org/D1884. Fixing in flight.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1905

To: durin42, #hg-reviewers, pulkit, indygreg
Cc: martinvonz, mercurial-devel
phabricator - Feb. 1, 2018, 9:24 p.m.
martinvonz added inline comments.

INLINE COMMENTS

> martinvonz wrote in strip.py:218
> I would expect "%d" with a revision number (such as  uctx.rev()). I saw that that's also what Yuya suggested on https://phab.mercurial-scm.org/D1884. Fixing in flight.

Oh, that's done in the next patch :P

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1905

To: durin42, #hg-reviewers, pulkit, indygreg
Cc: martinvonz, mercurial-devel

Patch

diff --git a/hgext/strip.py b/hgext/strip.py
--- a/hgext/strip.py
+++ b/hgext/strip.py
@@ -215,7 +215,7 @@ 
 
             # only reset the dirstate for files that would actually change
             # between the working context and uctx
-            descendantrevs = repo.revs("%s::." % uctx.rev())
+            descendantrevs = repo.revs("%s::.", uctx.rev())
             changedfiles = []
             for rev in descendantrevs:
                 # blindly reset the files, regardless of what actually changed