~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: John Arbash Meinel
  • Date: 2005-11-10 01:31:41 UTC
  • mto: This revision was merged to the branch mainline in revision 1508.
  • Revision ID: john@arbash-meinel.com-20051110013141-f6cc853a1d85a9a9
Added a test that copy_to raises NoSuchFile when a directory is missing (not IOError)

Show diffs side-by-side

added added

removed removed

Lines of Context:
183
183
            count = 0
184
184
            for path in relpaths:
185
185
                self._update_pb(pb, 'copy-to', count, total)
186
 
                shutil.copy(self.abspath(path), other.abspath(path))
 
186
                try:
 
187
                    shutil.copy(self.abspath(path), other.abspath(path))
 
188
                except IOError, e:
 
189
                    if e.errno in (errno.ENOENT, errno.ENOTDIR):
 
190
                        raise NoSuchFile('File or directory %r does not exist' % path, orig_error=e)
 
191
                    raise LocalTransportError(orig_error=e)
187
192
                count += 1
188
193
            return count
189
194
        else: