[PATCH 3 of 7] contrib/perf: fix perffncachewrite

timeless timeless at mozdev.org
Tue Nov 24 16:36:26 CST 2015


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1448402471 0
#      Tue Nov 24 22:01:11 2015 +0000
# Node ID eefb1310ac0c34e935ca867c8aa7142ffe7cefc3
# Parent  cbee1695638a014d87d12cd2f2cea93c54508763
contrib/perf: fix perffncachewrite

fncache.write requires a transaction (and thus a lock)

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -406,10 +406,13 @@
     timer, fm = gettimer(ui, opts)
     s = repo.store
     s.fncache._load()
+    lock = repo.lock()
+    tr = repo.transaction('perffncachewrite')
     def d():
         s.fncache._dirty = True
-        s.fncache.write()
+        s.fncache.write(tr)
     timer(d)
+    lock.release()
     fm.end()
 
 @command('perffncacheencode', formatteropts)


More information about the Mercurial-devel mailing list