lock_* API change

Robert Collins robertc at robertcollins.net
Fri May 14 08:18:19 BST 2010


On Thu, May 13, 2010 at 11:44 PM, Jelmer Vernooij <jelmer at samba.org> wrote:
> On Wed, 2010-05-12 at 19:18 +1200, Robert Collins wrote:
>> Yesterday we landed a change to the lock_* API's which needs an action
>> taken by all implementors of lock_* methods. In particular,
>> bzr-svn/bzr-git/bzr-hg are likely to need an update.
>>
>> The change is pretty trivial - see the patch in trunk.
> Is this in preparation of the (eventual) removal of
> {Repository,Branch,WorkingTree}.unlock() ? What are your plans with the
> locking API ?

I don't have any specific plan to remove unlock. This change is for a
few reasons: it makes it easier to change in the future (e.g. to
permit
with tree.lock_tree_write() as tlock:
    blah
)

I wanted to reduce copy paste errors in bzr-builddeb and other code
bases, and to make the contract more consistent across bzr; its made
quite a bit of code cleaner.

-Rob



More information about the bazaar mailing list