38
37
file('myfile', 'wb').write('contentsa\n')
39
38
file('my_other_file', 'wb').write('contentsa\n')
42
self.run_bzr('commit -m new')
41
self.runbzr('commit -m new')
44
self.run_bzr('branch a b')
43
self.runbzr('branch a b')
46
45
file('myfile', 'wb').write('contentsb\n')
47
46
file('my_other_file', 'wb').write('contentsb\n')
48
self.run_bzr('mv mydir mydir2')
49
self.run_bzr('commit -m change')
47
self.runbzr('mv mydir mydir2')
48
self.runbzr('commit -m change')
51
50
file('myfile', 'wb').write('contentsa2\n')
52
51
file('my_other_file', 'wb').write('contentsa2\n')
53
self.run_bzr('mv mydir mydir3')
54
self.run_bzr('commit -m change')
55
self.run_bzr('merge ../b', retcode=1)
52
self.runbzr('mv mydir mydir3')
53
self.runbzr('commit -m change')
54
self.runbzr('merge ../b', retcode=1)
57
56
def test_conflicts(self):
58
conflicts, errs = self.run_bzr('conflicts')
57
conflicts = self.runbzr('conflicts', backtick=True)
59
58
self.assertEqual(3, len(conflicts.splitlines()))
61
60
def test_conflicts_text(self):
62
conflicts = self.run_bzr('conflicts --text')[0].splitlines()
61
conflicts = self.run_bzr('conflicts', '--text')[0].splitlines()
63
62
self.assertEqual(['my_other_file', 'myfile'], conflicts)
65
64
def test_resolve(self):
66
self.run_bzr('resolve myfile')
67
conflicts, errs = self.run_bzr('conflicts')
65
self.runbzr('resolve myfile')
66
conflicts = self.runbzr('conflicts', backtick=True)
68
67
self.assertEqual(2, len(conflicts.splitlines()))
69
self.run_bzr('resolve my_other_file')
70
self.run_bzr('resolve mydir2')
71
conflicts, errs = self.run_bzr('conflicts')
68
self.runbzr('resolve my_other_file')
69
self.runbzr('resolve mydir2')
70
conflicts = self.runbzr('conflicts', backtick=True)
72
71
self.assertEqual(len(conflicts.splitlines()), 0)
74
73
def test_resolve_all(self):
75
self.run_bzr('resolve --all')
76
conflicts, errs = self.run_bzr('conflicts')
74
self.runbzr('resolve --all')
75
conflicts = self.runbzr('conflicts', backtick=True)
77
76
self.assertEqual(len(conflicts.splitlines()), 0)
79
78
def test_resolve_in_subdir(self):