~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lock.py

Introduce a new lock_broken hook.

* tests/test_lockdir.py:
(TestLockDirHooks): Separate hook related tests from other lock
tests.
(TestLockDirHooks.test_LockDir_broken_success,
TestLockDirHooks.test_LockDir_broken_failure): Add tests for the
new lock_broken hook.

* lockdir.py:
(LockDir.force_break): Fire lock_broken hook.

* lock.py:
(LockHooks.__init__): Add lock_broken hook.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
        self.create_hook(HookPoint('lock_released',
56
56
            "Called with a bzrlib.lock.LockResult when a physical lock is "
57
57
            "released.", (1, 8), None))
 
58
        self.create_hook(HookPoint('lock_broken',
 
59
            "Called with a bzrlib.lock.LockResult when a physical lock is "
 
60
            "broken.", (1, 15), None))
58
61
 
59
62
 
60
63
class Lock(object):