Latest bzr.dev double locks the branch

Robert Collins robertc at robertcollins.net
Fri Feb 10 20:13:25 GMT 2006


On Fri, 2006-02-10 at 12:19 -0600, John A Meinel wrote:
> I had a friend try to use the latest bzr on windows (it was actually a
> branch of my integration...)
> It turns out that the new refactoring for splitting out working tree and
> repository is causing .bzr/branch-lock to get locked 2 times when
> creating a new tree. (Which causes Windows to throw an exception or
> cygwin to deadlock).
> 
> At the end is the traceback of what is going on.
> 
> The function at fault seems to be WorkingTree._write_inventory(), which
> locks the branch, and calls self._control_files.put() which also causes
> the branch to be locked.
> 
> I'm guessing the issue lies in whether WorkingTree is using the Branch's
> control files, or whether we are creating our own.

bzr.dev is faulty here. Format 4,5,6 bzr dirs must share their
control_files attribute and not make new ones, so this must be inherited
from, retrieved from the bzrdir for these format branches.

> But that would at least mean we want [:-1], and [:-2]. Since I'm pretty
> sure Robert put the code in there, it would be nice if he could clarify
> what his intention is for that part of the code. (And if he's really
> nice he could propose a fix so that bzr will work on Windows again).

Its somewhat better in my bzr-dir branch but still a TODO before its
'finished'. I'm likely to get to this Monday, but if you want to do it :
For format 4,5,6 only (aka PreSplitOut) BzrDir instances create a
LockableFiles instances with the branch-lock for locking, and in
Repository formats 4,5,6, branch format 4 and workingtree format 2, pass
that instance across implicitly or explicitly. Then we'll 'lock' the
three elements, but only one lock object will exist.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060211/2b50c570/attachment.pgp 


More information about the bazaar mailing list