debug: allow specifying a manifest node rather than a revision
authorMartijn Pieters <mj@zopatista.com>
Tue, 31 Jul 2018 19:37:48 +0200
changeset 38780 ddb15a83ae0b
parent 38778 a4d847cea6f8
child 38781 0a57945aaf7f
debug: allow specifying a manifest node rather than a revision
contrib/perf.py
--- 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()