Patchwork perf: unbust perfbdiff --alldata

login
register
mail settings
Submitter Gregory Szorc
Date Nov. 17, 2016, 4:53 p.m.
Message ID <afec1b124bc35acde475.1479401585@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/17616/
State Accepted
Headers show

Comments

Gregory Szorc - Nov. 17, 2016, 4:53 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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.
via Mercurial-devel - Nov. 17, 2016, 5:34 p.m.
Queued, thanks.

On Thu, Nov 17, 2016 at 8:53 AM, Gregory Szorc <gregory.szorc@gmail.com> wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@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
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

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