~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockable_files.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-08 03:11:35 UTC
  • mfrom: (4634.62.5 only-raises)
  • Revision ID: pqm@pqm.ubuntu.com-20091008031135-6d7vxh4s0umav1eo
(andrew) Add 'only_raises' decorator,
        use it to suppress most errors from Branch/Repository.unlock.

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)