~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: Vincent Ladeuil
  • Date: 2017-01-17 13:48:10 UTC
  • mfrom: (6615.3.6 merges)
  • mto: This revision was merged to the branch mainline in revision 6620.
  • Revision ID: v.ladeuil+lp@free.fr-20170117134810-j9p3lidfy6pfyfsc
Merge 2.7, resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011, 2016 Canonical Ltd
 
1
# Copyright (C) 2005-2011, 2016, 2017 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
410
410
        try:
411
411
            path = self._remote_path(relpath)
412
412
            f = self._get_sftp().file(path, mode='rb')
 
413
            size = f.stat().st_size
413
414
            if self._do_prefetch and (getattr(f, 'prefetch', None) is not None):
414
 
                f.prefetch()
 
415
                f.prefetch(size)
415
416
            return f
416
417
        except (IOError, paramiko.SSHException), e:
417
418
            self._translate_io_exception(e, path, ': error retrieving',