~jameinel/bzr/fix-push2

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: Robey Pointer
  • Date: 2005-11-22 01:41:46 UTC
  • mfrom: (1185.40.1)
  • mto: (1185.33.37 bzr.dev)
  • mto: This revision was merged to the branch mainline in revision 1512.
  • Revision ID: robey@lag.net-20051122014146-5186f5e310a15202
make sftp put faster when using paramiko 1.5.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
        """
179
179
        try:
180
180
            path = self._abspath(relpath)
181
 
            return self._sftp.file(path)
 
181
            f = self._sftp.file(path)
 
182
            try:
 
183
                f.prefetch()
 
184
            except AttributeError:
 
185
                # only works on paramiko 1.5.1 or greater
 
186
                pass
 
187
            return f
182
188
        except (IOError, paramiko.SSHException), x:
183
189
            raise NoSuchFile('Error retrieving %s: %s' % (path, str(x)), x)
184
190
 
196
202
        """
197
203
        f = self.get(relpath)
198
204
        f.seek(start)
 
205
        try:
 
206
            f.prefetch()
 
207
        except AttributeError:
 
208
            # only works on paramiko 1.5.1 or greater
 
209
            pass
199
210
        return f
200
211
 
201
212
    def put(self, relpath, f):