467
467
self.assertEquals(out, '')
468
468
err.index('unknown command')
470
def test_conflicts(self):
471
"""Handling of merge conflicts"""
474
file('hello', 'wb').write("hi world")
475
file('answer', 'wb').write("42")
478
self.runbzr('commit -m base')
479
self.runbzr('branch . ../other')
480
self.runbzr('branch . ../this')
482
file('hello', 'wb').write("Hello.")
483
file('answer', 'wb').write("Is anyone there?")
484
self.runbzr('commit -m other')
486
file('hello', 'wb').write("Hello, world")
487
self.runbzr('mv answer question')
488
file('question', 'wb').write("What do you get when you multiply six"
490
self.runbzr('commit -m this')
491
self.runbzr('merge ../other')
492
result = self.runbzr('conflicts', backtick=1)
493
self.assertEquals(result, "hello\nquestion\n")
494
result = self.runbzr('status', backtick=1)
495
assert "conflicts:\n hello\n question\n" in result, result
496
self.runbzr('resolve hello')
497
result = self.runbzr('conflicts', backtick=1)
498
self.assertEquals(result, "question\n")
499
self.runbzr('commit -m conflicts', retcode=1)
500
self.runbzr('resolve --all')
501
result = self.runbzr('conflicts', backtick=1)
502
self.runbzr('commit -m conflicts')
503
self.assertEquals(result, "")
471
505
def listdir_sorted(dir):
472
506
L = os.listdir(dir)