~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockable_files.py

  • Committer: Andrew Bennetts
  • Date: 2009-09-25 02:08:08 UTC
  • mto: (4744.3.1 robust-cleanup-in-commit)
  • mto: This revision was merged to the branch mainline in revision 4775.
  • Revision ID: andrew.bennetts@canonical.com-20090925020808-ntfm9j9yz9t18gmu
Add some experimental decorators: @only_raises(..) and @cleanup_method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
""")
33
33
 
34
34
from bzrlib.decorators import (
35
 
    needs_read_lock,
36
 
    needs_write_lock,
 
35
    only_raises,
37
36
    )
38
37
from bzrlib.symbol_versioning import (
39
38
    deprecated_in,
221
220
        """Setup a write transaction."""
222
221
        self._set_transaction(transactions.WriteTransaction())
223
222
 
 
223
    @only_raises(errors.LockNotHeld, errors.LockBroken)
224
224
    def unlock(self):
225
225
        if not self._lock_mode:
226
226
            return lock.cant_unlock_not_held(self)