24
24
from bzrlib.branch import Branch
25
25
from bzrlib.bzrdir import BzrDir
26
from bzrlib.conflicts import ConflictList
27
from bzrlib.osutils import abspath
26
from bzrlib.conflicts import ConflictList, ContentsConflict
27
from bzrlib.osutils import abspath, file_kind
28
28
from bzrlib.tests.blackbox import ExternalBase
29
29
import bzrlib.urlutils as urlutils
30
30
from bzrlib.workingtree import WorkingTree
269
269
self.assertContainsRe(err, '1 revision\\(s\\) pulled')
270
270
tree_a = WorkingTree.open('.')
271
271
self.assertEqual([self.id2], tree_a.get_parent_ids())
273
def test_merge_kind_change(self):
274
tree_a = self.make_branch_and_tree('tree_a')
275
self.build_tree_contents([('tree_a/file', 'content_1')])
276
tree_a.add('file', 'file-id')
277
tree_a.commit('added file')
278
tree_b = tree_a.bzrdir.sprout('tree_b').open_workingtree()
279
os.unlink('tree_a/file')
280
self.build_tree(['tree_a/file/'])
281
tree_a.commit('changed file to directory')
283
self.run_bzr('merge', '../tree_a')
284
self.assertEqual('directory', file_kind('file'))
286
self.assertEqual('file', file_kind('file'))
287
self.build_tree_contents([('file', 'content_2')])
288
tree_b.commit('content change')
289
self.run_bzr('merge', '../tree_a', retcode=1)
290
self.assertEqual(tree_b.conflicts(),
291
[ContentsConflict('file', file_id='file-id')])