[MERGE] fix #306394 (status handle non-existent files too)

Karl Fogel karl.fogel at canonical.com
Tue Feb 10 21:34:05 GMT 2009


Ian Clatworthy <ian.clatworthy at canonical.com> writes:
>>> +            for nonexistent in nonexistents:
>>> +                if short:
>>> +                    prefix = 'X  '
>>> +                else:
>>> +                    prefix = ' '
>>> +                to_file.write("%s %s\n" % (prefix, nonexistent))
>> 
>> The calculation of prefix should probably be done outside the loop.
>> In practice, this ought to happen *so* rarely that's it very minor though.
>
> Hmmm - I've left it as is and put a comment in as to why doing it there
> is fine.

Yes, your comment says what I should have said there: it's hard to know
whether having exactly zero or one non-existent files is more common
than N > 1, but it seems likely that is the case, and if so, keeping the
prefix assignments inside the loop makes sense.

In a world of pointless over-optimization, that is :-).

> Done and sent to PQM.

Thanks!

-Karl



More information about the bazaar mailing list