Read about our upcoming Code of Conduct on this issue

Commit a48b105a authored by timeless's avatar timeless
Browse files

contrib/perf: perfparents handle tiny repos

refuse to run if there are not enough commits
parent 64cb281d23a5
......@@ -2,7 +2,7 @@
'''helper extension to measure performance'''
from mercurial import cmdutil, scmutil, util, commands, obsolete
from mercurial import repoview, branchmap, merge, copies
from mercurial import repoview, branchmap, merge, copies, error
import time, os, sys
import functools
......@@ -300,6 +300,8 @@ def perfstartup(ui, repo, **opts):
@command('perfparents', formatteropts)
def perfparents(ui, repo, **opts):
timer, fm = gettimer(ui, opts)
if len(repo.changelog) < 1000:
raise error.Abort("repo needs 1000 commits for this test")
nl = [repo.changelog.node(i) for i in xrange(1000)]
def d():
for n in nl:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment