289
289
def _extract_blocks(self, version_id, source, target):
292
def add_mpdiff(self, version, parents, mpdiff):
293
parent_lines = self._get_line_list(parents)
292
def add_mpdiffs(self, records):
294
293
mpvf = multiparent.MultiMemoryVersionedFile()
295
for parent_id, lines in zip(parents, parent_lines):
296
mpvf.add_version(lines, parent_id, [])
297
mpvf.add_diff(mpdiff, version, parents)
298
lines = mpvf.get_line_list([version])[0]
299
self.add_lines(version, parents, lines)
295
for version, parents, expected_sha1, mpdiff in records:
296
needed_parents = [p for p in parents if not mpvf.has_version(p)]
297
parent_lines = self._get_line_list(needed_parents)
298
for parent_id, lines in zip(needed_parents, parent_lines):
299
mpvf.add_version(lines, parent_id, [])
300
mpvf.add_diff(mpdiff, version, parents)
301
lines = mpvf.get_line_list([version])[0]
302
version_text = self.add_lines(version, parents, lines, vf_parents)
303
vf_parents[version] = version_text
304
assert expected_sha1 == self.get_sha1(version)
301
306
def get_sha1(self, version_id):
302
307
"""Get the stored sha1 sum for the given revision.