Patchwork [1,of,2,v3] debug: allow specifying a manifest node rather than a revision

login
register
mail settings
Submitter Martijn Pieters
Date Aug. 1, 2018, 9:29 p.m.
Message ID <23e31b60983e3fb78aeb.1533158967@Martijns-MacBook-Pro.local>
Download mbox | patch
Permalink /patch/33063/
State Accepted
Headers show

Comments

Martijn Pieters - Aug. 1, 2018, 9:29 p.m.
# HG changeset patch
# User Martijn Pieters <mj@zopatista.com>
# Date 1533157442 -7200
#      Wed Aug 01 23:04:02 2018 +0200
# Branch stable
# Node ID 23e31b60983e3fb78aeb8822de8c630798f46447
# Parent  e06a10d3b926844b5a933ec2b8f2b70cf1fb941e
# EXP-Topic persistentmanifestcache
debug: allow specifying a manifest node rather than a revision

Patch

diff -r e06a10d3b926 -r 23e31b60983e contrib/perf.py
--- a/contrib/perf.py	Mon Jul 30 15:36:04 2018 +0200
+++ b/contrib/perf.py	Wed Aug 01 23:04:02 2018 +0200
@@ -791,15 +791,20 @@ 
     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'),
+         ], 'REV|NODE')
+def perfmanifest(ui, repo, rev, manifest_rev=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()