[RFC] bzr info improvements, now with locking status

Olaf Conradi oohlaf at gmail.com
Sun Apr 30 22:34:56 BST 2006

OK, upon the previous improvements, there is now initial support to
query the status of the locks present in a checkout, branch and

On 21/04/06, Olaf Conradi <olaf at conradi.org> wrote:
> Hi
> New version of patch after Robert's comments.
>  * Show repository location when it's shared or differs from branch
>     https://launchpad.net/products/bzr/+bug/38332
>  * Extra testcase for info on non existing branches
>  * Few comments additions
>  * New help text (with help from jblack)
>  * Prefix checkout with light if it's lightweight
>  * Rename bound branch to checkout
>  * Detect construct used by comparing transport root, not bzrdir object
 * Fix upgrade error in test_info test case.

 * Add is_locked() to Branch and WorkingTree, Repository already had
one. This method is only used to query the (in-memory) lock status of
the objects.
 * Add get_physical_lock_status to retrieve the lock status on the transport.
 * Show lock status in a new section of bzr info

At present this is only implemented for the new LockDir style locks.
The old transport locks have some problems and I tried to find a way
to query the locks, but haven't found one. And can't test the windows
locks as I do not use it.

For unix, the os style locks use fcntl.lockf. I tried to set a new
write lock and see if it raises IOError, but unfortunately that does
not happen. See attached locktest.py. We could add peek() to class
_fcntl_WriteLock in lock.py and return True, and in _fcntl_ReadLock
return None. But that does not query the filesystem.

So at the moment TransportLock just returns NotImplementedError and
get_physical_lock_status returns false on it. We could pass that error
through to the caller.

The test case for oslocks needs to be adjusted to whatever we decide.
The test case is now marked skipped.

> http://deschacht.student.utwente.nl/bzr/bazaar-vcs/bzr.olaf.info

-------------- next part --------------
A non-text attachment was scrubbed...
Name: info_with_locks.diff
Type: text/x-patch
Size: 43812 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060430/ace51abc/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: locktest.py
Type: text/x-python
Size: 455 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060430/ace51abc/attachment.py 

More information about the bazaar mailing list