170
170
self.reconstruct(vf, 'rev-c', 0, 4))
171
171
self.assertEqual(['a\n', 'b\n', 'e\n', 'f\n'],
172
172
self.reconstruct_version(vf, 'rev-c'))
174
def test_reordered(self):
175
"""Check for a corner case that requires re-starting the cursor"""
176
vf = multiparent.MultiVersionedFile()
177
# rev-b must have at least two hunks, so split a and b with c.
178
self.add_version(vf, 'c', 'rev-a', [])
179
self.add_version(vf, 'acb', 'rev-b', ['rev-a'])
180
# rev-c and rev-d must each have a line from a different rev-b hunk
181
self.add_version(vf, 'b', 'rev-c', ['rev-b'])
182
self.add_version(vf, 'a', 'rev-d', ['rev-b'])
183
# The lines from rev-c and rev-d must appear in the opposite order
184
self.add_version(vf, 'ba', 'rev-e', ['rev-c', 'rev-d'])
186
lines = vf.get_line_list(['rev-e'])[0]
187
self.assertEqual(['b\n', 'a\n'], lines)