[PATCH] rebase: handle bookmarks matching revset function names (issue3950)

Bryan O'Sullivan bos at serpentine.com
Fri Aug 30 16:16:35 CDT 2013


# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1377897368 25200
#      Fri Aug 30 14:16:08 2013 -0700
# Node ID f07f45c5f8c9ef02f39bf68b83d1e23771b28308
# Parent  3193b23eec61b95442097514ca479474b6e8dae6
rebase: handle bookmarks matching revset function names (issue3950)

We handled these correctly with all rev-specifying options except,
somehow, -r/--rev.

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -186,7 +186,7 @@ def rebase(ui, repo, **opts):
                 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)
diff --git a/tests/test-rebase-bookmarks.t b/tests/test-rebase-bookmarks.t
--- a/tests/test-rebase-bookmarks.t
+++ b/tests/test-rebase-bookmarks.t
@@ -159,4 +159,18 @@ rebase --continue with bookmarks present
   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


More information about the Mercurial-devel mailing list