# HG changeset patch # User Kevin Bullock # Date 2012-10-07 22:19:30 # Node ID 605fe310691fbe1579ca8458f9f640d921ce3f1e # Parent 6929b9c70be9294a40c5734ef05b35d4ff32e2ad 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 . diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -846,6 +846,12 @@ def bookmark(ui, repo, mark=None, rev=No raise util.Abort(_("bookmark name required")) if len(marks) == 0: ui.status(_("no bookmarks set\n")) + if inactive: + if not repo._bookmarkcurrent: + ui.status(_("no active bookmark\n")) + else: + bookmarks.setcurrent(repo, None) + return else: for bmark, n in sorted(marks.iteritems()): current = repo._bookmarkcurrent diff --git a/tests/test-bookmarks-current.t b/tests/test-bookmarks-current.t --- a/tests/test-bookmarks-current.t +++ b/tests/test-bookmarks-current.t @@ -115,6 +115,13 @@ deactivate current bookmark using -i Z 0:719295282060 $ hg up -q Y + $ hg bookmark -i + $ hg bookmarks + Y 0:719295282060 + Z 0:719295282060 + $ hg bookmark -i + no active bookmark + $ hg up -q Y $ hg bookmarks * Y 0:719295282060 Z 0:719295282060