/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

  • Committer: Andrew Bennetts
  • Date: 2009-07-16 04:56:26 UTC
  • mfrom: (4538 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4541.
  • Revision ID: andrew.bennetts@canonical.com-20090716045626-s5d9fiojyrf9bx30
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
import urllib
31
31
 
32
32
from bzrlib import (
 
33
    annotate,
33
34
    errors,
34
35
    groupcompress,
35
36
    index,
829
830
        """
830
831
        raise NotImplementedError(self.add_lines)
831
832
 
 
833
    def _add_text(self, key, parents, text, nostore_sha=None, random_id=False):
 
834
        """Add a text to the store.
 
835
 
 
836
        This is a private function for use by CommitBuilder.
 
837
 
 
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
 
849
            anyway.
 
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.
 
855
        """
 
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,
 
860
                              random_id=random_id,
 
861
                              check_content=True)
 
862
 
832
863
    def add_mpdiffs(self, records):
833
864
        """Add mpdiffs to this VersionedFile.
834
865
 
1092
1123
            result.append((prefix + (origin,), line))
1093
1124
        return result
1094
1125
 
 
1126
    def get_annotator(self):
 
1127
        return annotate.Annotator(self)
 
1128
 
1095
1129
    def check(self, progress_bar=None):
1096
1130
        """See VersionedFiles.check()."""
1097
1131
        for prefix, vf in self._iter_all_components():