~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.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:
33
33
)
34
34
from bzrlib.branch import BranchReferenceFormat
35
35
from bzrlib.bzrdir import BzrDir, RemoteBzrDirFormat
36
 
from bzrlib.decorators import needs_read_lock, needs_write_lock
 
36
from bzrlib.decorators import needs_read_lock, needs_write_lock, only_raises
37
37
from bzrlib.errors import (
38
38
    NoSuchRevision,
39
39
    SmartProtocolError,
1046
1046
        else:
1047
1047
            raise errors.UnexpectedSmartServerResponse(response)
1048
1048
 
 
1049
    @only_raises(errors.LockNotHeld, errors.LockBroken)
1049
1050
    def unlock(self):
1050
1051
        if not self._lock_count:
1051
1052
            return lock.cant_unlock_not_held(self)
2346
2347
            return
2347
2348
        raise errors.UnexpectedSmartServerResponse(response)
2348
2349
 
 
2350
    @only_raises(errors.LockNotHeld, errors.LockBroken)
2349
2351
    def unlock(self):
2350
2352
        try:
2351
2353
            self._lock_count -= 1