[PATCH] perf: unbust perfbdiff --alldata

Gregory Szorc gregory.szorc at gmail.com
Thu Nov 17 16:53:05 UTC 2016


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1479401572 28800
#      Thu Nov 17 08:52:52 2016 -0800
# Node ID afec1b124bc35acde475fb2f5963b401c6d35203
# Parent  21772a6a7861bc312b1ba862334d105e56b38d07
perf: unbust perfbdiff --alldata

This broke in f84fc6a92817 due to a refactored manifest API.

The fix is a bit hacky - perfbdiff doesn't yet support tree manifests
for example. But it gets the job done.

A test has been added for --alldata so this doesn't happen again.

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -781,9 +781,9 @@ def perfbdiff(ui, repo, file_, rev=None,
         if opts['alldata']:
             # Load revisions associated with changeset.
             ctx = repo[rev]
-            mtext = repo.manifest.revision(ctx.manifestnode())
+            mtext = repo.manifestlog._revlog.revision(ctx.manifestnode())
             for pctx in ctx.parents():
-                pman = repo.manifest.revision(pctx.manifestnode())
+                pman = repo.manifestlog._revlog.revision(pctx.manifestnode())
                 textpairs.append((pman, mtext))
 
             # Load filelog revisions by iterating manifest delta.
diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t
--- a/tests/test-contrib-perf.t
+++ b/tests/test-contrib-perf.t
@@ -114,6 +114,7 @@ perfstatus
   $ hg perfancestorset 2
   $ hg perfannotate a
   $ hg perfbdiff -c 1
+  $ hg perfbdiff --alldata 1
   $ hg perfbranchmap
   $ hg perfcca
   $ hg perfchangegroupchangelog


More information about the Mercurial-devel mailing list