bookmarks: use repo._bookmarks.recordchange instead of repo._bookmarks.write
authorLaurent Charignon <lcharignon@fb.com>
Tue, 17 Nov 2015 12:49:57 -0800
changeset 26999 2d79a354d843
parent 26998 4414d500604f
child 27000 05d8db5d2116
bookmarks: use repo._bookmarks.recordchange instead of repo._bookmarks.write We move from the old api repo._bookmarks.write to the new api repo._bookmarks.recordchange.
mercurial/bookmarks.py
--- a/mercurial/bookmarks.py	Wed Nov 18 01:36:58 2015 -0800
+++ b/mercurial/bookmarks.py	Tue Nov 17 12:49:57 2015 -0800
@@ -249,7 +249,14 @@
         update = True
 
     if update:
-        marks.write()
+        lock = tr = None
+        try:
+            lock = repo.lock()
+            tr = repo.transaction('bookmark')
+            marks.recordchange(tr)
+            tr.close()
+        finally:
+            lockmod.release(tr, lock)
     return update
 
 def listbookmarks(repo):