~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-06 16:29:12 UTC
  • mto: This revision was merged to the branch mainline in revision 1869.
  • Revision ID: john@arbash-meinel.com-20060706162912-1680b115cdb24071
[merge] Johan Rydberg test updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
307
307
        
308
308
        Note that some transports MAY allow querying on directories, but this
309
309
        is not part of the protocol.  In other words, the results of 
310
 
        t.has("a_directory_name") are undefined."
 
310
        t.has("a_directory_name") are undefined.
311
311
        """
312
312
        raise NotImplementedError(self.has)
313
313
 
366
366
                yield offset, data[pos:pos + size]
367
367
                pos += size
368
368
 
 
369
        def normalize_offsets(offsets):
 
370
            stat = None
 
371
            new_offsets = []
 
372
            for (offset, size) in offsets:
 
373
                if offset < 0:
 
374
                    if stat is None:
 
375
                        stat = self.stat(relpath)
 
376
                    offset = stat.st_size + offset
 
377
                new_offsets.append((offset, size))
 
378
            return new_offsets
 
379
        
369
380
        if not len(offsets):
370
381
            return
 
382
        offsets = normalize_offsets(offsets)
371
383
        fp = self.get(relpath)
372
384
        pending_offsets = deque(offsets)
373
385
        combined_offsets = []