changeset 32225:c68c400d0a2d

perf: move gettimer() call This is more consistent with other perf* functions.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 06 May 2017 11:01:02 -0700
parents 6b582f9b6e5e
children bf3af0eced44
files contrib/perf.py tests/test-check-code.t tests/test-contrib-perf.t
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Sat May 06 10:59:38 2017 -0700
+++ b/contrib/perf.py	Sat May 06 11:01:02 2017 -0700
@@ -850,7 +850,6 @@
 
     The start revision can be defined via ``-s/--startrev``.
     """
-    timer, fm = gettimer(ui, opts)
     _len = getlen(ui)
 
     def d():
@@ -867,6 +866,7 @@
         for x in xrange(beginrev, endrev, dist):
             r.revision(r.node(x))
 
+    timer, fm = gettimer(ui, opts)
     timer(d)
     fm.end()
 
--- a/tests/test-check-code.t	Sat May 06 10:59:38 2017 -0700
+++ b/tests/test-check-code.t	Sat May 06 11:01:02 2017 -0700
@@ -9,7 +9,7 @@
 
   $ hg locate -X contrib/python-zstandard -X hgext/fsmonitor/pywatchman |
   > sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
-  contrib/perf.py:868:
+  contrib/perf.py:867:
    >             r.revision(r.node(x))
    don't convert rev to node before passing to revision(nodeorrev)
   Skipping i18n/polib.py it has no-che?k-code (glob)
--- a/tests/test-contrib-perf.t	Sat May 06 10:59:38 2017 -0700
+++ b/tests/test-contrib-perf.t	Sat May 06 11:01:02 2017 -0700
@@ -165,7 +165,7 @@
   $ (hg files -r 1.2 glob:mercurial/*.c glob:mercurial/*.py;
   >  hg files -r tip glob:mercurial/*.c glob:mercurial/*.py) |
   > "$TESTDIR"/check-perf-code.py contrib/perf.py
-  contrib/perf.py:868:
+  contrib/perf.py:867:
    >             r.revision(r.node(x))
    don't convert rev to node before passing to revision(nodeorrev)
   [1]