~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-05 05:42:28 UTC
  • mfrom: (3959.1.5 debug-sftp)
  • Revision ID: pqm@pqm.ubuntu.com-20090205054228-3qyiv92vtgs94e0c
(mbp) better and less redundant debug flag docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
from bzrlib import (
41
41
    config,
 
42
    debug,
42
43
    errors,
43
44
    urlutils,
44
45
    )
182
183
                requests.append((start, next_size))
183
184
                size -= next_size
184
185
                start += next_size
185
 
        mutter('SFTP.readv(%s) %s offsets => %s coalesced => %s requests',
186
 
               self.relpath, len(sorted_offsets), len(coalesced),
187
 
               len(requests))
 
186
        if 'sftp' in debug.debug_flags:
 
187
            mutter('SFTP.readv(%s) %s offsets => %s coalesced => %s requests',
 
188
                self.relpath, len(sorted_offsets), len(coalesced),
 
189
                len(requests))
188
190
        return requests
189
191
 
190
192
    def request_and_yield_offsets(self, fp):
286
288
            del buffered_data[:]
287
289
            data_chunks.append((input_start, buffered))
288
290
        if data_chunks:
289
 
            mutter('SFTP readv left with %d out-of-order bytes',
290
 
                   sum(map(lambda x: len(x[1]), data_chunks)))
 
291
            if 'sftp' in debug.debug_flags:
 
292
                mutter('SFTP readv left with %d out-of-order bytes',
 
293
                    sum(map(lambda x: len(x[1]), data_chunks)))
291
294
            # We've processed all the readv data, at this point, anything we
292
295
            # couldn't process is in data_chunks. This doesn't happen often, so
293
296
            # this code path isn't optimized
446
449
            readv = getattr(fp, 'readv', None)
447
450
            if readv:
448
451
                return self._sftp_readv(fp, offsets, relpath)
449
 
            mutter('seek and read %s offsets', len(offsets))
 
452
            if 'sftp' in debug.debug_flags:
 
453
                mutter('seek and read %s offsets', len(offsets))
450
454
            return self._seek_and_read(fp, offsets, relpath)
451
455
        except (IOError, paramiko.SSHException), e:
452
456
            self._translate_io_exception(e, path, ': error retrieving')