~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/__init__.py

  • Committer: Martin Pool
  • Date: 2006-02-20 22:05:28 UTC
  • mto: This revision was merged to the branch mainline in revision 1569.
  • Revision ID: mbp@sourcefrog.net-20060220220528-33bc3e992d169b4c
New DirectoryNotEmpty exception, and raise this from local and memory 
transports.

Check that some PathError is raised when trying to remove a non-empty
directory - not necessarily DirectoryNotEmpty because sftp can't detect 
it.

-- This line and the following will be ignored --

modified:
  bzrlib/errors.py
  bzrlib/tests/test_transport_implementations.py
  bzrlib/transport/__init__.py
  bzrlib/transport/memory.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
107
107
                raise errors.FileExists(path, extra=e)
108
108
            if e.errno == errno.EACCES:
109
109
                raise errors.PermissionDenied(path, extra=e)
 
110
            if e.errno == errno.ENOTEMPTY:
 
111
                raise errors.DirectoryNotEmpty(path, extra=e)
110
112
        if raise_generic:
111
113
            raise errors.TransportError(orig_error=e)
112
114