Fwd: [PATCH] manifest: move manifestctx creation into manifestlog.get()

Martin von Zweigbergk martinvonz at google.com
Fri Nov 18 12:47:26 EST 2016


And of course that wasn't just for Durham.

---------- Forwarded message ----------
From: Martin von Zweigbergk <martinvonz at google.com>
Date: Fri, Nov 18, 2016 at 9:46 AM
Subject: Re: [PATCH] manifest: move manifestctx creation into manifestlog.get()
To: Durham Goode <durham at fb.com>


On Thu, Nov 17, 2016 at 3:36 PM, Durham Goode <durham at fb.com> wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1479425479 28800
> #      Thu Nov 17 15:31:19 2016 -0800
> # Node ID 916fbbd3d9a628dcd4a63c352d4d70b678e92a68
> # Parent  c27614f2dec1405db606d1ef871dfabf72cc0737
> manifest: move manifestctx creation into manifestlog.get()
>
> Most manifestctx creation already happened in manifestlog.get(), but there was
> one spot in the manifestctx class itself that created an instance manually. This
> patch makes that one instance go through the manifestlog. This means extensions
> can just wrap manifestlog.get() and it will cover all manifestctx creations. It
> also means this code path now hits the manifestlog cache.
>
> diff --git a/mercurial/manifest.py b/mercurial/manifest.py
> --- a/mercurial/manifest.py
> +++ b/mercurial/manifest.py
> @@ -1418,7 +1418,7 @@ class manifestctx(object):
>          if revlog._usemanifestv2:

Looks like the below is only used with manifestv2, which no one is
using and no one will probably be using.

That reminded me to update the wiki for manfestv2. Please take a look
at the "Space savings" section of
https://www.mercurial-scm.org/wiki/ManifestV2Plan and see how it's a
actually a space increase. I reported that a long time ago, but redid
the tests the other week (repo conversion took a week, I think) and
finally updated the wiki. Let me know if you (anyone) think we should
still keep the experimental manifestv2 code in there.

>              # Need to perform a slow delta
>              r0 = revlog.deltaparent(revlog.rev(self._node))
> -            m0 = manifestctx(self._repo, revlog.node(r0)).read()
> +            m0 = self._repo.manifestlog[revlog.node(r0)].read()
>              m1 = self.read()
>              md = manifestdict()
>              for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems():
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list