Multiple calls to BzrDir.open_branch() return different objects

Martin Pool mbp at sourcefrog.net
Fri Feb 24 05:41:24 GMT 2006


On Thu, 2006-02-23 at 22:57 -0600, John A Meinel wrote:
> 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'.

I agree.  They should be lazily constructed and stored in the bzrdir.

-- 
Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060224/10fb3d22/attachment.pgp 


More information about the bazaar mailing list