Comments
Patch
@@ -1902,8 +1902,19 @@
repo.dirstate.rebuild(newnode.node(), newnode.manifest(), changedfiles)
repo.dirstate.write()
else:
+ bookactive = bmactive(repo)
+ # Active bookmark that we don't want to delete (with -B option)
+ # we deactivate and move it before the update and reactivate it
+ # after
+ movebookmark = bookactive and not bookmark
+ if movebookmark:
+ bookmarks.deactivate(repo)
+ repo._bookmarks[bookactive] = newnode.node()
+ repo._bookmarks.write()
commands.update(ui, repo, newnode.rev())
ui.status(_('working directory now at %s\n') % newnode)
+ if movebookmark:
+ bookmarks.activate(repo, bookactive)
# update bookmarks
if bookmark:
_deletebookmark(ui, marks, bookmark)
@@ -39,9 +39,11 @@
$ hg prune --user blah --date '1979-12-15' .
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
- (leaving bookmark BABAR)
working directory now at 47d2a3944de8
1 changesets pruned
+ $ hg bookmark
+ * BABAR 3:47d2a3944de8
+ $ hg bookmark BABAR -r 0 -f
$ hg debugobsolete
9d206ffc875e1bc304590549be293be36821e66c 0 {47d2a3944de8b013de3be9578e8e344ea2e6c097} (Sat Dec 15 00:00:00 1979 +0000) {'user': 'blah'}