/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: John Arbash Meinel
  • Date: 2008-12-11 03:18:52 UTC
  • mto: This revision was merged to the branch mainline in revision 3895.
  • Revision ID: john@arbash-meinel.com-20081211031852-cmjpdf2ufno0okui
Start using osutils.chunks_as_lines rather than osutils.split_lines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
196
196
            [compression_parent], 'unordered', True).next()
197
197
        if basis_entry.storage_kind == 'absent':
198
198
            raise errors.RevisionNotPresent(compression_parent, self._basis_vf)
199
 
        basis_lines = split_lines(basis_entry.get_bytes_as('fulltext'))
 
199
        basis_chunks = basis_entry.get_bytes_as('chunked')
 
200
        basis_lines = osutils.chunks_to_lines(basis_chunks)
200
201
        # Manually apply the delta because we have one annotated content and
201
202
        # one plain.
202
203
        basis_content = PlainKnitContent(basis_lines, compression_parent)
229
230
            [compression_parent], 'unordered', True).next()
230
231
        if basis_entry.storage_kind == 'absent':
231
232
            raise errors.RevisionNotPresent(compression_parent, self._basis_vf)
232
 
        basis_lines = split_lines(basis_entry.get_bytes_as('fulltext'))
 
233
        basis_chunks = basis_entry.get_bytes_as('chunked')
 
234
        basis_lines = osutils.chunks_to_lines(basis_chunks)
233
235
        basis_content = PlainKnitContent(basis_lines, compression_parent)
234
236
        # Manually apply the delta because we have one annotated content and
235
237
        # one plain.
1022
1024
                if record.storage_kind == 'absent':
1023
1025
                    continue
1024
1026
                missing_keys.remove(record.key)
1025
 
                lines = split_lines(record.get_bytes_as('fulltext'))
 
1027
                lines = osutils.chunks_to_lines(record.get_bytes_as('chunked'))
1026
1028
                text_map[record.key] = lines
1027
1029
                content_map[record.key] = PlainKnitContent(lines, record.key)
1028
1030
                if record.key in keys:
1444
1446
                        buffered = True
1445
1447
                if not buffered:
1446
1448
                    self._index.add_records([index_entry])
1447
 
            elif (record.storage_kind == 'fulltext'
1448
 
                  or record.storage_kind == 'chunked'):
 
1449
            elif record.storage_kind == 'chunked':
 
1450
                self.add_lines(record.key, parents,
 
1451
                    osutils.chunks_to_lines(record.get_bytes_as('chunked')))
 
1452
            elif record.storage_kind == 'fulltext':
1449
1453
                self.add_lines(record.key, parents,
1450
1454
                    split_lines(record.get_bytes_as('fulltext')))
1451
1455
            else:
2954
2958
        reannotate = annotate.reannotate
2955
2959
        for record in self._knit.get_record_stream(keys, 'topological', True):
2956
2960
            key = record.key
2957
 
            fulltext = split_lines(record.get_bytes_as('fulltext'))
 
2961
            fulltext = osutils.chunks_to_lines(record.get_bytes_as('chunked'))
2958
2962
            parents = parent_map[key]
2959
2963
            if parents is not None:
2960
2964
                parent_lines = [parent_cache[parent] for parent in parent_map[key]]