~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Matthäus G. Chajdas
  • Date: 2010-07-19 18:16:56 UTC
  • mto: (5383.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5384.
  • Revision ID: dev@anteru.net-20100719181656-snkiywdjtpfgtdgh
Allow both --using and --diff-options.

Added an example to the diff documentation to showcase how to use --using and --diff-options. Change the test to use /usr/bin/diff. Update news entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
        self.assertContainsRe(err,
156
156
            "Requested revision: '1.1' does not exist in branch:")
157
157
 
158
 
    def test_diff_diff_options_and_using(self):
159
 
        out, err = self.run_bzr('diff --diff-options -wu --using /usr/bin/diff', retcode=3,
160
 
          error_regexes=('are mutually exclusive.',))
161
 
 
162
158
    def test_diff_unversioned(self):
163
159
        # Get an error when diffing a non-versioned file.
164
160
        # (Malone #3619)
403
399
        self.assertEndsWith(out, "\n@@ -0,0 +1 @@\n"
404
400
                                 "+baz\n\n")
405
401
 
 
402
    def test_external_diff_options_and_using(self):
 
403
        """Test that the options are passed correctly to an external diff process"""
 
404
        self.make_example_branch()
 
405
        self.build_tree_contents([('hello', 'Foo\n')])
 
406
        # no retcode, so we can capture if /usr/bin/diff was not found and skip
 
407
        out, err = self.run_bzr('diff --diff-options -i --using /usr/bin/diff',
 
408
                                    retcode=None)
 
409
        if 'bzr: ERROR: /usr/bin/diff could not be found on this machine\n' in err:
 
410
            raise tests.TestSkipped("No external 'diff' is available")
 
411
        self.assertEquals("=== modified file 'hello'\n", out)
 
412
        self.assertEquals('', err)
 
413
 
406
414
 
407
415
class TestDiffOutput(DiffBase):
408
416