changeset 43122:436a6a31df38

perf: use `setup` function in `perfdirstate` The command seems to pre-date the introduction of the `setup` support in timer. We move the line that is obviously about benchmark setup in such `setup` function.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 08 Oct 2019 01:57:10 -0400
parents ce315b1fc9a7
children 69301b79fd36
files contrib/perf.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Tue Oct 08 01:46:57 2019 -0400
+++ b/contrib/perf.py	Tue Oct 08 01:57:10 2019 -0400
@@ -1112,11 +1112,13 @@
     timer, fm = gettimer(ui, opts)
     b"a" in repo.dirstate
 
+    def setup():
+        repo.dirstate.invalidate()
+
     def d():
-        repo.dirstate.invalidate()
         b"a" in repo.dirstate
 
-    timer(d)
+    timer(d, setup=setup)
     fm.end()