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 2016/11/28 19:57:56 UTC

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

Author: stsp
Date: Mon Nov 28 19:57:56 2016
New Revision: 1771799

URL: http://svn.apache.org/viewvc?rev=1771799&view=rev
Log:
Make 'svn resolve' print a warning when no useful option can be offered
for a tree conflict, and point users at 'svn help resolve'.

* subversion/svn/conflict-callbacks.c
  (build_tree_conflict_options): New output param which indicates whether
   any useful resolution options exist.
  (handle_tree_conflict): Print a message if no useful options exist. 

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=1771799&r1=1771798&r2=1771799&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Mon Nov 28 19:57:56 2016
@@ -1436,6 +1436,7 @@ build_tree_conflict_options(
   apr_array_header_t **options,
   apr_array_header_t **possible_moved_to_repos_relpaths,
   apr_array_header_t **possible_moved_to_abspaths,
+  svn_boolean_t *all_options_are_dumb,
   svn_client_conflict_t *conflict,
   svn_client_ctx_t *ctx,
   apr_pool_t *result_pool,
@@ -1447,6 +1448,9 @@ build_tree_conflict_options(
   int i;
   apr_pool_t *iterpool;
 
+  if (all_options_are_dumb != NULL)
+    *all_options_are_dumb = TRUE;
+
   SVN_ERR(svn_client_conflict_tree_get_resolution_options(&builtin_options,
                                                           conflict, ctx,
                                                           scratch_pool,
@@ -1479,6 +1483,13 @@ build_tree_conflict_options(
 
       id = svn_client_conflict_option_get_id(builtin_option);
 
+      /* Check if we got a "smart" tree conflict option. */
+      if (all_options_are_dumb != NULL &&
+          *all_options_are_dumb &&
+          id != svn_client_conflict_option_postpone &&
+          id != svn_client_conflict_option_accept_current_wc_state)
+        *all_options_are_dumb = FALSE;
+
       if (id == svn_client_conflict_option_incoming_move_file_text_merge ||
           id == svn_client_conflict_option_incoming_move_dir_merge)
         {
@@ -1643,6 +1654,7 @@ handle_tree_conflict(svn_boolean_t *reso
   const char *incoming_change_description;
   apr_array_header_t *possible_moved_to_repos_relpaths;
   apr_array_header_t *possible_moved_to_abspaths;
+  svn_boolean_t all_options_are_dumb;
 
   option_id = svn_client_conflict_option_unspecified;
   local_abspath = svn_client_conflict_get_local_abspath(conflict);
@@ -1666,8 +1678,16 @@ handle_tree_conflict(svn_boolean_t *reso
   SVN_ERR(build_tree_conflict_options(&tree_conflict_options,
                                       &possible_moved_to_repos_relpaths,
                                       &possible_moved_to_abspaths,
+                                      &all_options_are_dumb,
                                       conflict, ctx,
                                       scratch_pool, scratch_pool));
+
+  if (all_options_are_dumb)
+    SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+                                _("\nSubversion is not smart enough to resolve "
+                                  "this tree conflict automatically!\nSee 'svn "
+                                  "help resolve' for more information.\n\n")));
+    
   iterpool = svn_pool_create(scratch_pool);
   while (1)
     {
@@ -1725,7 +1745,7 @@ handle_tree_conflict(svn_boolean_t *reso
                         &tree_conflict_options,
                         &possible_moved_to_repos_relpaths,
                         &possible_moved_to_abspaths,
-                        conflict, ctx,
+                        NULL, conflict, ctx,
                         scratch_pool, scratch_pool));
             }
           continue;
@@ -1767,7 +1787,7 @@ handle_tree_conflict(svn_boolean_t *reso
                         &tree_conflict_options,
                         &possible_moved_to_repos_relpaths,
                         &possible_moved_to_abspaths,
-                        conflict, ctx,
+                        NULL, conflict, ctx,
                         scratch_pool, scratch_pool));
             }
           continue;