44
44
def test_merge_reprocess(self):
45
45
d = BzrDir.create_standalone_workingtree('.')
47
self.run_bzr('merge', '.', '--reprocess', '--merge-type', 'weave')
47
self.run_bzr('merge . --reprocess --merge-type weave')
49
49
def test_merge(self):
50
50
from bzrlib.branch import Branch
106
106
print >> file('sub/c.txt', 'wb'), "hello"
107
107
self.run_bzr('init')
108
108
self.run_bzr('add')
109
self.run_bzr(['commit', '-m', 'added a'])
109
self.run_bzr('commit -m added_a')
110
110
self.run_bzr('branch . ../b')
111
111
print >> file('sub/a.txt', 'ab'), "there"
112
112
print >> file('b.txt', 'ab'), "there"
113
113
print >> file('sub/c.txt', 'ab'), "there"
114
self.run_bzr(['commit', '-m', 'Added there'])
114
self.run_bzr('commit -m Added_there')
115
115
os.unlink('sub/a.txt')
116
116
os.unlink('sub/c.txt')
118
118
os.unlink('b.txt')
119
self.run_bzr(['commit', '-m', 'Removed a.txt'])
119
self.run_bzr('commit -m Removed_a.txt')
121
121
print >> file('sub/a.txt', 'ab'), "something"
122
122
print >> file('b.txt', 'ab'), "something"
123
123
print >> file('sub/c.txt', 'ab'), "something"
124
self.run_bzr(['commit', '-m', 'Modified a.txt'])
124
self.run_bzr('commit -m Modified_a.txt')
125
125
self.run_bzr('merge ../a/', retcode=1)
126
126
self.assert_(os.path.exists('sub/a.txt.THIS'))
127
127
self.assert_(os.path.exists('sub/a.txt.BASE'))
233
233
tree_a.commit('commit 2')
234
234
tree_a.rename_one('file_2', 'file_ii')
236
self.run_bzr('merge', 'a', '--uncommitted', '-d', 'b')
236
self.run_bzr('merge a --uncommitted -d b')
237
237
self.failUnlessExists('b/file_1')
238
238
self.failUnlessExists('b/file_ii')
239
239
tree_b.revert([])
240
240
self.run_bzr_error(('Cannot use --uncommitted and --revision',),
241
'merge', '/a', '--uncommitted', '-r1',
241
'merge /a --uncommitted -r1 -d b')
244
243
def pullable_branch(self):
266
265
def test_merge_pull(self):
267
266
self.pullable_branch()
269
(out, err) = self.run_bzr('merge', '--pull', '../b')
268
(out, err) = self.run_bzr('merge --pull ../b')
270
269
self.assertContainsRe(err, 'Now on revision 2\\.')
271
270
tree_a = WorkingTree.open('.')
272
271
self.assertEqual([self.id2], tree_a.get_parent_ids())
281
280
self.build_tree(['tree_a/file/'])
282
281
tree_a.commit('changed file to directory')
283
282
os.chdir('tree_b')
284
self.run_bzr('merge', '../tree_a')
283
self.run_bzr('merge ../tree_a')
285
284
self.assertEqual('directory', file_kind('file'))
286
285
tree_b.revert([])
287
286
self.assertEqual('file', file_kind('file'))
288
287
self.build_tree_contents([('file', 'content_2')])
289
288
tree_b.commit('content change')
290
self.run_bzr('merge', '../tree_a', retcode=1)
289
self.run_bzr('merge ../tree_a', retcode=1)
291
290
self.assertEqual(tree_b.conflicts(),
292
291
[ContentsConflict('file', file_id='file-id')])