~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_conflicts.py

  • Committer: John Arbash Meinel
  • Date: 2006-12-07 00:15:00 UTC
  • mfrom: (2164 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2165.
  • Revision ID: john@arbash-meinel.com-20061207001500-c321azsrfj051wvh
[merge] bzr.dev 2164

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
        self.runbzr('init')
34
34
        file('myfile', 'wb').write('contentsa\n')
35
35
        file('my_other_file', 'wb').write('contentsa\n')
 
36
        os.mkdir('mydir')
36
37
        self.runbzr('add')
37
38
        self.runbzr('commit -m new')
38
39
        os.chdir('..')
40
41
        os.chdir('b')
41
42
        file('myfile', 'wb').write('contentsb\n')
42
43
        file('my_other_file', 'wb').write('contentsb\n')
 
44
        self.runbzr('mv mydir mydir2')
43
45
        self.runbzr('commit -m change')
44
46
        os.chdir('../a')
45
47
        file('myfile', 'wb').write('contentsa2\n')
46
48
        file('my_other_file', 'wb').write('contentsa2\n')
 
49
        self.runbzr('mv mydir mydir3')
47
50
        self.runbzr('commit -m change')
48
51
        self.runbzr('merge ../b', retcode=1)
49
52
 
50
53
    def test_conflicts(self):
51
54
        conflicts = self.runbzr('conflicts', backtick=True)
52
 
        self.assertEqual(len(conflicts.splitlines()), 2)
 
55
        self.assertEqual(3, len(conflicts.splitlines()))
 
56
 
 
57
    def test_conflicts_text(self):
 
58
        conflicts = self.run_bzr('conflicts', '--text')[0].splitlines()
 
59
        self.assertEqual(['my_other_file', 'myfile'], conflicts)
53
60
 
54
61
    def test_resolve(self):
55
62
        self.runbzr('resolve', retcode=3)
56
63
        self.runbzr('resolve myfile')
57
64
        conflicts = self.runbzr('conflicts', backtick=True)
58
 
        self.assertEqual(len(conflicts.splitlines()), 1)
 
65
        self.assertEqual(2, len(conflicts.splitlines()))
59
66
        self.runbzr('resolve my_other_file')
 
67
        self.runbzr('resolve mydir2')
60
68
        conflicts = self.runbzr('conflicts', backtick=True)
61
69
        self.assertEqual(len(conflicts.splitlines()), 0)
62
70