bookmarks: allow deactivating current bookmark with -i

This commit is contained in:
Kevin Bullock 2011-05-04 10:43:47 -05:00
parent b95625191f
commit c38d0cc58b
3 changed files with 23 additions and 1 deletions

View File

@ -539,6 +539,9 @@ def bookmark(ui, repo, mark=None, rev=None, force=False, delete=False,
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)

View File

@ -106,3 +106,22 @@ set bookmark Z using -i
$ 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

View File

@ -205,7 +205,7 @@ Show all commands + options
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