[PATCH 1 of 2 v2] debug: allow specifying a manifest node rather than a revision

Martijn Pieters mj at zopatista.com
Wed Aug 1 14:32:30 UTC 2018


# HG changeset patch
# User Martijn Pieters <mj at zopatista.com>
# Date 1533058668 -7200
#      Tue Jul 31 19:37:48 2018 +0200
# Branch stable
# Node ID aeabcb9ce5d398de42f623320873a789b94ba2b8
# Parent  e06a10d3b926844b5a933ec2b8f2b70cf1fb941e
# EXP-Topic persistentmanifestcache
debug: allow specifying a manifest node rather than a revision

diff -r e06a10d3b926 -r aeabcb9ce5d3 contrib/perf.py
--- a/contrib/perf.py	Mon Jul 30 15:36:04 2018 +0200
+++ b/contrib/perf.py	Tue Jul 31 19:37:48 2018 +0200
@@ -791,15 +791,21 @@
     timer(d)
     fm.end()
 
- at command('perfmanifest', [], 'REV')
-def perfmanifest(ui, repo, rev, **opts):
+ at 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()


More information about the Mercurial-devel mailing list