431
430
self.build_tree_contents([('this/hello', b'Hello World')])
432
431
this.commit('Add World')
433
432
this.merge_from_branch(other.branch)
434
self.assertEqual([_mod_bzr_conflicts.TextConflict('hello', b'hello_id')],
433
self.assertEqual([conflicts.TextConflict('hello', b'hello_id')],
435
434
this.conflicts())
436
435
self._auto_resolve(this)
437
self.assertEqual([_mod_bzr_conflicts.TextConflict('hello', b'hello_id')],
436
self.assertEqual([conflicts.TextConflict('hello', b'hello_id')],
438
437
this.conflicts())
439
438
self.build_tree_contents([('this/hello', '<<<<<<<')])
440
439
self._auto_resolve(this)
441
self.assertEqual([_mod_bzr_conflicts.TextConflict('hello', b'hello_id')],
440
self.assertEqual([conflicts.TextConflict('hello', b'hello_id')],
442
441
this.conflicts())
443
442
self.build_tree_contents([('this/hello', '=======')])
444
443
self._auto_resolve(this)
445
self.assertEqual([_mod_bzr_conflicts.TextConflict('hello', b'hello_id')],
444
self.assertEqual([conflicts.TextConflict('hello', b'hello_id')],
446
445
this.conflicts())
447
446
self.build_tree_contents([('this/hello', '\n>>>>>>>')])
448
447
remaining, resolved = self._auto_resolve(this)
449
self.assertEqual([_mod_bzr_conflicts.TextConflict('hello', b'hello_id')],
448
self.assertEqual([conflicts.TextConflict('hello', b'hello_id')],
450
449
this.conflicts())
451
450
self.assertEqual([], resolved)
452
451
self.build_tree_contents([('this/hello', b'hELLO wORLD')])
453
452
remaining, resolved = self._auto_resolve(this)
454
453
self.assertEqual([], this.conflicts())
455
self.assertEqual([_mod_bzr_conflicts.TextConflict('hello', b'hello_id')],
454
self.assertEqual([conflicts.TextConflict('hello', b'hello_id')],
457
456
self.assertPathDoesNotExist('this/hello.BASE')
488
487
tree = self.make_branch_and_tree('tree')
489
488
self.build_tree(['tree/hello/'])
490
489
tree.add('hello', b'hello-id')
491
file_conflict = _mod_bzr_conflicts.TextConflict('hello', b'hello-id')
492
tree.set_conflicts([file_conflict])
490
file_conflict = conflicts.TextConflict('hello', b'hello-id')
491
tree.set_conflicts(conflicts.ConflictList([file_conflict]))
493
492
remaining, resolved = self._auto_resolve(tree)
494
493
self.assertEqual(
496
conflicts.ConflictList([_mod_bzr_conflicts.TextConflict(u'hello', 'hello-id')]))
495
conflicts.ConflictList([conflicts.TextConflict(u'hello', 'hello-id')]))
497
496
self.assertEqual(resolved, [])
499
498
def test_auto_resolve_missing(self):
500
499
tree = self.make_branch_and_tree('tree')
501
file_conflict = _mod_bzr_conflicts.TextConflict('hello', b'hello-id')
502
tree.set_conflicts([file_conflict])
500
file_conflict = conflicts.TextConflict('hello', b'hello-id')
501
tree.set_conflicts(conflicts.ConflictList([file_conflict]))
503
502
remaining, resolved = self._auto_resolve(tree)
504
503
self.assertEqual(remaining, [])
505
504
self.assertEqual(
507
conflicts.ConflictList([_mod_bzr_conflicts.TextConflict(u'hello', 'hello-id')]))
506
conflicts.ConflictList([conflicts.TextConflict(u'hello', 'hello-id')]))
510
509
class TestStoredUncommitted(TestCaseWithTransport):