At http://bzr.arbash-meinel.com/branches/bzr/brisbane/hack2

------------------------------------------------------------
revno: 3843
revision-id: [email protected]
parent: [email protected]
committer: John Arbash Meinel <[email protected]>
branch nick: hack2
timestamp: Sun 2009-03-01 20:02:01 -0600
message:
  Batch inventory texts by 200, to avoid getting MemoryError.
=== modified file 'bzrlib/fetch.py'
--- a/bzrlib/fetch.py   2009-02-25 08:44:56 +0000
+++ b/bzrlib/fetch.py   2009-03-02 02:02:01 +0000
@@ -300,10 +300,17 @@
 
     def _get_simple_inventory_stream(self, revision_ids):
         from_weave = self.from_repository.inventories
-        yield ('inventories', from_weave.get_record_stream(
-            [(rev_id,) for rev_id in revision_ids],
-            self.inventory_fetch_order(),
-            not self.delta_on_metadata()))
+        include_delta_closure = not self.delta_on_metadata()
+        keys = [(rev_id,) for rev_id in revision_ids]
+        if include_delta_closure:
+            batch_size = 200
+        else:
+            batch_size = len(keys)
+        for start in xrange(0, len(keys), batch_size):
+            batch = keys[start:start+batch_size]
+            yield ('inventories', from_weave.get_record_stream(
+                batch, self.inventory_fetch_order(),
+                include_delta_closure))
 
     def _get_chk_inventory_stream(self, revision_ids):
         """Fetch the inventory texts, along with the associated chk maps."""

-- 
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits

Reply via email to