~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: Aaron Bentley
  • Date: 2005-10-06 04:29:10 UTC
  • mfrom: (1185.14.11)
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: aaron.bentley@utoronto.ca-20051006042910-a3263271389bfdc2
Merged conflict handling work

Show diffs side-by-side

added added

removed removed

Lines of Context:
467
467
        self.assertEquals(out, '')
468
468
        err.index('unknown command')
469
469
 
 
470
    def test_conflicts(self):
 
471
        """Handling of merge conflicts"""
 
472
        os.mkdir('base')
 
473
        os.chdir('base')
 
474
        file('hello', 'wb').write("hi world")
 
475
        file('answer', 'wb').write("42")
 
476
        self.runbzr('init')
 
477
        self.runbzr('add')
 
478
        self.runbzr('commit -m base')
 
479
        self.runbzr('branch . ../other')
 
480
        self.runbzr('branch . ../this')
 
481
        os.chdir('../other')
 
482
        file('hello', 'wb').write("Hello.")
 
483
        file('answer', 'wb').write("Is anyone there?")
 
484
        self.runbzr('commit -m other')
 
485
        os.chdir('../this')
 
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"
 
489
                                   "times nine?")
 
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, "")
470
504
 
471
505
def listdir_sorted(dir):
472
506
    L = os.listdir(dir)