618
618
self.assertEquals(out, '')
619
619
err.index('unknown command')
621
def test_conflicts(self):
622
"""Handling of merge conflicts"""
621
def create_conflicts(self):
622
"""Create a conflicted tree"""
625
625
file('hello', 'wb').write("hi world")
639
639
file('question', 'wb').write("What do you get when you multiply six"
641
641
self.runbzr('commit -m this')
643
def test_remerge(self):
644
"""Remerge command works as expected"""
645
self.create_conflicts()
646
self.runbzr('merge ../other --show-base', retcode=1)
647
conflict_text = file('hello').read()
648
assert '|||||||' in conflict_text
649
assert 'hi world' in conflict_text
650
self.runbzr('remerge', retcode=1)
651
conflict_text = file('hello').read()
652
assert '|||||||' not in conflict_text
653
assert 'hi world' not in conflict_text
654
os.unlink('hello.OTHER')
655
self.runbzr('remerge hello --merge-type weave', retcode=1)
656
# FIXME weave merge demands no changes to working tree, even for
657
# uninteresting files
658
# assert os.path.exists('hello.OTHER')
659
self.runbzr('remerge --merge-type weave', retcode=1)
660
assert os.path.exists('hello.OTHER')
661
assert not os.path.exists('hello.BASE')
662
assert '|||||||' not in conflict_text
663
assert 'hi world' not in conflict_text
664
self.runbzr('remerge . --merge-type weave --show-base', retcode=2)
665
self.runbzr('remerge . --merge-type weave --reprocess', retcode=2)
666
self.runbzr('remerge . --show-base --reprocess', retcode=1)
667
self.runbzr('remerge hello --show-base', retcode=1)
668
self.runbzr('remerge hello --reprocess', retcode=1)
669
self.runbzr('resolve --all')
670
self.runbzr('commit -m done',)
671
self.runbzr('remerge', retcode=1)
674
def test_conflicts(self):
675
"""Handling of merge conflicts"""
676
self.create_conflicts()
642
677
self.runbzr('merge ../other --show-base', retcode=1)
643
678
conflict_text = file('hello').read()
644
679
assert '<<<<<<<' in conflict_text