~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-12-11 20:23:00 UTC
  • mfrom: (3890.2.18 get_record_stream_chunked)
  • Revision ID: pqm@pqm.ubuntu.com-20081211202300-6dz1vo3phfsc23pj
(jam) Add ContentFactory.get_bytes_as('chunked') and
        osutils.chunks_to_lines()

Show diffs side-by-side

added added

removed removed

Lines of Context:
1680
1680
    def _iter_inventory_xmls(self, revision_ids):
1681
1681
        keys = [(revision_id,) for revision_id in revision_ids]
1682
1682
        stream = self.inventories.get_record_stream(keys, 'unordered', True)
1683
 
        texts = {}
 
1683
        text_chunks = {}
1684
1684
        for record in stream:
1685
1685
            if record.storage_kind != 'absent':
1686
 
                texts[record.key] = record.get_bytes_as('fulltext')
 
1686
                text_chunks[record.key] = record.get_bytes_as('chunked')
1687
1687
            else:
1688
1688
                raise errors.NoSuchRevision(self, record.key)
1689
1689
        for key in keys:
1690
 
            yield texts[key], key[-1]
 
1690
            chunks = text_chunks.pop(key)
 
1691
            yield ''.join(chunks), key[-1]
1691
1692
 
1692
1693
    def deserialise_inventory(self, revision_id, xml):
1693
1694
        """Transform the xml into an inventory object.