Patchwork [3,of,7] contrib/perf: fix perffncachewrite

login
register
mail settings
Submitter timeless@mozdev.org
Date Nov. 24, 2015, 10:36 p.m.
Message ID <eefb1310ac0c34e935ca.1448404586@waste.org>
Download mbox | patch
Permalink /patch/11622/
State Accepted
Headers show

Comments

timeless@mozdev.org - Nov. 24, 2015, 10:36 p.m.
# HG changeset patch
# User timeless <timeless@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)

Patch

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)