[PATCH 3 of 3] bookmarks: use repo._bookmarks.write instead of repo._bookmarks.recordchange

Laurent Charignon lcharignon at fb.com
Tue Nov 17 15:06:00 CST 2015


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1447793397 28800
#      Tue Nov 17 12:49:57 2015 -0800
# Node ID d5148614821055a72676b0fc533b957957a72214
# Parent  81aacd9541c1a516a7eff1fa03e5a24bd5e64b6f
bookmarks: use repo._bookmarks.write instead of repo._bookmarks.recordchange

We move from the old api repo._bookmarks.write to the new api
repo._bookmarks.recordchange.

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -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):


More information about the Mercurial-devel mailing list