~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Robert Collins
  • Date: 2006-03-11 13:58:48 UTC
  • mto: (1615.1.2 bzr.mbp.integration)
  • mto: This revision was merged to the branch mainline in revision 1616.
  • Revision ID: robertc@robertcollins.net-20060311135848-789fa616b8da4662
Note potential improvements in knit adds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
358
358
 
359
359
    def _merge_annotations(self, content, parents):
360
360
        """Merge annotations for content.  This is done by comparing
361
 
        the annotations based on changed to the text."""
 
361
        the annotations based on changed to the text.
 
362
        """
362
363
        for parent_id in parents:
363
364
            merge_content = self._get_content(parent_id)
364
365
            seq = SequenceMatcher(None, merge_content.text(), content.text())
365
366
            for i, j, n in seq.get_matching_blocks():
366
367
                if n == 0:
367
368
                    continue
 
369
                # this appears to copy (origin, text) pairs across to the new
 
370
                # content for any line that matches the last-checked parent.
 
371
                # FIXME: save the sequence control data for delta compression
 
372
                # against the most relevant parent rather than rediffing.
368
373
                content._lines[j:j+n] = merge_content._lines[i:i+n]
369
374
 
370
375
    def _get_components(self, version_id):