perf: pre-indent some code in `perfbranchmapupdate`
authorBoris Feld <boris.feld@octobus.net>
Wed, 21 Nov 2018 22:56:06 +0100
changeset 40803 95f35c873463
parent 40802 f723014677a5
child 40804 b059388d976c
perf: pre-indent some code in `perfbranchmapupdate` This make the next patch easier to read.
contrib/perf.py
--- a/contrib/perf.py	Wed Nov 21 12:02:25 2018 +0000
+++ b/contrib/perf.py	Wed Nov 21 22:56:06 2018 +0100
@@ -2325,17 +2325,18 @@
     msg = b'benchmark of branchmap with %d revisions with %d new ones\n'
     ui.status(msg % (len(allbaserevs), len(newrevs)))
 
-    base = branchmap.branchcache()
-    base.update(repo, allbaserevs)
-
-    def setup():
-        x[0] = base.copy()
+    if True:
+        base = branchmap.branchcache()
+        base.update(repo, allbaserevs)
 
-    def bench():
-        x[0].update(repo, newrevs)
+        def setup():
+            x[0] = base.copy()
 
-    timer(bench, setup=setup)
-    fm.end()
+        def bench():
+            x[0].update(repo, newrevs)
+
+        timer(bench, setup=setup)
+        fm.end()
 
 @command(b'perfbranchmapload', [
      (b'f', b'filter', b'', b'Specify repoview filter'),