~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to groupcompress.py

  • Committer: John Arbash Meinel
  • Date: 2009-02-17 22:17:24 UTC
  • mto: (0.22.4 experimental)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090217221724-hyci8qk412m7mgyy
Finish the Fulltext => Chunked conversions so that we work in the more-efficient Chunks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
from bzrlib.versionedfile import (
48
48
    adapter_registry,
49
49
    AbsentContentFactory,
 
50
    ChunkedContentFactory,
50
51
    FulltextContentFactory,
51
52
    VersionedFiles,
52
53
    )
367
368
            # an empty tuple instead.
368
369
            parents = ()
369
370
        # double handling for now. Make it work until then.
370
 
        bytes = ''.join(lines)
371
 
        record = FulltextContentFactory(key, parents, None, bytes)
 
371
        length = sum(map(len, lines))
 
372
        record = ChunkedContentFactory(key, parents, None, lines)
372
373
        sha1 = list(self._insert_record_stream([record], random_id=random_id))[0]
373
 
        return sha1, len(bytes), None
 
374
        return sha1, length, None
374
375
 
375
376
    def annotate(self, key):
376
377
        """See VersionedFiles.annotate."""
519
520
                if label != key:
520
521
                    raise AssertionError("wrong key: %r, wanted %r" % (label, key))
521
522
                lines = apply_delta(plain, delta)
522
 
            bytes = ''.join(lines)
523
 
            yield FulltextContentFactory(key, parents, sha1, bytes)
524
 
            
 
523
            yield ChunkedContentFactory(key, parents, sha1, lines)
 
524
 
525
525
    def get_sha1s(self, keys):
526
526
        """See VersionedFiles.get_sha1s()."""
527
527
        result = {}