18
18
from bzrlib.selftest import InTempDir, TestBase
19
19
from bzrlib.merge3 import Merge3
21
class NoConflicts(TestBase):
22
"""No conflicts because only one side changed"""
24
m3 = Merge3(['aaa', 'bbb'],
25
['aaa', '111', 'bbb'],
28
self.assertEquals(m3.find_unconflicted(),
32
21
class NoChanges(TestBase):
33
22
"""No conflicts because nothing changed"""
39
28
self.assertEquals(m3.find_unconflicted(),
31
self.assertEquals(list(m3.find_sync_regions()),
32
[((0, 2), (0, 2), (0, 2))])
36
class NoConflicts(TestBase):
37
"""No conflicts because only one side changed"""
39
m3 = Merge3(['aaa', 'bbb'],
40
['aaa', '111', 'bbb'],
43
self.assertEquals(m3.find_unconflicted(),
47
self.assertEquals(list(m3.find_sync_regions()),
48
[((0, 1), (0, 1), (0, 1)),
49
((1, 2), (2, 3), (1, 2))])
44
52
class InsertClash(TestBase):
45
53
"""Both try to insert lines in the same place."""
51
59
self.assertEquals(m3.find_unconflicted(),
62
self.assertEquals(list(m3.find_sync_regions()),
63
[((0, 1), (0, 1), (0, 1)),
64
((1, 2), (2, 3), (2, 3))])
65
75
self.assertEquals(m3.find_unconflicted(),
78
self.assertEquals(list(m3.find_sync_regions()),
79
[((0, 1), (0, 1), (0, 1)),
80
((2, 3), (2, 3), (2, 3))])
84
class ReplaceMulti(TestBase):
85
"""Replacement with regions of different size."""
87
m3 = Merge3(['aaa', '000', '000', 'bbb'],
88
['aaa', '111', '111', '111', 'bbb'],
89
['aaa', '222', '222', '222', '222', 'bbb'])
91
self.assertEquals(m3.find_unconflicted(),
95
self.assertEquals(list(m3.find_sync_regions()),
96
[((0, 1), (0, 1), (0, 1)),
97
((3, 4), (4, 5), (5, 6))])