[PATCH] perf: simply use repo.store for perffncache* commands

Adrian Buehlmann adrian at cadifra.com
Fri Oct 12 12:57:59 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1350063804 -7200
# Node ID 14220683b68d3c2419d80faf26d9679a9361b5ee
# Parent  4871c1f343fae9f38b9dc9600ab96f2017d116ce
perf: simply use repo.store for perffncache* commands

This makes sure that .hg/requires is observed and the correct kind of store
object is created. Otherwise we might mutilate our test repos when experimenting
with new repo formats.

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -180,15 +180,13 @@
     timer(lambda: scmutil.casecollisionauditor(ui, False, repo.dirstate))
 
 def perffncacheload(ui, repo):
-    from mercurial import scmutil, store
-    s = store.store(set(['store','fncache']), repo.path, scmutil.opener)
+    s = repo.store
     def d():
         s.fncache._load()
     timer(d)
 
 def perffncachewrite(ui, repo):
-    from mercurial import scmutil, store
-    s = store.store(set(['store','fncache']), repo.path, scmutil.opener)
+    s = repo.store
     s.fncache._load()
     def d():
         s.fncache._dirty = True
@@ -196,9 +194,7 @@
     timer(d)
 
 def perffncacheencode(ui, repo):
-    from mercurial import store
-    s = store.store(set(['store','fncache','dotencode']),
-                    repo.path, scmutil.opener)
+    s = repo.store
     s.fncache._load()
     def d():
         for p in s.fncache.entries:


More information about the Mercurial-devel mailing list