/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
            self._translate_io_exception(e, path, ': error retrieving',
248
248
                failure_exc=errors.ReadError)
249
249
 
250
 
    def readv(self, relpath, offsets):
 
250
    def _readv(self, relpath, offsets):
251
251
        """See Transport.readv()"""
252
252
        # We overload the default readv() because we want to use a file
253
253
        # that does not have prefetch enabled.
386
386
        :param mode: The final mode for the file
387
387
        """
388
388
        final_path = self._remote_path(relpath)
389
 
        self._put(final_path, f, mode=mode)
 
389
        return self._put(final_path, f, mode=mode)
390
390
 
391
391
    def _put(self, abspath, f, mode=None):
392
392
        """Helper function so both put() and copy_abspaths can reuse the code"""
397
397
        try:
398
398
            try:
399
399
                fout.set_pipelined(True)
400
 
                self._pump(f, fout)
 
400
                length = self._pump(f, fout)
401
401
            except (IOError, paramiko.SSHException), e:
402
402
                self._translate_io_exception(e, tmp_abspath)
403
403
            # XXX: This doesn't truly help like we would like it to.
418
418
            fout.close()
419
419
            closed = True
420
420
            self._rename_and_overwrite(tmp_abspath, abspath)
 
421
            return length
421
422
        except Exception, e:
422
423
            # If we fail, try to clean up the temporary file
423
424
            # before we throw the exception