43
from bzrlib.graph import DictParentsProvider, Graph, _StackedParentsProvider
43
from bzrlib.graph import DictParentsProvider, Graph, StackedParentsProvider
44
44
from bzrlib.transport.memory import MemoryTransport
46
46
from bzrlib.inter import InterObject
47
47
from bzrlib.registry import Registry
48
48
from bzrlib.symbol_versioning import *
49
49
from bzrlib.textmerge import TextMerge
50
from bzrlib.util import bencode
50
from bzrlib import bencode
53
53
adapter_registry = Registry()
830
830
raise NotImplementedError(self.add_lines)
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.
857
return self.add_lines(key, parents, osutils.split_lines(text),
858
nostore_sha=nostore_sha,
832
862
def add_mpdiffs(self, records):
833
863
"""Add mpdiffs to this VersionedFile.
1333
1363
result[revision.NULL_REVISION] = ()
1334
1364
self._providers = self._providers[:1] + self.fallback_versionedfiles
1336
_StackedParentsProvider(self._providers).get_parent_map(keys))
1366
StackedParentsProvider(self._providers).get_parent_map(keys))
1337
1367
for key, parents in result.iteritems():
1338
1368
if parents == ():
1339
1369
result[key] = (revision.NULL_REVISION,)