[PATCH 1 of 3] dirstate: add a method to filter by not included

Siddharth Agarwal sid0 at fb.com
Fri Feb 1 17:49:23 CST 2013


On 02/01/2013 03:26 PM, Matt Mackall wrote:
> On Fri, 2013-02-01 at 14:41 -0800, Siddharth Agarwal wrote:
>> # HG changeset patch
>> # User Siddharth Agarwal <sid0 at fb.com>
>> # Date 1359672835 28800
>> # Branch stable
>> # Node ID 9139388e66b4c6295c85989f27357c280a40025d
>> # Parent  d4f93b62e7af1b8fe71de99e0483d0a75b2b6746
>> dirstate: add a method to filter by not included
>>
>> This is the bulk what merge._checkunknown does, except much faster. That
>> function will be made to use this in an upcoming patch.
>>
>> diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
>> --- a/mercurial/dirstate.py
>> +++ b/mercurial/dirstate.py
>> @@ -551,6 +551,17 @@ class dirstate(object):
>>                   return True
>>           return False
>>   
>> +    def notincluded(self, files):
>> +        """Return all the entries in files not included in the dirstate.
> I guess you're putting this in dirstate because it wants direct access
> to _map for speed. This is a bit unfortunate: it's unlikely to ever have
> other users and has a not-terribly-precise name.

Yep. Banging on the map directly is significantly (around 0.2 seconds) 
faster. Such is the cost of abstraction. :(

I'm open to other suggestions for the name though.


More information about the Mercurial-devel mailing list