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