changeset 26999:2d79a354d843

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.
author Laurent Charignon <lcharignon@fb.com>
date Tue, 17 Nov 2015 12:49:57 -0800
parents 4414d500604f
children 05d8db5d2116
files mercurial/bookmarks.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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):