~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:
1
1
# Copyright (C) 2005, 2006 by Canonical Ltd
2
 
 
 
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
5
5
# the Free Software Foundation; either version 2 of the License, or
6
6
# (at your option) any later version.
7
 
 
 
7
#
8
8
# This program is distributed in the hope that it will be useful,
9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
11
# GNU General Public License for more details.
12
 
 
 
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
146
146
                          "-new content\n"
147
147
                          "+contents of branch1/file\n"
148
148
                          "\n", subst_dates(out))
149
 
        out, ett = self.run_bzr_captured(['diff', 'branch2', 'branch1'],
 
149
        out, err = self.run_bzr_captured(['diff', 'branch2', 'branch1'],
150
150
                                         retcode=1)
151
151
        self.assertEquals('', err)
152
152
        self.assertEqualDiff("=== modified file 'file'\n"
160
160
    def test_diff_revno_branches(self):
161
161
        self.example_branches()
162
162
        print >> open('branch2/file', 'wb'), 'even newer content'
163
 
        self.run_bzr_captured(['commit', '-m', 'update file once more', 'branch2'])
 
163
        self.run_bzr_captured(['commit', '-m', 
 
164
                               'update file once more', 'branch2'])
164
165
 
165
 
        out, err = self.run_bzr_captured(['diff', '-r', 'revno:1:branch2..revno:1:branch1'],
 
166
        out, err = self.run_bzr_captured(['diff', '-r',
 
167
                                          'revno:1:branch2..revno:1:branch1'],
166
168
                                         retcode=0)
167
169
        self.assertEquals('', err)
168
170
        self.assertEquals('', out)
169
 
        out, ett = self.run_bzr_captured(['diff', '-r', 'revno:2:branch2..revno:1:branch1'],
 
171
        out, err = self.run_bzr_captured(['diff', '-r', 
 
172
                                          'revno:2:branch2..revno:1:branch1'],
170
173
                                         retcode=1)
171
174
        self.assertEquals('', err)
172
175
        self.assertEqualDiff("=== modified file 'file'\n"
191
194
        self.example_branch2()
192
195
        
193
196
        print >> open('branch1/file1', 'wb'), 'new line'
194
 
        output = self.run_bzr_captured(['diff', '-r', '1..', 'branch1'], retcode=1)
 
197
        output = self.run_bzr_captured(['diff', '-r', '1..', 'branch1'],
 
198
                                       retcode=1)
195
199
        self.assertTrue('\n-original line\n+new line\n' in output[0])
196
200
 
197
201
    def test_diff_across_rename(self):