~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-07-27 20:05:11 UTC
  • mfrom: (1711.2.100 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060727200511-3bfb6377b1695fad
(Matthieu Moy) handle 'bzr diff' when not in a branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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):