Mercurial > hg-stable
changeset 18781:99b78269a2ec
bookmarks: allow (re-)activating a bookmark on the current changeset
Allow a bookmark that points to the current changeset to be made the
active bookmark without requiring --force. Previously, this would've
aborted with:
abort: bookmark 'Z' already exists (use -f to force)
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Sat, 16 Mar 2013 21:36:44 -0500 |
parents | b616c9b8001d |
children | 22f87dc77604 |
files | mercurial/commands.py tests/test-bookmarks.t |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Sat Mar 16 21:21:54 2013 -0500 +++ b/mercurial/commands.py Sat Mar 16 21:36:44 2013 -0500 @@ -811,6 +811,9 @@ def checkconflict(repo, mark, force=False, target=None): if mark in marks and not force: if target: + if marks[mark] == target and target == cur: + # re-activating a bookmark + return anc = repo.changelog.ancestors([repo[target].rev()]) bmctx = repo[marks[mark]] if bmctx.rev() in anc:
--- a/tests/test-bookmarks.t Sat Mar 16 21:21:54 2013 -0500 +++ b/tests/test-bookmarks.t Sat Mar 16 21:36:44 2013 -0500 @@ -363,6 +363,11 @@ * Z 2:db815d6d32e6 x y 2:db815d6d32e6 +activate bookmark on working dir parent without --force + + $ hg bookmark --inactive Z + $ hg bookmark Z + test clone $ hg bookmark -r 2 -i @