Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 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 | 56dd55da2f7d |
children | 22f87dc77604 |
comparison
equal
deleted
inserted
replaced
18774:b616c9b8001d | 18781:99b78269a2ec |
---|---|
809 return mark | 809 return mark |
810 | 810 |
811 def checkconflict(repo, mark, force=False, target=None): | 811 def checkconflict(repo, mark, force=False, target=None): |
812 if mark in marks and not force: | 812 if mark in marks and not force: |
813 if target: | 813 if target: |
814 if marks[mark] == target and target == cur: | |
815 # re-activating a bookmark | |
816 return | |
814 anc = repo.changelog.ancestors([repo[target].rev()]) | 817 anc = repo.changelog.ancestors([repo[target].rev()]) |
815 bmctx = repo[marks[mark]] | 818 bmctx = repo[marks[mark]] |
816 if bmctx.rev() in anc: | 819 if bmctx.rev() in anc: |
817 ui.status(_("moving bookmark '%s' forward from %s\n") % | 820 ui.status(_("moving bookmark '%s' forward from %s\n") % |
818 (mark, short(bmctx.node()))) | 821 (mark, short(bmctx.node()))) |