[merge] LockDir creates 'lock/' as part of lock_write()

John Arbash Meinel john at arbash-meinel.com
Thu Aug 24 21:08:49 BST 2006


This bug was reported recently:
https://launchpad.net/products/bzr/+bug/56974

Basically, the problem is that someone manually deleted the
'.bzr/repository/lock/' directory, which means that all future actions
fail to create their pending directories.

The attached patch changes LockDir.lock_write() so that if the mkdir()
on the pending directory fails with a NoSuchFile, it goes back and tries
to create the parent lock/ directory, and tries again.

This is a case of a user messing up their own repository, but I think
this patch handles recovering gracefully.

The alternative would be to raise another error, with a hopefully more
obvious comment, saying that the lock directory is missing.

I don't know if this is an 0.10 fix or not. It is small, but I have no
problem waiting for 0.11.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: create-lock-dir-56974.patch
Type: text/x-patch
Size: 3361 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060824/33061336/attachment.bin 
-------------- 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/20060824/33061336/attachment.pgp 


More information about the bazaar mailing list