/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/tests/test_versionedfile.py

  • Committer: Martin Pool
  • Date: 2008-06-04 07:47:17 UTC
  • mfrom: (3460.2.1 mpdiff)
  • mto: This revision was merged to the branch mainline in revision 3475.
  • Revision ID: mbp@sourcefrog.net-20080604074717-r3quvpdo7d0d1zrh
merge fix from robert for Knit.add_lines with matching blocks

Show diffs side-by-side

added added

removed removed

Lines of Context:
584
584
        vf.get_texts(versions)
585
585
        vf.get_texts(reversed(versions))
586
586
 
 
587
    def test_add_lines_with_matching_blocks_noeol_last_line(self):
 
588
        """Add a text with an unchanged last line with no eol should work."""
 
589
        from bzrlib import multiparent
 
590
        # Hand verified sha1 of the text we're adding.
 
591
        sha1 = '6a1d115ec7b60afb664dc14890b5af5ce3c827a4'
 
592
        # Create a mpdiff which adds a new line before the trailing line, and
 
593
        # reuse the last line unaltered (which can cause annotation reuse).
 
594
        # Test adding this in two situations:
 
595
        # On top of a new insertion
 
596
        vf = self.get_file('fulltext')
 
597
        vf.add_lines('noeol', [], ['line'])
 
598
        vf.add_lines('noeol2', ['noeol'], ['newline\n', 'line'],
 
599
            left_matching_blocks=[(0, 1, 1)])
 
600
        self.assertEqualDiff('newline\nline', vf.get_text('noeol2'))
 
601
        # On top of a delta
 
602
        vf = self.get_file('delta')
 
603
        vf.add_lines('base', [], ['line'])
 
604
        vf.add_lines('noeol', ['base'], ['prelude\n', 'line'])
 
605
        vf.add_lines('noeol2', ['noeol'], ['newline\n', 'line'],
 
606
            left_matching_blocks=[(1, 1, 1)])
 
607
        self.assertEqualDiff('newline\nline', vf.get_text('noeol2'))
 
608
 
587
609
    def test_make_mpdiffs(self):
588
610
        from bzrlib import multiparent
589
611
        vf = self.get_file('foo')