94
94
def test_bound_commit(self):
95
95
child_tree = self.create_branches()[1]
97
self.build_tree_contents([('child/a', 'new contents')])
97
self.build_tree_contents([('child/a', b'new contents')])
98
98
child_tree.commit(message='child')
100
100
self.check_revno(2, 'child')
107
107
base_tree, child_tree = self.create_branches()
109
109
self.build_tree_contents([
110
('base/a', 'new base contents\n' ),
111
('child/b', 'new b child contents\n')])
110
('base/a', b'new base contents\n' ),
111
('child/b', b'new b child contents\n')])
112
112
base_tree.commit(message='base')
113
113
self.check_revno(2, 'base')
140
140
base_tree, child_tree = self.create_branches()
142
142
self.build_tree_contents([
143
('base/a', 'new base contents\n' ),
144
('child/b', 'new b child contents\n')])
143
('base/a', b'new base contents\n' ),
144
('child/b', b'new b child contents\n')])
146
146
base_tree.commit(message='base')
147
147
self.check_revno(2, 'base')
172
172
def test_pull_updates_both(self):
173
173
base_tree = self.create_branches()[0]
174
174
newchild_tree = base_tree.controldir.sprout('newchild').open_workingtree()
175
self.build_tree_contents([('newchild/b', 'newchild b contents\n')])
175
self.build_tree_contents([('newchild/b', b'newchild b contents\n')])
176
176
newchild_tree.commit(message='newchild')
177
177
self.check_revno(2, 'newchild')
185
185
def test_pull_local_updates_local(self):
186
186
base_tree = self.create_branches()[0]
187
187
newchild_tree = base_tree.controldir.sprout('newchild').open_workingtree()
188
self.build_tree_contents([('newchild/b', 'newchild b contents\n')])
188
self.build_tree_contents([('newchild/b', b'newchild b contents\n')])
189
189
newchild_tree.commit(message='newchild')
190
190
self.check_revno(2, 'newchild')
293
293
other_tree = child_tree.controldir.sprout('other').open_workingtree()
294
294
other_branch = other_tree.branch
296
self.build_tree_contents([('other/c', 'file c\n')])
296
self.build_tree_contents([('other/c', b'file c\n')])
297
297
other_tree.add('c')
298
298
other_tree.commit(message='adding c')
299
299
new_rev_id = other_branch.last_revision()
323
323
other_tree = child_tree.controldir.sprout('other').open_workingtree()
325
self.build_tree_contents([('other/a', 'new contents\n')])
325
self.build_tree_contents([('other/a', b'new contents\n')])
326
326
other_tree.commit(message='changed a')
327
327
self.check_revno(2, 'other')
328
328
self.build_tree_contents([
329
('other/a', 'new contents\nand then some\n')])
329
('other/a', b'new contents\nand then some\n')])
330
330
other_tree.commit(message='another a')
331
331
self.check_revno(3, 'other')
332
332
self.build_tree_contents([
333
('other/a', 'new contents\nand then some\nand some more\n')])
333
('other/a', b'new contents\nand then some\nand some more\n')])
334
334
other_tree.commit('yet another a')
335
335
self.check_revno(4, 'other')
337
self.build_tree_contents([('child/a', 'also changed a\n')])
337
self.build_tree_contents([('child/a', b'also changed a\n')])
338
338
child_tree.commit(message='child modified a')
340
340
self.check_revno(2, 'child')