~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to groupcompress.py

  • Committer: John Arbash Meinel
  • Date: 2009-02-25 22:21:23 UTC
  • mto: (0.22.4 experimental)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090225222123-frjzu1meidd6qafi
Implement new handling of get_bytes_as(), and get_missing_compression_parent_keys()
Now works on bzr.dev's new streaming code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
554
554
        # recipe, and we often want to end up with lines anyway.
555
555
        return plain, split_lines(plain[index_memo[3]:index_memo[4]])
556
556
 
 
557
    def get_missing_compression_parent_keys(self):
 
558
        """Return the keys of missing compression parents.
 
559
 
 
560
        Missing compression parents occur when a record stream was missing
 
561
        basis texts, or a index was scanned that had missing basis texts.
 
562
        """
 
563
        # GroupCompress cannot currently reference texts that are not in the
 
564
        # group, so this is valid for now
 
565
        return frozenset()
 
566
 
557
567
    def get_record_stream(self, keys, ordering, include_delta_closure):
558
568
        """Get a stream of records for keys.
559
569
 
688
698
            # Raise an error when a record is missing.
689
699
            if record.storage_kind == 'absent':
690
700
                raise errors.RevisionNotPresent([record.key], self)
691
 
            elif record.storage_kind in ('chunked', 'fulltext'):
 
701
            try:
692
702
                lines = osutils.chunks_to_lines(record.get_bytes_as('chunked'))
693
 
            else:
 
703
            except errors.UnavailableRepresentation:
694
704
                adapter_key = record.storage_kind, 'fulltext'
695
705
                adapter = get_adapter(adapter_key)
696
706
                bytes = adapter.get_bytes(record,