~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 03:38:40 UTC
  • mto: (1185.12.13)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: aaron.bentley@utoronto.ca-20051006033840-de449428ee94d1cc
Added tests for 'bzr conflicts', 'bzr resolve'

Show diffs side-by-side

added added

removed removed

Lines of Context:
440
440
                                         retcode=1)
441
441
        self.assertEquals(out, '')
442
442
        err.index('unknown command')
 
443
 
 
444
    def test_conflicts(self):
 
445
        """Handling of merge conflicts"""
 
446
        os.mkdir('base')
 
447
        os.chdir('base')
 
448
        file('hello', 'wb').write("hi world")
 
449
        file('answer', 'wb').write("42")
 
450
        self.runbzr('init')
 
451
        self.runbzr('add')
 
452
        self.runbzr('commit -m base')
 
453
        self.runbzr('branch . ../other')
 
454
        self.runbzr('branch . ../this')
 
455
        os.chdir('../other')
 
456
        file('hello', 'wb').write("Hello.")
 
457
        file('answer', 'wb').write("Is anyone there?")
 
458
        self.runbzr('commit -m other')
 
459
        os.chdir('../this')
 
460
        file('hello', 'wb').write("Hello, world")
 
461
        self.runbzr('mv answer question')
 
462
        file('question', 'wb').write("What do you get when you multiply six"
 
463
                                   "times nine?")
 
464
        self.runbzr('commit -m this')
 
465
        self.runbzr('merge ../other')
 
466
        result = self.runbzr('conflicts', backtick=1)
 
467
        self.assertEquals(result, "hello\nquestion\n")
 
468
        result = self.runbzr('resolve hello')
 
469
        result = self.runbzr('conflicts', backtick=1)
 
470
        self.assertEquals(result, "question\n")
 
471
        result = self.runbzr('resolve --all')
 
472
        result = self.runbzr('conflicts', backtick=1)
 
473
        self.assertEquals(result, "")
443
474
        
444
475
 
445
476