Author: stsp
Date: Mon Aug 21 11:33:17 2017
New Revision: 1805620

URL: http://svn.apache.org/viewvc?rev=1805620&view=rev
Log:
Make svn --non-interactive use recommended tree conflict resolution
options by default. Previously, it would postpone such conflicts.

This mode is not yet exposed as a separate --accept option argument.
Perhaps we will do that later.

* subversion/svn/cl.h
  (svn_cl__accept_recommended): Declare.

* subversion/svn/conflict-callbacks.c
  (svn_cl__resolve_conflict): Add support for svn_cl__accept_recommended.

* subversion/svn/merge-cmd.c
  (conflict_func_merge_cmd): Add svn_cl__accept_recommended to the switch
   statement (as an invalid option to use in this context).

* subversion/svn/svn.c
  (sub_main): Default to svn_cl__accept_recommended if --non-interactive.

Modified:
    subversion/trunk/subversion/svn/cl.h
    subversion/trunk/subversion/svn/conflict-callbacks.c
    subversion/trunk/subversion/svn/merge-cmd.c
    subversion/trunk/subversion/svn/svn.c

Modified: subversion/trunk/subversion/svn/cl.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/cl.h?rev=1805620&r1=1805619&r2=1805620&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/cl.h (original)
+++ subversion/trunk/subversion/svn/cl.h Mon Aug 21 11:33:17 2017
@@ -83,7 +83,10 @@ typedef enum svn_cl__accept_t
   svn_cl__accept_edit,
 
   /* Launch user's resolver and resolve conflict with edited file. */
-  svn_cl__accept_launch
+  svn_cl__accept_launch,
+
+  /* Use recommended resolution if available, else leave the conflict alone. */
+  svn_cl__accept_recommended
 
 } svn_cl__accept_t;
 

Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=1805620&r1=1805619&r2=1805620&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Mon Aug 21 11:33:17 
2017
@@ -2174,6 +2174,19 @@ svn_cl__resolve_conflict(svn_boolean_t *
             }
         }
     }
+  else if (accept_which == svn_cl__accept_recommended)
+    {
+      svn_client_conflict_option_id_t recommended_id;
+
+      if (tree_conflicted)
+        SVN_ERR(svn_client_conflict_tree_get_details(conflict, ctx,
+                                                     scratch_pool));
+      recommended_id = svn_client_conflict_get_recommended_option_id(conflict);
+      if (recommended_id != svn_client_conflict_option_unspecified)
+        option_id = recommended_id;
+      else
+        option_id = svn_client_conflict_option_postpone;
+    }
   else
     SVN_ERR_MALFUNCTION();
 

Modified: subversion/trunk/subversion/svn/merge-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/merge-cmd.c?rev=1805620&r1=1805619&r2=1805620&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/merge-cmd.c (original)
+++ subversion/trunk/subversion/svn/merge-cmd.c Mon Aug 21 11:33:17 2017
@@ -182,6 +182,7 @@ conflict_func_merge_cmd(svn_wc_conflict_
     case svn_cl__accept_postpone:
     case svn_cl__accept_invalid:
     case svn_cl__accept_unspecified:
+    case svn_cl__accept_recommended:
       /* Postpone or no valid --accept option, postpone the conflict. */
       choice = svn_wc_conflict_choose_postpone;
       break;

Modified: subversion/trunk/subversion/svn/svn.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/svn.c?rev=1805620&r1=1805619&r2=1805620&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/svn.c (original)
+++ subversion/trunk/subversion/svn/svn.c Mon Aug 21 11:33:17 2017
@@ -3068,10 +3068,11 @@ sub_main(int *exit_code, int argc, const
                                    SVN_CL__ACCEPT_LAUNCH);
         }
 
-      /* The default action when we're non-interactive is to postpone
-       * conflict resolution. */
+      /* The default action when we're non-interactive is to use the
+       * recommended conflict resolution (this will postpone conflicts
+       * for which no recommended resolution is available). */
       if (opt_state.accept_which == svn_cl__accept_unspecified)
-        opt_state.accept_which = svn_cl__accept_postpone;
+        opt_state.accept_which = svn_cl__accept_recommended;
     }
 
   /* Check whether interactive conflict resolution is disabled by


Reply via email to