~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: John Arbash Meinel
  • Date: 2005-11-30 15:00:18 UTC
  • mto: (1185.50.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1518.
  • Revision ID: john@arbash-meinel.com-20051130150018-9eddb345cd6b42e1
Disabling prefetch

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
    """
215
215
    Transport implementation for SFTP access.
216
216
    """
 
217
    _do_prefetch = False # Right now Paramiko's prefetch support causes things to hang
217
218
 
218
219
    def __init__(self, base, clone_from=None):
219
220
        assert base.startswith('sftp://')
306
307
        try:
307
308
            path = self._abspath(relpath)
308
309
            f = self._sftp.file(path)
309
 
            # TODO: Don't prefetch until paramiko fixes itself
310
 
            if hasattr(f, 'prefetch'):
 
310
            if self._do_prefetch and hasattr(f, 'prefetch'):
311
311
                f.prefetch()
312
312
            return f
313
313
        except (IOError, paramiko.SSHException), x:
328
328
        # TODO: implement get_partial_multi to help with knit support
329
329
        f = self.get(relpath)
330
330
        f.seek(start)
331
 
        if hasattr(f, 'prefetch'):
 
331
        if self._do_prefetch and hasattr(f, 'prefetch'):
332
332
            f.prefetch()
333
333
        return f
334
334