[MERGE] cleanup progress properly when interrupted during fetch (#54000)
John Arbash Meinel
john at arbash-meinel.com
Mon Sep 25 18:13:41 BST 2006
Aaron Bentley wrote:
> Hi all,
> This bundle fixes the cleanup of fetch by making iter_added_or_deleted
> take a progress object, instead of creating one.
> Iterators can't generate nested progress bars, because they can't
> guarantee that they will clean them up.
+1 on the concept, but I have one comment:
+ self.assertEqual(, progress.updates)
+ except AssertionError:
^- This looks really bad to me. I would rather see:
if progress.updates not in (, expected):
if progress.updates != expected:
'progress.updates should either have no updates or all updates'
'\nexpected: %s\nactual: %s'
% (expected, progress.updates))
Or something like that.
Catching the AssertionError is the wrong way to do it.
To me, 'assertEqual()' is just a helper that has a nice default error
message which includes the things being compared.
So with some sort of fix that doesn't catch AssertionError, +1 from me.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060925/81a73d30/attachment.pgp
More information about the bazaar