You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/08/02 18:47:41 UTC

svn commit: r981593 - in /subversion/trunk/subversion: svn/diff-cmd.c tests/cmdline/input_validation_tests.py

Author: stsp
Date: Mon Aug  2 16:47:41 2010
New Revision: 981593

URL: http://svn.apache.org/viewvc?rev=981593&view=rev
Log:
* subversion/tests/cmdline/input_validation_tests.py
  (invalid_diff_targets): New test, verifying that svn diff copes well
   with invalid target combinations.

* subversion/svn/diff-cmd.c
  (svn_cl__diff): For consistency with other sub-commands, raise the
   SVN_ERR_CL_ARG_PARSING_ERROR if both working copy paths and URLs are
   passed, and use the same error message also used elsewhere.

Modified:
    subversion/trunk/subversion/svn/diff-cmd.c
    subversion/trunk/subversion/tests/cmdline/input_validation_tests.py

Modified: subversion/trunk/subversion/svn/diff-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/diff-cmd.c?rev=981593&r1=981592&r2=981593&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/diff-cmd.c (original)
+++ subversion/trunk/subversion/svn/diff-cmd.c Mon Aug  2 16:47:41 2010
@@ -284,9 +284,9 @@ svn_cl__diff(apr_getopt_t *os,
         }
 
       if (url_present && working_copy_present)
-        return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
-                                 _("Target lists to diff may not contain "
-                                   "both working copy paths and URLs"));
+        return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                  _("Cannot mix repository and working copy "
+                                    "targets"));
 
       if (opt_state->start_revision.kind == svn_opt_revision_unspecified
           && working_copy_present)

Modified: subversion/trunk/subversion/tests/cmdline/input_validation_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/input_validation_tests.py?rev=981593&r1=981592&r2=981593&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/input_validation_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/input_validation_tests.py Mon Aug  2 16:47:41 2010
@@ -112,6 +112,16 @@ def invalid_delete_targets(sbox):
     run_and_verify_svn_in_wc(sbox, "svn: Cannot mix repository and working "
                              "copy targets", 'delete', target1, target2)
 
+def invalid_diff_targets(sbox):
+  "invalid targets for 'diff'"
+  sbox.build(read_only=True)
+  for (target1, target2) in [("iota", "^/"), ("file://", "iota")]:
+    run_and_verify_svn_in_wc(sbox, "svn: Cannot mix repository and working "
+                             "copy targets", 'diff', target1, target2)
+  run_and_verify_svn_in_wc(sbox, "svn: Summarizing diff can only compare "
+                           "repository to repository",
+                           'diff', '--summarize', "iota", "A")
+
 ########################################################################
 # Run the tests
 
@@ -124,6 +134,7 @@ test_list = [ None,
               invalid_copy_sources,
               invalid_copy_target,
               invalid_delete_targets,
+              invalid_diff_targets,
              ]
 
 if __name__ == '__main__':