15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
from cStringIO import StringIO
20
21
from bzrlib import (
28
from bzrlib.branch import Branch
29
from bzrlib.bzrdir import BzrDir
27
30
from bzrlib.lockdir import LockDir
28
31
from bzrlib.mutabletree import needs_tree_write_lock
29
32
from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
346
349
self.build_tree_contents([('this/hello', 'Hello World')])
347
350
this.commit('Add World')
348
351
this.merge_from_branch(other.branch)
349
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
352
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
350
353
this.conflicts())
351
354
this.auto_resolve()
352
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
355
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
353
356
this.conflicts())
354
357
self.build_tree_contents([('this/hello', '<<<<<<<')])
355
358
this.auto_resolve()
356
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
359
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
357
360
this.conflicts())
358
361
self.build_tree_contents([('this/hello', '=======')])
359
362
this.auto_resolve()
360
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
363
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
361
364
this.conflicts())
362
365
self.build_tree_contents([('this/hello', '\n>>>>>>>')])
363
366
remaining, resolved = this.auto_resolve()
364
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
367
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
365
368
this.conflicts())
366
369
self.assertEqual([], resolved)
367
370
self.build_tree_contents([('this/hello', 'hELLO wORLD')])
368
371
remaining, resolved = this.auto_resolve()
369
372
self.assertEqual([], this.conflicts())
370
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
373
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
372
375
self.failIfExists('this/hello.BASE')
375
378
tree = self.make_branch_and_tree('tree')
376
379
self.build_tree(['tree/hello/'])
377
380
tree.add('hello', 'hello-id')
378
file_conflict = conflicts.TextConflict('file', 'hello-id')
381
file_conflict = conflicts.TextConflict('file', None, 'hello-id')
379
382
tree.set_conflicts(conflicts.ConflictList([file_conflict]))
380
383
tree.auto_resolve()