From patchwork Fri Aug 30 21:16:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: rebase: handle bookmarks matching revset function names (issue3950) From: Bryan O'Sullivan X-Patchwork-Id: 2291 Message-Id: To: mercurial-devel@selenic.com Date: Fri, 30 Aug 2013 14:16:35 -0700 # HG changeset patch # User Bryan O'Sullivan # 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