~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: John Arbash Meinel
  • Date: 2011-07-18 14:22:20 UTC
  • mto: This revision was merged to the branch mainline in revision 6033.
  • Revision ID: john@arbash-meinel.com-20110718142220-nwylw659oip1ene9
Start at least testing the package_branch regex.
And start testing the is-up-to-date logic.

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
        except FileExists:
115
115
            raise LockError('File %r already locked' % (self.path,))
116
116
 
117
 
    def __del__(self):
118
 
        """Should this warn, or actually try to cleanup?"""
119
 
        if self.lock_file:
120
 
            warning("SFTPLock %r not explicitly unlocked" % (self.path,))
121
 
            self.unlock()
122
 
 
123
117
    def unlock(self):
124
118
        if not self.lock_file:
125
119
            return
281
275
                    buffered = buffered[buffered_offset:]
282
276
                    buffered_data = [buffered]
283
277
                    buffered_len = len(buffered)
 
278
        # now that the data stream is done, close the handle
 
279
        fp.close()
284
280
        if buffered_len:
285
281
            buffered = ''.join(buffered_data)
286
282
            del buffered_data[:]
421
417
        :param relpath: The relative path to the file
422
418
        """
423
419
        try:
424
 
            # FIXME: by returning the file directly, we don't pass this
425
 
            # through to report_activity.  We could try wrapping the object
426
 
            # before it's returned.  For readv and get_bytes it's handled in
427
 
            # the higher-level function.
428
 
            # -- mbp 20090126
429
420
            path = self._remote_path(relpath)
430
421
            f = self._get_sftp().file(path, mode='rb')
431
422
            if self._do_prefetch and (getattr(f, 'prefetch', None) is not None):