[MERGE] add lock hooks
John Arbash Meinel
john at arbash-meinel.com
Tue May 27 14:53:19 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Martin Pool wrote:
| Here is an updated version of this patch. Compared to the previous one.
| * New base class PhysicalLock, with a .hooks attribute, rather than having
| it in the module namespace (where it might easily be incorrectly
| * Hooks base class gains clone() and clear_hooks() methods, which I think
| are a cleaner way to save/clear/restore the hooks in tests or similar.
| * It's updated for changes in the hooks api since it was written.
| * Hooks renamed to lock_acquired and lock_released in keeping with the
| general style of naming.
^- Ian made a strong argument for calling these "Params" rather than "Results".
I could go either way here. You *are* talking about the result of locking, but
it is the parameters being passed to the hooks.
You mention PhysicalLock.hooks in your email and in NEWS, but I see:
~ class LockDir(object):
- - """Write-lock guarding access to data."""
+ """Write-lock guarding access to data.
+ :cvar hooks: Hook dictionary for operations on locks.
~ __INFO_NAME = '/info'
+ hooks = Hooks()
^- No inheriting from PhysicalLock, just LockDir.hooks
So I'm thinking you forgot to commit something. Otherwise this would probably be
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar