~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

  • Committer: Mark Hammond
  • Date: 2008-12-28 05:21:23 UTC
  • mfrom: (3920 +trunk)
  • mto: (3932.1.1 prepare-1.11)
  • mto: This revision was merged to the branch mainline in revision 3937.
  • Revision ID: mhammond@skippinet.com.au-20081228052123-f78xs5sbdkotshwf
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
from bzrlib import tsort
80
80
""")
81
81
from bzrlib import (
 
82
    errors,
 
83
    osutils,
82
84
    progress,
83
85
    )
84
86
from bzrlib.errors import (WeaveError, WeaveFormatError, WeaveParentMismatch,
88
90
        WeaveRevisionAlreadyPresent,
89
91
        WeaveRevisionNotPresent,
90
92
        )
91
 
import bzrlib.errors as errors
92
93
from bzrlib.osutils import dirname, sha, sha_strings, split_lines
93
94
import bzrlib.patiencediff
94
95
from bzrlib.revision import NULL_REVISION
122
123
    def get_bytes_as(self, storage_kind):
123
124
        if storage_kind == 'fulltext':
124
125
            return self._weave.get_text(self.key[-1])
 
126
        elif storage_kind == 'chunked':
 
127
            return self._weave.get_lines(self.key[-1])
125
128
        else:
126
129
            raise UnavailableRepresentation(self.key, storage_kind, 'fulltext')
127
130
 
357
360
                raise RevisionNotPresent([record.key[0]], self)
358
361
            # adapt to non-tuple interface
359
362
            parents = [parent[0] for parent in record.parents]
360
 
            if record.storage_kind == 'fulltext':
 
363
            if (record.storage_kind == 'fulltext'
 
364
                or record.storage_kind == 'chunked'):
361
365
                self.add_lines(record.key[0], parents,
362
 
                    split_lines(record.get_bytes_as('fulltext')))
 
366
                    osutils.chunks_to_lines(record.get_bytes_as('chunked')))
363
367
            else:
364
368
                adapter_key = record.storage_kind, 'fulltext'
365
369
                try: