perfphases: add a flag to also include file access time
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 23 May 2017 02:27:41 +0200
changeset 32732 e36569bd9e28
parent 32731 6f791ca70640
child 32733 2b0a8b0f3435
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.
contrib/perf.py
--- a/contrib/perf.py	Wed Jun 07 17:31:30 2017 +0100
+++ b/contrib/perf.py	Tue May 23 02:27:41 2017 +0200
@@ -591,12 +591,19 @@
     timer(d)
     fm.end()
 
-@command('perfphases', [], "")
+@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)