win32 file locking

Aaron Bentley aaron.bentley at utoronto.ca
Wed May 25 13:06:58 BST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John A Meinel wrote:
> The problem is that Branch() is commonly used as a temporary object. For
> instance the 'bzr revno' command is done like:
> 
> print Branch('.').revno()
> 
> How do you unlock a branch if you never have an object to call
> 'unlock()' on?

I guess one option would be to provide convenience functions like this:

def branch_revno(path='.'):
    b = Branch(path, lock_mode='r')
    revno = b.revno()
    b.unlock()
    return b

i.e. eliminate all use of Branch temporaries by making it really easy to
do it the Right Way.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFClGph0F+nu1YWqI0RAo2lAJ9ZaSjqBR5oOCxrT0aLP/zZEftepQCeIDJW
nv3acJZoX5Xzo3YkIOdCbdk=
=0Mkm
-----END PGP SIGNATURE-----




More information about the bazaar mailing list