~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
        self.runbzr('diff')
52
52
 
53
53
    def test_diff_branches(self):
54
 
        self.build_tree(['branch1/', 'branch1/file', 'branch2/'], line_endings='binary')
55
 
        branch = Branch.initialize('branch1')
56
 
        branch.working_tree().add(['file'])
57
 
        branch.working_tree().commit('add file')
58
 
        branch.clone('branch2')
 
54
        self.build_tree(['branch1/', 'branch1/file'], line_endings='binary')
 
55
        self.capture('init branch1')
 
56
        self.capture('add branch1/file')
 
57
        self.run_bzr_captured(['commit', '-m', 'add file', 'branch1'])
 
58
        self.capture('branch branch1 branch2')
59
59
        print >> open('branch2/file', 'wb'), 'new content'
60
 
        branch2 = Branch.open('branch2')
61
 
        branch2.working_tree().commit('update file')
 
60
        self.run_bzr_captured(['commit', '-m', 'update file', 'branch2'])
62
61
        # should open branch1 and diff against branch2, 
63
62
        output = self.run_bzr_captured(['diff', '-r', 'branch:branch2', 
64
63
                                        'branch1'],
82
81
 
83
82
    def test_diff_to_working_tree(self):
84
83
        self.build_tree(['branch1/', 'branch1/file1'], line_endings='binary')
85
 
        branch = Branch.initialize('branch1')
86
 
        branch.working_tree().add(['file1'])
 
84
        self.capture('init branch1')
 
85
        self.capture('add branch1/file1')
87
86
        print >> open('branch1/file1', 'wb'), 'original line'
88
 
        branch.working_tree().commit('first commit')
 
87
        self.run_bzr_captured(['commit', '-m', 'first commit', 'branch1'])
89
88
        
90
89
        print >> open('branch1/file1', 'wb'), 'repo line'
91
 
        branch.working_tree().commit('second commit')
 
90
        self.run_bzr_captured(['commit', '-m', 'second commit', 'branch1'])
92
91
        
93
92
        print >> open('branch1/file1', 'wb'), 'new line'
94
93
        output = self.run_bzr_captured(['diff', '-r', '1..', 'branch1'], retcode=1)