previous: replace call to bookmarks.write by bookmarks.recordchange
authorLaurent Charignon <lcharignon@fb.com>
Thu, 10 Dec 2015 14:43:00 -0800
changeset 1556 4f008b8acda7
parent 1555 0ff262537f98
child 1557 e72f83f09bdc
previous: replace call to bookmarks.write by bookmarks.recordchange bookmarks.write is now deprecated, we are moving to the new api: bookmarks.recordchange.
hgext/evolve.py
--- a/hgext/evolve.py	Thu Dec 10 14:17:27 2015 -0800
+++ b/hgext/evolve.py	Thu Dec 10 14:43:00 2015 -0800
@@ -2102,15 +2102,19 @@
         else:
             ret = hg.update(repo, p.rev())
             if not ret:
+                tr = lock = None
                 wlock = repo.wlock()
                 try:
+                    lock = repo.lock()
+                    tr = repo.transaction('previous')
                     if shouldmove:
                         repo._bookmarks[bm] = p.node()
-                        repo._bookmarks.write()
+                        repo._bookmarks.recordchange(tr)
                     else:
                         bmdeactivate(repo)
+                    tr.close()
                 finally:
-                    wlock.release()
+                    lockmod.release(tr, lock, wlock)
         displayer.show(p)
         return 0
     else: