[MERGE] Make cmd_branch check the destination before doing any I/O on the source.

John Arbash Meinel john at arbash-meinel.com
Thu Jul 27 14:18:41 BST 2006


Martin Pool wrote:
>

...

> I'm not really convinced this is a sufficient improvement to justify the
> complexity.  If the original exception was say a KeyboardInterrupt, and
> we then got an exception indicating a real bug in bzr then it would be
> much worse to raise the first.
> 
> In the case of exceptions during cleanup I think we should probably
> follow what python does for del methods - show a warning and continue.
> So
> 
>   except:
>     try:
>       to_transport.delete_tree('.')
>     except TransportError, e:
>       warning("error %s while removing destination", e)
>     raise
> 
> (perhaps display of the exception should be lifted to a
> warn_about_exception).
> 
> Arguably that should catch and warn about everything rather than just
> TransportError, but I think making it specific is fine.
> 

I think we still need to do:

except:
  info = sys.exc_info()
  try:
    to_transport.delete_tree('.')
  except TransportError, e:
    warning("error ...)
    raise info
  raise

The problem with your bare raise is at that point the last exception
could be the TransportError.

But otherwise, I'm okay with it.
John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060727/1a735cd4/attachment.pgp 


More information about the bazaar mailing list