845
845
'on the source repository, and "bzr reconcile" '
846
846
'if necessary.' %
847
847
(version_id, parents[0]))
849
# We received a line-delta record for a non-delta
850
# knit. Convert it to a fulltext.
851
gzip_bytes = reader_callable(length)
852
self._convert_line_delta_to_fulltext(
853
gzip_bytes, version_id, parents)
848
856
self._add_raw_records(
849
857
[(version_id, options, parents, length)],
850
858
reader_callable(length))
860
def _convert_line_delta_to_fulltext(self, gzip_bytes, version_id, parents):
861
lines, sha1 = self._data._parse_record(version_id, gzip_bytes)
862
delta = self.factory.parse_line_delta(lines, version_id)
863
content = self.factory.make(self.get_lines(parents[0]), parents[0])
864
content.apply_delta(delta, version_id)
865
digest, len, content = self.add_lines(
866
version_id, parents, content.text())
868
raise errors.VersionedFileInvalidChecksum(version_id)
852
870
def _knit_from_datastream(self, (format, data_list, reader_callable)):
853
871
"""Create a knit object from a data stream.