diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -474,16 +474,20 @@ def perfdiffwd(ui, repo, **opts): timer(d, title) fm.end() -@command('perfrevlog', - [('d', 'dist', 100, 'distance between the revisions')] + formatteropts, - "[INDEXFILE]") -def perfrevlog(ui, repo, file_, **opts): +@command('perfrevlog', revlogopts + formatteropts + + [('d', 'dist', 100, 'distance between the revisions')], + '-c|-m|FILE') +def perfrevlog(ui, repo, file_=None, **opts): + """Benchmark reading a series of revisions from a revlog. + + By default, we read every ``-d/--dist`` revision from 0 to tip of + the specified revlog. + """ timer, fm = gettimer(ui, opts) - from mercurial import revlog dist = opts['dist'] _len = getlen(ui) def d(): - r = revlog.revlog(lambda fn: open(fn, 'rb'), file_) + r = cmdutil.openrevlog(repo, 'perfrevlog', file_, opts) for x in xrange(0, _len(r), dist): r.revision(r.node(x)) diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t --- a/tests/test-contrib-perf.t +++ b/tests/test-contrib-perf.t @@ -90,7 +90,7 @@ perfstatus perfpathcopies (no help text available) perfrawfiles (no help text available) - perfrevlog (no help text available) + perfrevlog Benchmark reading a series of revisions from a revlog. perfrevlogrevision Benchmark obtaining a revlog revision. perfrevrange (no help text available)