[PATCH] manifest: improve filesnotin performance by using lazymanifest diff

Sean Farley sean at farley.io
Wed Apr 27 04:07:06 EDT 2016


Tony Tung <ttung at fb.com> writes:

> # HG changeset patch
> # User Tony Tung <tonytung at merly.org>
> # Date 1461740718 25200
> #      Wed Apr 27 00:05:18 2016 -0700
> # Branch stable
> # Node ID 7f80dce78781f5fe691a23f1b7f5a110ed170f32
> # Parent  97811ff7964710d32cae951df1da8019b46151a2
> manifest: improve filesnotin performance by using lazymanifest diff
>
> lazymanifests can compute diffs significantly faster than taking the set
> of two manifests and calculating the delta.

FYI, we're currently in a feature freeze:

https://www.mercurial-scm.org/wiki/TimeBasedReleasePlan

> diff --git a/mercurial/manifest.py b/mercurial/manifest.py
> --- a/mercurial/manifest.py
> +++ b/mercurial/manifest.py
> @@ -211,8 +211,10 @@
>  
>      def filesnotin(self, m2):
>          '''Set of files in this manifest that are not in the other'''
> -        files = set(self)
> -        files.difference_update(m2)
> +        diff = self.diff(m2)
> +        files = set(filepath
> +                    for filepath, hashflags in diff.items()
> +                    if hashflags[1][0] is None)

(for after May 1st) Would it be feasible to have a perf test for this
(and some sweet, sweet performance numbers in the commit message)?


More information about the Mercurial-devel mailing list