~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-12 12:36:57 UTC
  • mfrom: (1732.3.4 bzr.revnoX)
  • Revision ID: pqm@pqm.ubuntu.com-20060712123657-365eeb32b69308bf
(matthieu) revno:x:url revision spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
                              "+contents of branch1/file\n"
158
158
                              "\n", subst_dates(out))
159
159
 
 
160
    def test_diff_revno_branches(self):
 
161
        self.example_branches()
 
162
        print >> open('branch2/file', 'wb'), 'even newer content'
 
163
        self.run_bzr_captured(['commit', '-m', 'update file once more', 'branch2'])
 
164
 
 
165
        out, err = self.run_bzr_captured(['diff', '-r', 'revno:1:branch2..revno:1:branch1'],
 
166
                                         retcode=0)
 
167
        self.assertEquals('', err)
 
168
        self.assertEquals('', out)
 
169
        out, ett = self.run_bzr_captured(['diff', '-r', 'revno:2:branch2..revno:1:branch1'],
 
170
                                         retcode=1)
 
171
        self.assertEquals('', err)
 
172
        self.assertEqualDiff("=== modified file 'file'\n"
 
173
                              "--- file\tYYYY-MM-DD HH:MM:SS +ZZZZ\n"
 
174
                              "+++ file\tYYYY-MM-DD HH:MM:SS +ZZZZ\n"
 
175
                              "@@ -1,1 +1,1 @@\n"
 
176
                              "-new content\n"
 
177
                              "+contents of branch1/file\n"
 
178
                              "\n", subst_dates(out))
 
179
 
160
180
    def example_branch2(self):
161
181
        self.build_tree(['branch1/', 'branch1/file1'], line_endings='binary')
162
182
        self.capture('init branch1')