~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-02 18:59:18 UTC
  • mto: This revision was merged to the branch mainline in revision 4469.
  • Revision ID: john@arbash-meinel.com-20090602185918-86l9eljnn8z2iljk
Add a VersionedFile.add_text() api.

Similar to VF.add_lines() except it takes a string for the content, rather
than a list of lines.

For now, it just thunks over to VF.add_lines(), but it will be special
cased in the future.

Show diffs side-by-side

added added

removed removed

Lines of Context:
829
829
        """
830
830
        raise NotImplementedError(self.add_lines)
831
831
 
 
832
    def add_text(self, key, parents, text, parent_texts=None,
 
833
                 nostore_sha=None, random_id=False, check_content=True):
 
834
        return self.add_lines(key, parents, osutils.split_lines(text),
 
835
                              parent_texts=parent_texts,
 
836
                              nostore_sha=nostore_sha,
 
837
                              random_id=random_id,
 
838
                              check_content=check_content)
 
839
 
832
840
    def add_mpdiffs(self, records):
833
841
        """Add mpdiffs to this VersionedFile.
834
842