changeset 1389:87aceaed5c69 stable

prune: use the bookmark wrapper for 3.4 compatibility
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 18 Jun 2015 18:12:24 -0700
parents eb044bcf342d
children 03f202bed47f
files hgext/evolve.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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: