changeset 38780:ddb15a83ae0b

debug: allow specifying a manifest node rather than a revision
author Martijn Pieters <mj@zopatista.com>
date Tue, 31 Jul 2018 19:37:48 +0200
parents a4d847cea6f8
children 0a57945aaf7f
files contrib/perf.py
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Fri Jul 20 11:37:31 2018 -0700
+++ b/contrib/perf.py	Tue Jul 31 19:37:48 2018 +0200
@@ -791,15 +791,21 @@
     timer(d)
     fm.end()
 
-@command('perfmanifest', [], 'REV')
-def perfmanifest(ui, repo, rev, **opts):
+@command('perfmanifest',[
+            ('m', 'manifest-rev', False, 'Look up a manifest node revision'),
+            ('', 'clear-disk', False, 'clear on-disk caches too'),
+         ], 'REV|NODE')
+def perfmanifest(ui, repo, rev, manifest_rev=False, clear_disk=False, **opts):
     """benchmark the time to read a manifest from disk and return a usable
     dict-like object
 
     Manifest caches are cleared before retrieval."""
     timer, fm = gettimer(ui, opts)
-    ctx = scmutil.revsingle(repo, rev, rev)
-    t = ctx.manifestnode()
+    if not manifest_rev:
+        ctx = scmutil.revsingle(repo, rev, rev)
+        t = ctx.manifestnode()
+    else:
+        t = repo.manifestlog._revlog.lookup(rev)
     def d():
         repo.manifestlog.clearcaches()
         repo.manifestlog[t].read()