656
656
self.text_sha1 = None
657
657
self.executable = None
659
def _snapshot_text(self, file_parents, work_tree, weave_store, transaction):
659
def _snapshot_text(self, file_parents, work_tree, versionedfile_store, transaction):
660
660
"""See InventoryEntry._snapshot_text."""
661
mutter('storing file {%s} in revision {%s}',
662
self.file_id, self.revision)
661
mutter('storing text of file {%s} in revision {%s} into %r',
662
self.file_id, self.revision, versionedfile_store)
663
663
# special case to avoid diffing on renames or
665
665
if (len(file_parents) == 1
666
666
and self.text_sha1 == file_parents.values()[0].text_sha1
667
667
and self.text_size == file_parents.values()[0].text_size):
668
668
previous_ie = file_parents.values()[0]
669
versionedfile = weave_store.get_weave(self.file_id, transaction)
669
versionedfile = versionedfile_store.get_weave(self.file_id, transaction)
670
670
versionedfile.clone_text(self.revision, previous_ie.revision, file_parents.keys())
672
672
new_lines = work_tree.get_file(self.file_id).readlines()
673
self._add_text_to_weave(new_lines, file_parents.keys(), weave_store,
673
self._add_text_to_weave(new_lines, file_parents.keys(), versionedfile_store,
675
675
self.text_sha1 = sha_strings(new_lines)
676
676
self.text_size = sum(map(len, new_lines))