[Svnmerge] [PATCH] Bidirectional merging patch for svnmerge.py

Giovanni Bajo rasky at develer.com
Thu Feb 23 16:37:55 PST 2006


Blair Zajac <blair at orcaware.com> wrote:

>>      def __iter__(self):
>>          return iter(self.sorted())
>> +
>> +    def __len__(self):
>> +        return len(self._revs.keys())
>
> I'm working through the patch to see what to merge into
> svn.collab.net.

BTW, you're preparing another iteration for review, right?

> I'm not too fond of the 'len' function operating on a RevisionList
> object, as the name isn't too clear.  Before I looked at the code, I
> was wondering if the length is the difference between the minimum and
> the maximum revision, but see that it's the count of revisions.
> I would prefer to use a name such as count for this.
>
> Comments?

RevisionList would inherit set() in Python 2.4, since it holds sets of
revisions, has set-like operations for union, intersection, etc. You can even
iterate through them (see __iter__) so it's basically obvious for len(revlist)
to match len(list(revlist)). All containers in Python use len(container) and
not something like container.count(), so I think his patch is correct.

Giovanni Bajo




More information about the Svnmerge mailing list