[MERGE] Fix bug #314525: don't try to put ids if there is no annotation.
v.ladeuil+lp at free.fr
Tue Jan 27 17:41:22 GMT 2009
>>>>> "jam" == John Arbash Meinel <john at arbash-meinel.com> writes:
jam> Vincent Ladeuil wrote:
>> We can't add ids if there is no lines to annotate.
>> Anne provided the fix on launchpad, I just lightly adapt it and
>> post it here so that it get tracked properly.
jam> Personally, I would have done:
jam> if not annotations:
Right, Anne did it that way, I thought it was less hackish that
way, two against one, you win :)
jam> And then you can leave the rest of the code unchanged.
jam> I would be a little concerned that 'annotations' may
jam> want to be an iterator at some point, so it might
jam> actually be better to do:
I'd love that, but in that case there will me more than just that
to change, so I leave it as above.
jam> max_origin_len = max(len(origin) for origin, text in annotations)
jam> except ValueError:
jam> # No lines, nothing to annotate
jam> Regardless, your fix is fine, just thinking out loud
jam> about alternatives.
Sure, that's for reviews are for and that's welcome.
Thanks for Anne, sent to pqm.
More information about the bazaar