Rev 5352: (mbp) bug 234708: An error is displayed if both --diff-options and --using in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Jul 19 18:42:19 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5352 [merge]
revision-id: pqm at pqm.ubuntu.com-20100719174216-c1mezuulmblmnkp5
parent: pqm at pqm.ubuntu.com-20100719142611-fbhst4ivcngc32d5
parent: mbp at canonical.com-20100719153951-fm7ln95mb8g8zl9h
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2010-07-19 18:42:16 +0100
message:
  (mbp) bug 234708: An error is displayed if both --diff-options and --using
   is set (Martin Pool)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/tests/blackbox/test_diff.py test_diff.py-20060110203741-aa99ac93e633d971
=== modified file 'NEWS'
--- a/NEWS	2010-07-16 15:49:06 +0000
+++ b/NEWS	2010-07-19 15:39:51 +0000
@@ -28,6 +28,9 @@
 Bug Fixes
 *********
 
+* Check if both --diff-options and --using are set, and exit with error
+  in this case. (Matthäus G. Chajdas, #234708)
+
 * `PathNotChild` should not give a traceback.
   (Martin Pool, #98735)
 

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2010-07-16 16:04:55 +0000
+++ b/bzrlib/builtins.py	2010-07-19 15:39:51 +0000
@@ -1869,7 +1869,7 @@
     takes_args = ['file*']
     takes_options = [
         Option('diff-options', type=str,
-               help='Pass these options to the external diff program.'),
+               help='Pass these options to the diff program.'),
         Option('prefix', type=str,
                short_name='p',
                help='Set prefixes added to old and new filenames, as '
@@ -1916,6 +1916,10 @@
                 '--prefix expects two values separated by a colon'
                 ' (eg "old/:new/")')
 
+        if using is not None and diff_options is not None:
+            raise errors.BzrCommandError(
+            '--diff-options and --using are mutually exclusive.')
+
         if revision and len(revision) > 2:
             raise errors.BzrCommandError('bzr diff --revision takes exactly'
                                          ' one or two revision specifiers')

=== modified file 'bzrlib/tests/blackbox/test_diff.py'
--- a/bzrlib/tests/blackbox/test_diff.py	2010-04-05 21:56:39 +0000
+++ b/bzrlib/tests/blackbox/test_diff.py	2010-07-18 06:54:01 +0000
@@ -155,6 +155,10 @@
         self.assertContainsRe(err,
             "Requested revision: '1.1' does not exist in branch:")
 
+    def test_diff_diff_options_and_using(self):
+        out, err = self.run_bzr('diff --diff-options -wu --using /usr/bin/diff', retcode=3,
+          error_regexes=('are mutually exclusive.',))
+
     def test_diff_unversioned(self):
         # Get an error when diffing a non-versioned file.
         # (Malone #3619)
@@ -321,7 +325,6 @@
         output = self.run_bzr('diff --format=boo', retcode=1)
         self.assertTrue("BOO!" in output[0])
 
-
 class TestCheckoutDiff(TestDiff):
 
     def make_example_branch(self):




More information about the bazaar-commits mailing list