comparison contrib/perf.py @ 27100:8d5dba93aa4f

contrib/perf: perfparents handle filtered repos
author timeless <timeless@mozdev.org>
date Tue, 24 Nov 2015 21:36:20 +0000
parents e94bfebb4f35
children 528cf1a73ae5
comparison
equal deleted inserted replaced
27099:e94bfebb4f35 27100:8d5dba93aa4f
300 @command('perfparents', formatteropts) 300 @command('perfparents', formatteropts)
301 def perfparents(ui, repo, **opts): 301 def perfparents(ui, repo, **opts):
302 timer, fm = gettimer(ui, opts) 302 timer, fm = gettimer(ui, opts)
303 if len(repo.changelog) < 1000: 303 if len(repo.changelog) < 1000:
304 raise error.Abort("repo needs 1000 commits for this test") 304 raise error.Abort("repo needs 1000 commits for this test")
305 repo = repo.unfiltered()
305 nl = [repo.changelog.node(i) for i in xrange(1000)] 306 nl = [repo.changelog.node(i) for i in xrange(1000)]
306 def d(): 307 def d():
307 for n in nl: 308 for n in nl:
308 repo.changelog.parents(n) 309 repo.changelog.parents(n)
309 timer(d) 310 timer(d)