hgext/evolve.py
branchstable
changeset 1342 16017e1bb2a1
parent 1340 f455ce2a3587
child 1344 376d3df9f47b
child 1374 39f2c1ab3a53
--- a/hgext/evolve.py	Mon May 18 13:58:57 2015 -0400
+++ b/hgext/evolve.py	Mon May 18 17:24:38 2015 -0700
@@ -1808,8 +1808,20 @@
                 newnode = newnode.parents()[0]
 
         if newnode.node() != wdp.node():
+            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)