changeset 19641:5528c31c629c

rebase: handle bookmarks matching revset function names (issue3950) We handled these correctly with all rev-specifying options except, somehow, -r/--rev.
author Bryan O'Sullivan <bryano@fb.com>
date Tue, 03 Sep 2013 15:12:35 -0400
parents 472fa3b782b1
children 4b83bcc1f965 36f48c7d5944
files hgext/rebase.py tests/test-rebase-bookmarks.t
diffstat 2 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Thu Jul 25 22:28:34 2013 -0500
+++ b/hgext/rebase.py	Tue Sep 03 15:12:35 2013 -0400
@@ -186,7 +186,7 @@
                 dest = scmutil.revsingle(repo, destf)
 
             if revf:
-                rebaseset = repo.revs('%lr', revf)
+                rebaseset = scmutil.revrange(repo, revf)
             elif srcf:
                 src = scmutil.revrange(repo, [srcf])
                 rebaseset = repo.revs('(%ld)::', src)
--- a/tests/test-rebase-bookmarks.t	Thu Jul 25 22:28:34 2013 -0500
+++ b/tests/test-rebase-bookmarks.t	Tue Sep 03 15:12:35 2013 -0400
@@ -159,4 +159,18 @@
   o  0: 'A' bookmarks:
   
 
-  $ cd ..
+ensure that bookmarks given the names of revset functions can be used
+as --rev arguments (issue3950)
+
+  $ hg update -q 3
+  $ echo bimble > bimble
+  $ hg add bimble
+  $ hg commit -q -m 'bisect'
+  $ echo e >> bimble
+  $ hg ci -m bisect2
+  $ echo e >> bimble
+  $ hg ci -m bisect3
+  $ hg book bisect
+  $ hg update -q Y
+  $ hg rebase -r '"bisect"^^::"bisect"^' -r bisect -d Z
+  saved backup bundle to $TESTTMP/a3/.hg/strip-backup/345c90f326a4-backup.hg (glob)