changeset 32264:6b582f9b6e5e

perf: don't clobber startrev variable Previously, the "startrev" argument would be ignored due to "startrev = 0" in the benchmark function. This meant that `hg perfrevlog` always started at revision 0. Rename the local variable to "beginrev" so the variable does the right thing.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 06 May 2017 10:59:38 -0700
parents d7f93ebbbbdf
children c68c400d0a2d
files contrib/perf.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Fri May 05 17:31:15 2017 +0200
+++ b/contrib/perf.py	Sat May 06 10:59:38 2017 -0700
@@ -856,15 +856,15 @@
     def d():
         r = cmdutil.openrevlog(repo, 'perfrevlog', file_, opts)
 
-        startrev = 0
+        beginrev = startrev
         endrev = _len(r)
         dist = opts['dist']
 
         if reverse:
-            startrev, endrev = endrev, startrev
+            beginrev, endrev = endrev, beginrev
             dist = -1 * dist
 
-        for x in xrange(startrev, endrev, dist):
+        for x in xrange(beginrev, endrev, dist):
             r.revision(r.node(x))
 
     timer(d)