comparison contrib/perf.py @ 17780:769f66861eb8

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.
author Adrian Buehlmann <adrian@cadifra.com>
date Fri, 12 Oct 2012 19:43:24 +0200
parents 5ab863922e0f
children 00ac420f24ee
comparison
equal deleted inserted replaced
17779:f38e2873b48d 17780:769f66861eb8
178 178
179 def perfcca(ui, repo): 179 def perfcca(ui, repo):
180 timer(lambda: scmutil.casecollisionauditor(ui, False, repo.dirstate)) 180 timer(lambda: scmutil.casecollisionauditor(ui, False, repo.dirstate))
181 181
182 def perffncacheload(ui, repo): 182 def perffncacheload(ui, repo):
183 from mercurial import scmutil, store 183 s = repo.store
184 s = store.store(set(['store','fncache']), repo.path, scmutil.opener)
185 def d(): 184 def d():
186 s.fncache._load() 185 s.fncache._load()
187 timer(d) 186 timer(d)
188 187
189 def perffncachewrite(ui, repo): 188 def perffncachewrite(ui, repo):
190 from mercurial import scmutil, store 189 s = repo.store
191 s = store.store(set(['store','fncache']), repo.path, scmutil.opener)
192 s.fncache._load() 190 s.fncache._load()
193 def d(): 191 def d():
194 s.fncache._dirty = True 192 s.fncache._dirty = True
195 s.fncache.write() 193 s.fncache.write()
196 timer(d) 194 timer(d)
197 195
198 def perffncacheencode(ui, repo): 196 def perffncacheencode(ui, repo):
199 from mercurial import store 197 s = repo.store
200 s = store.store(set(['store','fncache','dotencode']),
201 repo.path, scmutil.opener)
202 s.fncache._load() 198 s.fncache._load()
203 def d(): 199 def d():
204 for p in s.fncache.entries: 200 for p in s.fncache.entries:
205 s.encode(p) 201 s.encode(p)
206 timer(d) 202 timer(d)