perfmoonwalk: make work with filtered repo
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 20 Jul 2018 11:37:31 -0700
changeset 38778 a4d847cea6f8
parent 38777 83a505b5cf85
child 38780 ddb15a83ae0b
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
contrib/perf.py
--- 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)