perf: fix perfhelper-pathcopies without --stats
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 27 Sep 2019 00:40:52 +0200
changeset 43003 bbf77341a956
parent 43002 373749982924
child 43004 c07812bdd568
perf: fix perfhelper-pathcopies without --stats Some conditional were missing.
contrib/perf.py
--- a/contrib/perf.py	Fri Sep 27 19:59:53 2019 +0200
+++ b/contrib/perf.py	Fri Sep 27 00:40:52 2019 +0200
@@ -1814,16 +1814,17 @@
                     b'nbrevs': len(repo.revs('%d::%d', b, p)),
                     b'nbmissingfiles': len(missing),
                 }
-                alldata['nbrevs'].append((
-                    data['nbrevs'],
-                    base.hex(),
-                    parent.hex(),
-                ))
-                alldata['nbmissingfiles'].append((
-                    data['nbmissingfiles'],
-                    base.hex(),
-                    parent.hex(),
-                ))
+                if dostats:
+                    alldata['nbrevs'].append((
+                        data['nbrevs'],
+                        base.hex(),
+                        parent.hex(),
+                    ))
+                    alldata['nbmissingfiles'].append((
+                        data['nbmissingfiles'],
+                        base.hex(),
+                        parent.hex(),
+                    ))
                 if dotiming:
                     begin = util.timer()
                     renames = copies.pathcopies(base, parent)
@@ -1831,16 +1832,17 @@
                     # not very stable timing since we did only one run
                     data['time'] = end - begin
                     data['nbrenamedfiles'] = len(renames)
-                    alldata['time'].append((
-                        data['time'],
-                        base.hex(),
-                        parent.hex(),
-                    ))
-                    alldata['nbrenames'].append((
-                        data['nbrenamedfiles'],
-                        base.hex(),
-                        parent.hex(),
-                    ))
+                    if dostats:
+                        alldata['time'].append((
+                            data['time'],
+                            base.hex(),
+                            parent.hex(),
+                        ))
+                        alldata['nbrenames'].append((
+                            data['nbrenamedfiles'],
+                            base.hex(),
+                            parent.hex(),
+                        ))
                 fm.startitem()
                 fm.data(**data)
                 out = data.copy()