/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

  • Committer: Alexander Belchenko
  • Date: 2007-09-25 19:04:31 UTC
  • mfrom: (2862 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2863.
  • Revision ID: bialix@ukr.net-20070925190431-latvmyau7wq0ny90
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
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