You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/06/28 22:54:14 UTC

svn commit: r958725 - in /subversion/trunk/subversion: include/svn_diff.h libsvn_client/diff.c libsvn_diff/diff_file.c svn/main.c tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout

Author: dannas
Date: Mon Jun 28 20:54:13 2010
New Revision: 958725

URL: http://svn.apache.org/viewvc?rev=958725&view=rev
Log:
Revert r958537 that introduces a new --extension flag for handling git 
diffs.

The --extension mechanism is used for passing on arguments to external 
tools. But we don't have any way of providing all the needed information
for creating a 'git diff' to external tools. Atleast not at the moment.

* subversion/libsvn_diff/diff_file.c
  subversion/include/svn_diff.h
  subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
  subversion/svn/main.c
  subversion/libsvn_client/diff.c
    Revert.

Modified:
    subversion/trunk/subversion/include/svn_diff.h
    subversion/trunk/subversion/libsvn_client/diff.c
    subversion/trunk/subversion/libsvn_diff/diff_file.c
    subversion/trunk/subversion/svn/main.c
    subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout

Modified: subversion/trunk/subversion/include/svn_diff.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_diff.h?rev=958725&r1=958724&r2=958725&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_diff.h (original)
+++ subversion/trunk/subversion/include/svn_diff.h Mon Jun 28 20:54:13 2010
@@ -382,8 +382,6 @@ typedef struct svn_diff_file_options_t
     * @c FALSE.
     */
   svn_boolean_t show_c_function;
-  /** Whether to use git's extended diff format. The default is @c FALSE. */
-  svn_boolean_t use_git_format;
 } svn_diff_file_options_t;
 
 /** Allocate a @c svn_diff_file_options_t structure in @a pool, initializing
@@ -405,7 +403,6 @@ svn_diff_file_options_create(apr_pool_t 
  * - --ignore-space-change, -b
  * - --ignore-all-space, -w
  * - --ignore-eol-style
- * - --git-diff -g.
  * - --unified, -u (for compatibility, does nothing).
  */
 svn_error_t *

Modified: subversion/trunk/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=958725&r1=958724&r2=958725&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Mon Jun 28 20:54:13 2010
@@ -306,6 +306,8 @@ display_prop_diffs(const apr_array_heade
   return SVN_NO_ERROR;
 }
 
+#ifdef SVN_EXPERIMENTAL_PATCH
+
 /*
  * Print a git diff header for PATH to the stream OS using HEADER_ENCODING.
  * All allocations are done in RESULT_POOL. */
@@ -389,6 +391,7 @@ print_git_diff_header_modified(svn_strea
                                       path, path, APR_EOL_STR));
   return SVN_NO_ERROR;
 }
+#endif
 
 /*-----------------------------------------------------------------*/
 
@@ -691,48 +694,47 @@ diff_content_changed(const char *path,
                   (os, diff_cmd_baton->header_encoding, subpool,
                    "Index: %s" APR_EOL_STR "%s" APR_EOL_STR,
                    path, equal_string));
-          if (diff_cmd_baton->options.for_internal->use_git_format)
+#ifdef SVN_EXPERIMENTAL_PATCH
+
+          /* Add git headers and adjust the labels. 
+           * ### Once we're using the git format everywhere, we can create
+           * ### one func that sets the correct labels in one place. */
+          if (operation == svn_diff_op_deleted)
             {
+              SVN_ERR(print_git_diff_header_deleted(
+                                            os, 
+                                            diff_cmd_baton->header_encoding,
+                                            path, subpool));
+              svn_pool_destroy(subpool);
 
-              /* Add git headers and adjust the labels. 
-               * ### Once we're using the git format everywhere, we can create
-               * ### one func that sets the correct labels in one place. */
-              if (operation == svn_diff_op_deleted)
-                {
-                  SVN_ERR(print_git_diff_header_deleted(
-                                              os, 
-                                              diff_cmd_baton->header_encoding,
-                                              path, subpool));
-                  svn_pool_destroy(subpool);
-
-                  /* We only display the git diff header for deletes. */
-                  return SVN_NO_ERROR;
-
-                }
-              else if (operation == svn_diff_op_added)
-                {
-                  SVN_ERR(print_git_diff_header_added(
-                                                os, 
-                                                diff_cmd_baton->header_encoding,
-                                                path, subpool));
-                  label1 = diff_label("/dev/null", rev1, subpool);
-                  label2 = diff_label(apr_psprintf(subpool, "b/%s", path2), 
-                                      rev2, subpool);
-                }
-              else if (operation == svn_diff_op_modified)
-                {
-                  SVN_ERR(print_git_diff_header_modified(
-                                                os, 
-                                                diff_cmd_baton->header_encoding,
-                                                path, subpool));
-                  label1 = diff_label(apr_psprintf(subpool, "a/%s", path1), rev1,
-                                      subpool);
-                  label2 = diff_label(apr_psprintf(subpool, "b/%s", path2), rev2,
-                                      subpool);
-                }
+              /* We only display the git diff header for deletes. */
+              return SVN_NO_ERROR;
 
-              /* ### Print git headers for copies and renames too. */
             }
