diff hgext/rebase.py @ 15800:e4fc0f0b4f7e stable

rebase: reinstate old-style rev spec support for the source and base (issue3181) As of b12362ab13e7 (first released as part of Mercurial 2.0), the rebase command accepted ONLY revsets for the source and base arguments and no longer accepted old-style revision specifications. As a result, some revision names were no longer recognised, e.g. hg rebase --base br-anch abort: unknown revision 'br'! These arguments are now interpreted first as old-style revision specifications, then as revsets when no matching revision is found. This restores backwards compatibility with releases prior to 2.0.
author Steven Brown <StevenGBrown@gmail.com>
date Sun, 08 Jan 2012 23:09:35 +0800
parents ad336e093a59
children bfd3ce759682
line wrap: on
line diff
--- a/hgext/rebase.py	Fri Jan 06 07:37:59 2012 +0100
+++ b/hgext/rebase.py	Sun Jan 08 23:09:35 2012 +0800
@@ -15,7 +15,7 @@
 '''
 
 from mercurial import hg, util, repair, merge, cmdutil, commands, bookmarks
-from mercurial import extensions, patch
+from mercurial import extensions, patch, scmutil
 from mercurial.commands import templateopts
 from mercurial.node import nullrev
 from mercurial.lock import release
@@ -187,10 +187,11 @@
             if revf:
                 revgen = repo.set('%lr', revf)
             elif srcf:
-                revgen = repo.set('(%r)::', srcf)
+                src = scmutil.revrange(repo, [srcf])
+                revgen = repo.set('(%ld)::', src)
             else:
-                base = basef or '.'
-                revgen = repo.set('(children(ancestor(%r, %d)) and ::(%r))::',
+                base = scmutil.revrange(repo, [basef or '.'])
+                revgen = repo.set('(children(ancestor(%ld, %d)) and ::(%ld))::',
                                   base, dest, base)
 
             rebaseset = [c.rev() for c in revgen]