~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.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:
49
49
from bzrlib.testament import Testament
50
50
""")
51
51
 
52
 
from bzrlib.decorators import needs_read_lock, needs_write_lock
 
52
from bzrlib.decorators import needs_read_lock, needs_write_lock, only_raises
53
53
from bzrlib.inter import InterObject
54
54
from bzrlib.inventory import (
55
55
    Inventory,
1720
1720
        self.start_write_group()
1721
1721
        return result
1722
1722
 
 
1723
    @only_raises(errors.LockNotHeld, errors.LockBroken)
1723
1724
    def unlock(self):
1724
1725
        if (self.control_files._lock_count == 1 and
1725
1726
            self.control_files._lock_mode == 'w'):