~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

Merge in bzrdir work to enable checkout improvements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
231
231
        :return: A lock object, which should be passed to Transport.unlock()
232
232
        """
233
233
        from bzrlib.lock import ReadLock
234
 
        return ReadLock(self.abspath(relpath))
 
234
        path = relpath
 
235
        try:
 
236
            path = self.abspath(relpath)
 
237
            return ReadLock(path)
 
238
        except (IOError, OSError), e:
 
239
            self._translate_error(e, path)
235
240
 
236
241
    def lock_write(self, relpath):
237
242
        """Lock the given file for exclusive (write) access.
242
247
        from bzrlib.lock import WriteLock
243
248
        return WriteLock(self.abspath(relpath))
244
249
 
 
250
    def rmdir(self, relpath):
 
251
        """See Transport.rmdir."""
 
252
        path = relpath
 
253
        try:
 
254
            path = self.abspath(relpath)
 
255
            os.rmdir(path)
 
256
        except (IOError, OSError),e:
 
257
            self._translate_error(e, path)
245
258
 
246
259
class ScratchTransport(LocalTransport):
247
260
    """A transport that works in a temporary dir and cleans up after itself.