[PATCH] perf: fix perfhelper-pathcopies without --stats

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Sep 26 21:53:08 EDT 2019


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1569537652 -7200
#      Fri Sep 27 00:40:52 2019 +0200
# Node ID 62ace07df70a554be5fdf058ca4577187b873220
# Parent  763028fc6a69a772cfa03c85262e2b6a439de5ab
# EXP-Topic fix-perf-helper
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 62ace07df70a
perf: fix perfhelper-pathcopies without --stats

Some conditional were missing.

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -1813,16 +1813,17 @@ def perfhelperpathcopies(ui, repo, revs=
                     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)
@@ -1830,16 +1831,17 @@ def perfhelperpathcopies(ui, repo, revs=
                     # 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()


More information about the Mercurial-devel mailing list