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 2014/12/15 07:45:00 UTC

svn commit: r1645578 - /subversion/trunk/subversion/svn/conflict-callbacks.c

Author: stefan2
Date: Mon Dec 15 06:44:59 2014
New Revision: 1645578

URL: http://svn.apache.org/r1645578
Log:
Prevent the interactive conflict resolver from segfaulting on "df" and "m"
options for binary files by hiding these options.

This is a mere workaround and not a proper fix to underlying state model.

* subversion/svn/conflict-callbacks.c
  (handle_text_conflict): Add TODO marking the whole logic as "outdated".
                          Make sure the MY_ABSPATH string is available
                          for those options that will use it.

Modified:
    subversion/trunk/subversion/svn/conflict-callbacks.c

Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=1645578&r1=1645577&r2=1645578&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Mon Dec 15 06:44:59 2014
@@ -695,6 +695,10 @@ handle_text_conflict(svn_wc_conflict_res
                                 b->path_prefix, desc->local_abspath,
                                 scratch_pool)));
 
+  /* ### TODO This whole feature availability check is grossly outdated.
+     DIFF_ALLOWED needs either to be redefined or to go away.
+   */
+
   /* Diffing can happen between base and merged, to show conflict
      markers to the user (this is the typical 3-way merge
      scenario), or if no base is available, we can show a diff
@@ -714,9 +718,15 @@ handle_text_conflict(svn_wc_conflict_res
       *next_option++ = "p";
       if (diff_allowed)
         {
-          *next_option++ = "df";
+          /* We need one more path for this feature. */
+          if (desc->my_abspath)
+            *next_option++ = "df";
+
           *next_option++ = "e";
-          *next_option++ = "m";
+
+          /* We need one more path for this feature. */
+          if (desc->my_abspath)
+            *next_option++ = "m";
 
           if (knows_something)
             *next_option++ = "r";
@@ -781,7 +791,8 @@ handle_text_conflict(svn_wc_conflict_res
         }
       else if (strcmp(opt->code, "df") == 0)
         {
-          if (! diff_allowed)
+          /* Re-check preconditions. */
+          if (! diff_allowed || desc->my_abspath)
             {
               SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
                              _("Invalid option; there's no "
@@ -805,6 +816,15 @@ handle_text_conflict(svn_wc_conflict_res
         {
           svn_error_t *err;
 
+          /* Re-check preconditions. */
+          if (! desc->my_abspath)
+            {
+              SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
+                             _("Invalid option; there's no "
+                                "base path to merge.\n\n")));
+              continue;
+            }
+
           err = svn_cl__merge_file_externally(desc->base_abspath,
                                               desc->their_abspath,
                                               desc->my_abspath,