+          else if (operation == svn_diff_op_added)
+            {
+              SVN_ERR(print_git_diff_header_added(
+                                            os, 
+                                            diff_cmd_baton->header_encoding,
+                                            path, subpool));
+              label1 = diff_label("/dev/null", rev1, subpool);
+              label2 = diff_label(apr_psprintf(subpool, "b/%s", path2), rev2,
+                                  subpool);
+            }
+          else if (operation == svn_diff_op_modified)
+            {
+              SVN_ERR(print_git_diff_header_modified(
+                                            os, 
+                                            diff_cmd_baton->header_encoding,
+                                            path, subpool));
+              label1 = diff_label(apr_psprintf(subpool, "a/%s", path1), rev1,
+                                  subpool);
+              label2 = diff_label(apr_psprintf(subpool, "b/%s", path2), rev2,
+                                  subpool);
+            }
+
+          /* ### Print git headers for copies and renames too. */
+#endif
           /* Output the actual diff */
           SVN_ERR(svn_diff_file_output_unified3
                   (os, diff, tmpfile1, tmpfile2, label1, label2,

Modified: subversion/trunk/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/diff_file.c?rev=958725&r1=958724&r2=958725&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/trunk/subversion/libsvn_diff/diff_file.c Mon Jun 28 20:54:13 2010
@@ -543,7 +543,6 @@ static const apr_getopt_option_t diff_op
   { "ignore-all-space", 'w', 0, NULL },
   { "ignore-eol-style", SVN_DIFF__OPT_IGNORE_EOL_STYLE, 0, NULL },
   { "show-c-function", 'p', 0, NULL },
-  { "git-diff", 'g', 0, NULL },
   /* ### For compatibility; we don't support the argument to -u, because
    * ### we don't have optional argument support. */
   { "unified", 'u', 0, NULL },
@@ -599,8 +598,6 @@ svn_diff_file_options_parse(svn_diff_fil
         case 'p':
           options->show_c_function = TRUE;
           break;
-        case 'g':
-          options->use_git_format = TRUE;
         default:
           break;
         }

Modified: subversion/trunk/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/main.c?rev=958725&r1=958724&r2=958725&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/main.c (original)
+++ subversion/trunk/subversion/svn/main.c Mon Jun 28 20:54:13 2010
@@ -196,11 +196,7 @@ const apr_getopt_option_t svn_cl__option
                        "                            "
                        "    -p (--show-c-function):\n"
                        "                            "
-                       "       Show C function name in diff output.\n"
-                       "                            "
-                       "    -g (--git-diff):\n"
-                       "                            "
-                       "       Use git's extended diff format.")},
+                       "       Show C function name in diff output.")},
   {"targets",       opt_targets, 1,
                     N_("pass contents of file ARG as additional args")},
   {"depth",         opt_depth, 1,

Modified: subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=958725&r1=958724&r2=958725&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Mon Jun 28 20:54:13 2010
@@ -74,8 +74,6 @@ Valid options:
                                    Ignore changes in EOL style.
                                 -p (--show-c-function):
                                    Show C function name in diff output.
-                                -g (--git-diff):
-                                   Use git's extended diff format.
 
 Global options:
   --username ARG           : specify a username ARG