31
32
self.assertEqual('Tree is up to date.\n', err)
32
33
self.assertEqual('', out)
34
def test_update_up_to_date_checkout(self):
35
def test_update_up_to_date_light_checkout(self):
35
36
self.make_branch_and_tree('branch')
36
self.runbzr('checkout branch checkout')
37
self.runbzr('checkout --lightweight branch checkout')
37
38
out, err = self.runbzr('update checkout')
38
39
self.assertEqual('Tree is up to date.\n', err)
39
40
self.assertEqual('', out)
44
45
raise TestSkipped('default format too old')
45
46
self.make_branch_and_tree('branch')
47
self.runbzr('checkout branch checkout')
48
self.runbzr('checkout --lightweight branch checkout')
48
49
self.build_tree(['checkout/file'])
49
50
self.runbzr('add checkout/file')
50
51
self.runbzr('commit -m add-file checkout')
54
55
self.assertEqual('', err)
55
56
self.failUnlessExists('branch/file')
57
def test_update_out_of_date_checkout(self):
58
def test_update_out_of_date_light_checkout(self):
58
59
self.make_branch_and_tree('branch')
59
60
# make two checkouts
60
self.runbzr('checkout branch checkout')
61
self.runbzr('checkout branch checkout2')
61
self.runbzr('checkout --lightweight branch checkout')
62
self.runbzr('checkout --lightweight branch checkout2')
62
63
self.build_tree(['checkout/file'])
63
64
self.runbzr('add checkout/file')
64
65
self.runbzr('commit -m add-file checkout')
72
73
def test_update_conflicts_returns_2(self):
73
74
self.make_branch_and_tree('branch')
74
75
# make two checkouts
75
self.runbzr('checkout branch checkout')
76
self.runbzr('checkout --lightweight branch checkout')
76
77
self.build_tree(['checkout/file'])
77
78
self.runbzr('add checkout/file')
78
79
self.runbzr('commit -m add-file checkout')
79
self.runbzr('checkout branch checkout2')
80
self.runbzr('checkout --lightweight branch checkout2')
80
81
# now alter file in checkout
81
82
a_file = file('checkout/file', 'wt')
82
83
a_file.write('Foo')
93
94
err.split('\n')[1:3])
94
95
self.assertContainsRe(err, 'Text conflict in file\n')
95
96
self.assertEqual('', out)
98
def test_smoke_update_checkout_bound_branch_local_commits(self):
99
# smoke test for doing an update of a checkout of a bound
100
# branch with local commits.
101
self.make_branch_and_tree('master')
102
# make a bound branch
103
self.run_bzr('checkout', 'master', 'child')
105
self.run_bzr('checkout', '--lightweight', 'child', 'checkout')
107
a_file = file('master/file', 'wt')
110
self.run_bzr('add', 'master')
111
self.run_bzr('commit', '-m', 'add file', 'master')
113
a_file = file('child/file_b', 'wt')
116
self.run_bzr('add', 'child')
117
self.run_bzr('commit', '--local', '-m', 'add file_b', 'child')
119
a_file = file('checkout/file_c', 'wt')
122
self.run_bzr('add', 'checkout')
124
# now, update checkout ->
125
# get all three files and a pending merge.
126
self.run_bzr('update', 'checkout')
127
wt = WorkingTree.open('checkout')
128
self.assertNotEqual([], wt.pending_merges())
129
self.failUnlessExists('checkout/file')
130
self.failUnlessExists('checkout/file_b')
131
self.failUnlessExists('checkout/file_c')
132
self.assertTrue(wt.has_filename('file_c'))