584
584
vf.get_texts(versions)
585
585
vf.get_texts(reversed(versions))
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'))
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'))
587
609
def test_make_mpdiffs(self):
588
610
from bzrlib import multiparent
589
611
vf = self.get_file('foo')