22
22
from bzrlib.branch import Branch
23
import bzrlib.bzrdir as bzrdir
23
from bzrlib import bzrdir, conflicts, errors, workingtree
24
24
from bzrlib.bzrdir import BzrDir
25
from bzrlib.conflicts import *
26
import bzrlib.errors as errors
27
25
from bzrlib.errors import NotBranchError, NotVersionedError
28
26
from bzrlib.lockdir import LockDir
29
27
from bzrlib.osutils import pathjoin, getcwd, has_symlinks
30
28
from bzrlib.tests import TestCaseWithTransport, TestSkipped
31
29
from bzrlib.trace import mutter
32
30
from bzrlib.transport import get_transport
33
import bzrlib.workingtree as workingtree
34
31
from bzrlib.workingtree import (TreeEntry, TreeDirectory, TreeFile, TreeLink,
219
216
self.assertRaises(errors.UnsupportedOperation, tree.set_conflicts,
221
218
file('lala.BASE', 'wb').write('labase')
222
expected = ContentsConflict('lala')
219
expected = conflicts.ContentsConflict('lala')
223
220
self.assertEqual(list(tree.conflicts()), [expected])
224
221
file('lala', 'wb').write('la')
225
222
tree.add('lala', 'lala-id')
226
expected = ContentsConflict('lala', file_id='lala-id')
223
expected = conflicts.ContentsConflict('lala', file_id='lala-id')
227
224
self.assertEqual(list(tree.conflicts()), [expected])
228
225
file('lala.THIS', 'wb').write('lathis')
229
226
file('lala.OTHER', 'wb').write('laother')
230
227
# When "text conflict"s happen, stem, THIS and OTHER are text
231
expected = TextConflict('lala', file_id='lala-id')
228
expected = conflicts.TextConflict('lala', file_id='lala-id')
232
229
self.assertEqual(list(tree.conflicts()), [expected])
233
230
os.unlink('lala.OTHER')
234
231
os.mkdir('lala.OTHER')
235
expected = ContentsConflict('lala', file_id='lala-id')
232
expected = conflicts.ContentsConflict('lala', file_id='lala-id')
236
233
self.assertEqual(list(tree.conflicts()), [expected])