[Svnmerge] [PATCH] Bidirectional merging patch for svnmerge.py
blair at orcaware.com
Thu Feb 23 16:46:40 PST 2006
Giovanni Bajo wrote:
> 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
> 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.
> 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.
How about we rename RevisionList to RevisionSet then? That makes much more
sense given what you described here.
More information about the Svnmerge