prune: use the bookmark wrapper for 3.4 compatibility stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 18 Jun 2015 18:12:24 -0700
branchstable
changeset 1389 87aceaed5c69
parent 1387 eb044bcf342d
child 1390 03f202bed47f
prune: use the bookmark wrapper for 3.4 compatibility
hgext/evolve.py
--- a/hgext/evolve.py	Thu Jun 18 17:56:02 2015 -0700
+++ b/hgext/evolve.py	Thu Jun 18 18:12:24 2015 -0700
@@ -897,6 +897,11 @@
         return bookmarks.deactivate(repo)
     except AttributeError:
         return bookmarks.unsetcurrent(repo)
+def bmactivate(repo, book):
+    try:
+        return bookmarks.activate(repo, book)
+    except AttributeError:
+        return bookmarks.setcurrent(repo, book)
 
 def bmactive(repo):
     try:
@@ -1832,13 +1837,13 @@
             # after
             movebookmark = bookactive and not bookmark
             if movebookmark:
-                bookmarks.deactivate(repo)
+                bmdeactivate(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)
+                bmactivate(repo, bookactive)
 
         # update bookmarks
         if bookmark: