Patchwork perf: fix perfhelper-pathcopies without --stats

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 27, 2019, 1:53 a.m.
Message ID <62ace07df70a554be5fd.1569549188@nodosa.octobus.net>
Download mbox | patch
Permalink /patch/41778/
State New
Headers show

Comments

Pierre-Yves David - Sept. 27, 2019, 1:53 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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()