[PATCH 16 of 19] workingctx: use inheritance for _generatestatus while keeping the fastpath

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu May 15 19:20:38 CDT 2014



On 05/15/2014 02:16 PM, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean.michael.farley at gmail.com>
> # Date 1398346484 18000
> #      Thu Apr 24 08:34:44 2014 -0500
> # Node ID 5e4e31f7dca07c7883f01e339e1365c882e5d213
> # Parent  dde09eaa8280d8138c76c8e74eae388f30ffce40
> workingctx: use inheritance for _generatestatus while keeping the fastpath

Can you be a bit more verbose on this fastpath business?


>
> diff --git a/mercurial/context.py b/mercurial/context.py
> --- a/mercurial/context.py
> +++ b/mercurial/context.py
> @@ -1300,10 +1300,23 @@ class workingctx(committablectx):
>               if fixup and listclean:
>                   clean += fixup
>
>           return [modified, added, removed, deleted, unknown, ignored, clean]
>
> +    def _generatestatus(self, other, s, match, listignored, listclean,
> +                        listunknown):
> +        """generate a status with respect to another context
> +
> +        This includes logic for maintaining the fast path of status when
> +        comparing against its parent.
> +        """
> +        if other != self._repo['.']:

This check looks strange to me. It seems to no include parent2 in case 
of merge. apparently the old code had the same bias. What is happening 
if we use both parent here?

> +            s = super(workingctx, self)._generatestatus(other, s, match,
> +                                                        listignored, listclean,
> +                                                        listunknown)
> +        return s
> +

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list