[bug] unlock branch if we fail to lock repo
robertc at robertcollins.net
Fri Jun 30 19:08:43 BST 2006
On Fri, 2006-06-30 at 10:20 -0500, John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> The current bzr code gives this error if you ask to update a branch
> while another branch is being updated:
> bzr: ERROR: Could not acquire lock
> H:\dev\bzr\bzr.dev\bzrlib\lockable_files.py:110: UserWarning: file group
> url=file:///path/.bzr/branch/>) was not explicitly unlocked
> warn("file group %r was not explicitly unlocked" % self)
> The reason is that locking the branch control files is succeeding, but
> locking the repository is failing, and when the exception is raised, we
> aren't doing any cleanup.
> We are doing the right thing in WorkingTree.lock_write(), so I propose
> we do the same in Branch.lock_write() with the following code:
> def lock_write(self):
> """Lock both the branch and repository"""
> It is a small thing, but I think it gives better errors.
> Should we be doing the same thing for 'lock_read()' even though it isn't
> really locking anything?
Yes, some repos etc do lock.
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060701/ddd7a774/attachment.pgp
More information about the bazaar