Multiple calls to BzrDir.open_branch() return different objects

John A Meinel john at arbash-meinel.com
Fri Feb 24 04:57:16 GMT 2006


Because of how locking works, it seems to me that multiple calls to
BzrDir.open_branch() or open_repository() or open_working_tree() should
return the same object.

Otherwise doing:

dir = BzrDir.open(path)
branch = BzrDir.open_branch()
branch.lock()
try:
  do_something(dir.open_working_tree())
finally:
  branch.unlock()

Will probably cause a deadlock if anything in do_something calls
'wt.branch'.

The current code isn't terrible. It just doesn't seem optimal.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060223/95e94736/attachment.pgp 


More information about the bazaar mailing list