~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2006-07-15 14:29:03 UTC
  • mfrom: (1864 +trunk)
  • mto: (1864.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 1865.
  • Revision ID: robertc@robertcollins.net-20060715142903-1ef803f4af9aabc8
Integrate bzr.dev.

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')