You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gb...@apache.org on 2013/06/02 11:58:59 UTC

svn commit: r1488657 - /subversion/branches/invoke-diff-cmd-feature/subversion/svn/svn.c

Author: gbg
Date: Sun Jun  2 09:58:59 2013
New Revision: 1488657

URL: http://svn.apache.org/r1488657
Log:
On the invoke-diff-cmd branch:  Add guard against concurrent usage of
incompatible diff options.  Remove previous guard code.

* subversion/svn/svn.c

  (sub_main): Add guard against concurrent usage of incompatible diff 
    options.  Remove previous guard code. 



Modified:
    subversion/branches/invoke-diff-cmd-feature/subversion/svn/svn.c

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svn/svn.c?rev=1488657&r1=1488656&r2=1488657&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/svn/svn.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/svn/svn.c Sun Jun  2 09:58:59 2013
@@ -2520,8 +2520,8 @@ sub_main(int argc, const char *argv[], a
       return EXIT_ERROR(err);
     }
 
-  /* Disallow simultaneous use of both --diff-cmd and
-     --internal-diff.  */
+  /* Disallow simultaneous use of both --diff-cmd, --invoke-diff-cmd
+     and --internal-diff.  */
   if (opt_state.diff.diff_cmd && opt_state.diff.internal_diff)
     {
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
@@ -2538,6 +2538,14 @@ sub_main(int argc, const char *argv[], a
       return EXIT_ERROR(err);
     }
 
+  if ((opt_state.diff.diff_cmd) && (opt_state.diff.invoke_diff_cmd))
+    {
+      err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("--invoke-diff-cmd and --diff-cmd "
+                               "are mutually exclusive"));
+      return EXIT_ERROR(err);
+    }
+
   /* Ensure that 'revision_ranges' has at least one item, and make
      'start_revision' and 'end_revision' match that item. */
   if (opt_state.revision_ranges->nelts == 0)
@@ -2751,16 +2759,11 @@ sub_main(int argc, const char *argv[], a
   /* XXX: Only diff_cmd for now, overlay rest later and stop passing
      opt_state altogether? */
   if (opt_state.diff.diff_cmd) 
-   {
     svn_config_set(cfg_config, SVN_CONFIG_SECTION_HELPERS,
                    SVN_CONFIG_OPTION_DIFF_CMD, opt_state.diff.diff_cmd);
-   }
-  else 
-    {
-      if (opt_state.diff.invoke_diff_cmd)
+  if (opt_state.diff.invoke_diff_cmd)
         svn_config_set(cfg_config, SVN_CONFIG_SECTION_HELPERS,
                        SVN_CONFIG_OPTION_INVOKE_DIFF_CMD, opt_state.diff.invoke_diff_cmd);
-    }
   if (opt_state.merge_cmd)
     svn_config_set(cfg_config, SVN_CONFIG_SECTION_HELPERS,
                    SVN_CONFIG_OPTION_DIFF3_CMD, opt_state.merge_cmd);