# HG changeset patch # User Kevin Bullock # Date 1304523827 18000 # Node ID 328422b0380d6d88d3a5ec6d64c70b72dd8da493 # Parent 9029b1a38c306e5c362d5c276d39eb5ee4ebc0f4 bookmarks: allow deactivating current bookmark with -i diff -r 9029b1a38c30 -r 328422b0380d mercurial/commands.py --- a/mercurial/commands.py Sat Dec 11 18:08:55 2010 +0100 +++ b/mercurial/commands.py Wed May 04 10:43:47 2011 -0500 @@ -539,6 +539,9 @@ if not mark: raise util.Abort(_("bookmark names cannot consist entirely of " "whitespace")) + if inactive and mark == repo._bookmarkcurrent: + bookmarks.setcurrent(repo, None) + return if mark in marks and not force: raise util.Abort(_("bookmark '%s' already exists " "(use -f to force)") % mark) diff -r 9029b1a38c30 -r 328422b0380d tests/test-bookmarks-current.t --- a/tests/test-bookmarks-current.t Sat Dec 11 18:08:55 2010 +0100 +++ b/tests/test-bookmarks-current.t Wed May 04 10:43:47 2011 -0500 @@ -106,3 +106,22 @@ $ hg bookmarks * Y 0:719295282060 Z 0:719295282060 + +deactivate current bookmark using -i + + $ hg bookmark -i Y + $ hg bookmarks + Y 0:719295282060 + Z 0:719295282060 + + $ hg up -q Y + $ hg bookmarks + * Y 0:719295282060 + Z 0:719295282060 + +deactivate current bookmark while renaming + + $ hg bookmark -i -m Y X + $ hg bookmarks + X 0:719295282060 + Z 0:719295282060 diff -r 9029b1a38c30 -r 328422b0380d tests/test-debugcomplete.t --- a/tests/test-debugcomplete.t Sat Dec 11 18:08:55 2010 +0100 +++ b/tests/test-debugcomplete.t Wed May 04 10:43:47 2011 -0500 @@ -205,7 +205,7 @@ archive: no-decode, prefix, rev, type, subrepos, include, exclude backout: merge, parent, tool, rev, include, exclude, message, logfile, date, user bisect: reset, good, bad, skip, extend, command, noupdate - bookmarks: force, rev, delete, rename + bookmarks: force, rev, delete, rename, inactive branch: force, clean branches: active, closed bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure