next: replace call to bookmarks.write by bookmarks.recordchange
authorLaurent Charignon <lcharignon@fb.com>
Thu, 10 Dec 2015 14:43:31 -0800
changeset 1557 e72f83f09bdc
parent 1556 4f008b8acda7
child 1558 4706475e0c5d
next: 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:43:00 2015 -0800
+++ b/hgext/evolve.py	Thu Dec 10 14:43:31 2015 -0800
@@ -2162,15 +2162,19 @@
         else:
             ret = hg.update(repo, c.rev())
             if not ret:
+                lock = tr = None
                 wlock = repo.wlock()
                 try:
+                    lock = repo.lock()
+                    tr = repo.transaction('next')
                     if shouldmove:
                         repo._bookmarks[bm] = c.node()
-                        repo._bookmarks.write()
+                        repo._bookmarks.recordchange(tr)
                     else:
                         bmdeactivate(repo)
+                    tr.close()
                 finally:
-                    wlock.release()
+                    lockmod.release(tr, lock, wlock)
         displayer.show(c)
         result = 0
     elif children: