Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 18782:22f87dc77604
bookmarks: moving the active bookmark deactivates it
After this change, moving the active bookmark somewhere other than the
current changeset (i.e., with --rev) deactivates it. Previously it would
remain in .hg/bookmarks.current, which seems like a bug.
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Sat, 16 Mar 2013 22:48:22 -0500 |
parents | 99b78269a2ec |
children | b99e62a9b7a2 |
comparison
equal
deleted
inserted
replaced
18781:99b78269a2ec | 18782:22f87dc77604 |
---|---|
867 tgt = scmutil.revsingle(repo, rev).node() | 867 tgt = scmutil.revsingle(repo, rev).node() |
868 checkconflict(repo, mark, force, tgt) | 868 checkconflict(repo, mark, force, tgt) |
869 marks[mark] = tgt | 869 marks[mark] = tgt |
870 if not inactive and cur == marks[mark]: | 870 if not inactive and cur == marks[mark]: |
871 bookmarks.setcurrent(repo, mark) | 871 bookmarks.setcurrent(repo, mark) |
872 elif cur != tgt and mark == repo._bookmarkcurrent: | |
873 bookmarks.setcurrent(repo, None) | |
872 marks.write() | 874 marks.write() |
873 | 875 |
874 # Same message whether trying to deactivate the current bookmark (-i | 876 # Same message whether trying to deactivate the current bookmark (-i |
875 # with no NAME) or listing bookmarks | 877 # with no NAME) or listing bookmarks |
876 elif len(marks) == 0: | 878 elif len(marks) == 0: |