[PATCH 02 of 12] localrepo: add a helper method for creating a label

Sean Farley sean.michael.farley at gmail.com
Tue Aug 19 09:54:43 CDT 2014


Augie Fackler writes:

> On Mon, Aug 18, 2014 at 04:17:58PM -0500, Sean Farley wrote:
>> # HG changeset patch
>> # User Sean Farley <sean.michael.farley at gmail.com>
>> # Date 1396217998 18000
>> #      Sun Mar 30 17:19:58 2014 -0500
>> # Node ID 997cc95ccdd7d74898e2aa52d4cadb1ad24ad0ef
>> # Parent  ed72c4bcbbbcab7f75f6b86fee6c67aa45590e7c
>> localrepo: add a helper method for creating a label
>>
>> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
>> --- a/mercurial/localrepo.py
>> +++ b/mercurial/localrepo.py
>> @@ -700,10 +700,23 @@ class localrepository(object):
>>          for bookmark, n in self._bookmarks.iteritems():
>>              if n == node:
>>                  marks.append(bookmark)
>>          return sorted(marks)
>>
>> +    def _createlabelnamespace(self, namespace):
>
> Probably worth a comment that collections.defaultdict could obsolete
> this once we drop 2.4.
>
> (I don't think it's worth building a generalized defaultdict polyfill
> for this one case, but I do want to believe that EOLing 2.4 is
> coming.)

Sure, but in an earlier iteration I used this function to create a
templatekw for each namespace. I dropped it for this series since I
imagine there will be some major bikeshedding.


More information about the Mercurial-devel mailing list