[SVNMERGE][PATCH] svnmerge rollback
Madan U Sreenivasan
madan at collab.net
Fri May 19 07:31:49 PDT 2006
On Fri, 19 May 2006 18:38:58 +0530, Giovanni Bajo <rasky at develer.com>
wrote:
> Madan U Sreenivasan wrote:
>
>>>>> + if len(revs) == 0:
>>> if revs:
>> [snip]
>>>>> + if len(revs & src_pre_exist_range) !=
>>> 0:
>>> if revs & src_pre_exist_range:
>>
>> hmmm, both expressions result in and empty RevisionSet, and not None.
>> So, am afraid we cant do this...
>
> RevisionSet implements __nonzero__.
>
>>>> import svnmerge
>>>> r = svnmerge.RevisionSet("")
>>>> if r:
> ... print "ciao"
> ...
>>>> bool(r)
> False
silly me... was using your suggestion as is...
>>> if revs:
in reality, the logic is:
if not revs:
No wonder the tests were failing then... ;)
Yes, you are right , the __non_zero__ thing is cool. Will use it. Thanks.
Before I fix this and send another version of the patch, do you see
anything else that could be improved in the second version of the patch
that I just sent? I would like to wait for more comments before giving one
final patch.
Regards,
Madan.
More information about the Svnmerge
mailing list