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