~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Robert Collins
  • Date: 2007-09-03 02:58:58 UTC
  • mto: (2592.3.122 repository)
  • mto: This revision was merged to the branch mainline in revision 2791.
  • Revision ID: robertc@robertcollins.net-20070903025858-k2pxq3qz6ulhhtgq
 * The ``add_lines`` methods on ``VersionedFile`` implementations has changed
   its return value to include the sha1 and length of the inserted text. This
   allows the avoidance of double-sha1 calculations during commit.
   (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
907
907
            delta = False
908
908
 
909
909
        digest = sha_strings(lines)
 
910
        text_length = sum(map(len, lines))
910
911
        options = []
911
912
        if lines:
912
913
            if lines[-1][-1] != '\n':
936
937
 
937
938
        access_memo = self._data.add_record(version_id, digest, store_lines)
938
939
        self._index.add_version(version_id, options, access_memo, parents)
939
 
        return lines
 
940
        return digest, text_length, lines
940
941
 
941
942
    def check(self, progress_bar=None):
942
943
        """See VersionedFile.check()."""