D2427: rebase: use ctx.rev() instead of %d % ctx

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Sat Feb 24 19:31:19 UTC 2018


indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Weaning away from basectx.__int__.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -923,7 +923,7 @@
         roots = [] # selected children of branching points
         bpbase = {} # {branchingpoint: [origbase]}
         for b in base: # group bases by branching points
-            bp = repo.revs('ancestor(%d, %d)', b, dest).first()
+            bp = repo.revs('ancestor(%d, %d)', b, dest.rev()).first()
             bpbase[bp] = bpbase.get(bp, []) + [b]
         if None in bpbase:
             # emulate the old behavior, showing "nothing to rebase" (a better
@@ -945,7 +945,7 @@
                 else:
                     ui.status(_('nothing to rebase - working directory '
                                 'parent is also destination\n'))
-            elif not repo.revs('%ld - ::%d', base, dest):
+            elif not repo.revs('%ld - ::%d', base, dest.rev()):
                 if basef:
                     ui.status(_('nothing to rebase - "base" %s is '
                                 'already an ancestor of destination '



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list