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

Sean Farley sean.michael.farley at gmail.com
Thu May 15 20:05:29 CDT 2014


Pierre-Yves David <pierre-yves.david at ens-lyon.org> writes:

> 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?

Sure. There is only one fast path in status: comparing the working
directory with its first parent. For that, we need a few things to
happen fast:

1) check the dirstate
2) generate a (pseudo)manifest
3) filter out suspect/bad symlinks (only for win32)

(1) and (2) check test for the fast path situation (workingctx +
repo['.']) and then, if so, copy the manifest from the parent and
replace it with modified, removed, etc. files.

>> 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?

Hmmm, ok, that's a good point. I will need someone else's help here to
explain what should be done.


More information about the Mercurial-devel mailing list