~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockdir.py

  • Committer: Martin Pool
  • Date: 2006-04-20 01:29:04 UTC
  • mto: This revision was merged to the branch mainline in revision 1675.
  • Revision ID: mbp@sourcefrog.net-20060420012904-b3166df65e728801
Translate unknown sftp errors to PathError, no NoSuchFile

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
        LockError,
110
110
        LockNotHeld,
111
111
        NoSuchFile,
 
112
        PathError,
112
113
        ResourceBusy,
113
114
        UnlockableTransport,
114
115
        )
 
116
from bzrlib.trace import mutter
115
117
from bzrlib.transport import Transport
116
118
from bzrlib.osutils import rand_chars
117
119
from bzrlib.rio import RioWriter, read_stanza, Stanza
201
203
            self.transport.rename(tmpname, self._held_dir)
202
204
            self._lock_held = True
203
205
            self.confirm()
204
 
            return
205
 
        except (DirectoryNotEmpty, FileExists, ResourceBusy), e:
206
 
            pass
207
 
        # fall through to here on contention
208
 
        raise LockContention(self)
 
206
        except (PathError, DirectoryNotEmpty, FileExists, ResourceBusy), e:
 
207
            mutter("contention on %r: %s", self, e)
 
208
            raise LockContention(self)
209
209
 
210
210
    def unlock(self):
211
211
        """Release a held lock