mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
bookmarks: allow deactivating current bookmark with -i
This commit is contained in:
parent
b95625191f
commit
c38d0cc58b
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user