Rev 33: Finish the Fulltext => Chunked conversions so that we work in the more-efficient Chunks. in http://bazaar.launchpad.net/%7Ebzr/bzr-groupcompress/trunk

John Arbash Meinel john at arbash-meinel.com
Tue Feb 17 22:17:47 GMT 2009


At http://bazaar.launchpad.net/%7Ebzr/bzr-groupcompress/trunk

------------------------------------------------------------
revno: 33
revision-id: john at arbash-meinel.com-20090217221724-hyci8qk412m7mgyy
parent: john at arbash-meinel.com-20090213220413-4tc60ow7v7wnh3r1
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: trunk
timestamp: Tue 2009-02-17 16:17:24 -0600
message:
  Finish the Fulltext => Chunked conversions so that we work in the more-efficient Chunks.
-------------- next part --------------
=== modified file 'groupcompress.py'
--- a/groupcompress.py	2009-02-13 21:52:00 +0000
+++ b/groupcompress.py	2009-02-17 22:17:24 +0000
@@ -47,6 +47,7 @@
 from bzrlib.versionedfile import (
     adapter_registry,
     AbsentContentFactory,
+    ChunkedContentFactory,
     FulltextContentFactory,
     VersionedFiles,
     )
@@ -367,10 +368,10 @@
             # an empty tuple instead.
             parents = ()
         # double handling for now. Make it work until then.
-        bytes = ''.join(lines)
-        record = FulltextContentFactory(key, parents, None, bytes)
+        length = sum(map(len, lines))
+        record = ChunkedContentFactory(key, parents, None, lines)
         sha1 = list(self._insert_record_stream([record], random_id=random_id))[0]
-        return sha1, len(bytes), None
+        return sha1, length, None
 
     def annotate(self, key):
         """See VersionedFiles.annotate."""
@@ -519,9 +520,8 @@
                 if label != key:
                     raise AssertionError("wrong key: %r, wanted %r" % (label, key))
                 lines = apply_delta(plain, delta)
-            bytes = ''.join(lines)
-            yield FulltextContentFactory(key, parents, sha1, bytes)
-            
+            yield ChunkedContentFactory(key, parents, sha1, lines)
+
     def get_sha1s(self, keys):
         """See VersionedFiles.get_sha1s()."""
         result = {}



More information about the bazaar-commits mailing list