At http://bzr.arbash-meinel.com/branches/bzr/1.11/get_record_stream_chunked
------------------------------------------------------------
revno: 3893
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: John Arbash Meinel <[EMAIL PROTECTED]>
branch nick: get_record_stream_chunked
timestamp: Wed 2008-12-10 19:01:04 -0600
message:
Use the 'chunked' interface to keep memory consumption minimal during
revision_trees()
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2008-12-10 04:34:21 +0000
+++ b/bzrlib/repository.py 2008-12-11 01:01:04 +0000
@@ -1680,14 +1680,15 @@
def _iter_inventory_xmls(self, revision_ids):
keys = [(revision_id,) for revision_id in revision_ids]
stream = self.inventories.get_record_stream(keys, 'unordered', True)
- texts = {}
+ text_chunks = {}
for record in stream:
if record.storage_kind != 'absent':
- texts[record.key] = record.get_bytes_as('fulltext')
+ text_chunks[record.key] = record.get_bytes_as('chunked')
else:
raise errors.NoSuchRevision(self, record.key)
for key in keys:
- yield texts[key], key[-1]
+ chunks = text_chunks.pop(key)
+ yield ''.join(chunks), key[-1]
def deserialise_inventory(self, revision_id, xml):
"""Transform the xml into an inventory object.
--
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits