[PATCH 2 of 8] perfphases: add a flag to also include file access time

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Jun 8 15:44:18 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1495499261 -7200
#      Tue May 23 02:27:41 2017 +0200
# Node ID c54764352df4e2a648c76e8bea60f5631047de7a
# Parent  bbc6d0c724ddd10f0d45971d9faf1a875bdee714
# EXP-Topic perf
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r c54764352df4
perfphases: add a flag to also include file access time

The flag purges all phases data so we'll have to read the file from disk again.

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -591,12 +591,19 @@ def perfpathcopies(ui, repo, rev1, rev2,
     timer(d)
     fm.end()
 
- at command('perfphases', [], "")
+ at command('perfphases',
+         [('', 'full', False, 'include file reading time too'),
+         ], "")
 def perfphases(ui, repo, **opts):
     """benchmark phasesets computation"""
     timer, fm = gettimer(ui, opts)
-    phases = repo._phasecache
+    _phases = repo._phasecache
+    full = opts.get('full')
     def d():
+        phases = _phases
+        if full:
+            clearfilecache(repo, '_phasecache')
+            phases = repo._phasecache
         phases.invalidate()
         phases.loadphaserevs(repo)
     timer(d)


More information about the Mercurial-devel mailing list