perfmoonwalk: make work with filtered repo
This also fixes the out-of-range "len(repo)" that weirdly works (and
gets the nullid). I suspect it wasn't intentional to include the
timing of reading the null revision.
Differential Revision: https://phab.mercurial-scm.org/D4017
--- a/contrib/perf.py Fri Jul 20 11:17:33 2018 -0700
+++ b/contrib/perf.py Fri Jul 20 11:37:31 2018 -0700
@@ -923,7 +923,7 @@
"""
timer, fm = gettimer(ui, opts)
def moonwalk():
- for i in xrange(len(repo), -1, -1):
+ for i in repo.changelog.revs(start=(len(repo) - 1), stop=-1):
ctx = repo[i]
ctx.branch() # read changelog data (in addition to the index)
timer(moonwalk)