commitwrapper: use bookmarks.recordchange instead of bookmarks.write
authorLaurent Charignon <lcharignon@fb.com>
Thu, 10 Dec 2015 15:09:25 -0800
changeset 1558 4706475e0c5d
parent 1557 e72f83f09bdc
child 1559 bc21846791b6
commitwrapper: use bookmarks.recordchange instead of bookmarks.write Before this patch we were using the deprecated API bookmarks.write, this patch replace its usage by the new API call bookmarks.recordchange.
hgext/evolve.py
--- a/hgext/evolve.py	Thu Dec 10 14:43:31 2015 -0800
+++ b/hgext/evolve.py	Thu Dec 10 15:09:25 2015 -0800
@@ -2665,6 +2665,7 @@
 
 @eh.wrapcommand('commit')
 def commitwrapper(orig, ui, repo, *arg, **kwargs):
+    tr = None
     if kwargs.get('amend', False):
         wlock = lock = None
     else:
@@ -2687,10 +2688,16 @@
             for book in oldbookmarks:
                 repo._bookmarks[book] = new.node()
             if oldbookmarks:
-                repo._bookmarks.write()
+                if not wlock:
+                    wlock = repo.wlock()
+                if not lock:
+                    lock = repo.lock()
+                tr = repo.transaction('commit')
+                repo._bookmarks.recordchange(tr)
+                tr.close()
         return result
     finally:
-        lockmod.release(lock, wlock)
+        lockmod.release(tr, lock, wlock)
 
 @command('^split',
     [('r', 'rev', [], _("revision to fold")),