Mercurial > hg > mercurial-source
comparison mercurial/commands.py @ 17735:605fe310691f stable
bookmarks: deactivate current bookmark if no name is given
f57f891eb88e added this help text to hg bookmark:
If no NAME is given, the current active bookmark will be marked inactive.
But that was never actually the case.
Originally spotted by Idan Kamara <idankk86@gmail.com>.
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Mon, 08 Oct 2012 00:19:30 +0200 |
parents | bdd248666dbc |
children | 1c523c4008f7 |
comparison
equal
deleted
inserted
replaced
17705:6929b9c70be9 | 17735:605fe310691f |
---|---|
844 if mark is None: | 844 if mark is None: |
845 if rev: | 845 if rev: |
846 raise util.Abort(_("bookmark name required")) | 846 raise util.Abort(_("bookmark name required")) |
847 if len(marks) == 0: | 847 if len(marks) == 0: |
848 ui.status(_("no bookmarks set\n")) | 848 ui.status(_("no bookmarks set\n")) |
849 if inactive: | |
850 if not repo._bookmarkcurrent: | |
851 ui.status(_("no active bookmark\n")) | |
852 else: | |
853 bookmarks.setcurrent(repo, None) | |
854 return | |
849 else: | 855 else: |
850 for bmark, n in sorted(marks.iteritems()): | 856 for bmark, n in sorted(marks.iteritems()): |
851 current = repo._bookmarkcurrent | 857 current = repo._bookmarkcurrent |
852 if bmark == current and n == cur: | 858 if bmark == current and n == cur: |
853 prefix, label = '*', 'bookmarks.current' | 859 prefix, label = '*', 'bookmarks.current' |