830
831
raise NotImplementedError(self.add_lines)
833
def _add_text(self, key, parents, text, nostore_sha=None, random_id=False):
834
"""Add a text to the store.
836
This is a private function for use by CommitBuilder.
838
:param key: The key tuple of the text to add. If the last element is
839
None, a CHK string will be generated during the addition.
840
:param parents: The parents key tuples of the text to add.
841
:param text: A string containing the text to be committed.
842
:param nostore_sha: Raise ExistingContent and do not add the lines to
843
the versioned file if the digest of the lines matches this.
844
:param random_id: If True a random id has been selected rather than
845
an id determined by some deterministic process such as a converter
846
from a foreign VCS. When True the backend may choose not to check
847
for uniqueness of the resulting key within the versioned file, so
848
this should only be done when the result is expected to be unique
850
:param check_content: If True, the lines supplied are verified to be
851
bytestrings that are correctly formed lines.
852
:return: The text sha1, the number of bytes in the text, and an opaque
853
representation of the inserted version which can be provided
854
back to future _add_text calls in the parent_texts dictionary.
856
# The default implementation just thunks over to .add_lines(),
857
# inefficient, but it works.
858
return self.add_lines(key, parents, osutils.split_lines(text),
859
nostore_sha=nostore_sha,
832
863
def add_mpdiffs(self, records):
833
864
"""Add mpdiffs to this VersionedFile.
1092
1123
result.append((prefix + (origin,), line))
1126
def get_annotator(self):
1127
return annotate.Annotator(self)
1095
1129
def check(self, progress_bar=None):
1096
1130
"""See VersionedFiles.check()."""
1097
1131
for prefix, vf in self._iter_all_components():