subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1783522 - /subversion/trunk/subversion/svn/conflict-callbacks.c
Date Sat, 18 Feb 2017 11:58:39 GMT
Author: stsp
Date: Sat Feb 18 11:58:38 2017
New Revision: 1783522

URL: http://svn.apache.org/viewvc?rev=1783522&view=rev
Log:
Make 'svn resolve' warn about ambiguous moves at the conflict prompt.

* subversion/svn/conflict-callbacks.c
  (handle_tree_conflict): If ambiguous move destinations exist in the
   repository and/or working copy, print an extra line above the conflict
   prompt which tells users how they can resolve such ambiguities.

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=1783522&r1=1783521&r2=1783522&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Sat Feb 18 11:58:38 2017
@@ -1693,6 +1693,8 @@ handle_tree_conflict(svn_boolean_t *reso
   apr_array_header_t *possible_moved_to_abspaths;
   svn_boolean_t all_options_are_dumb;
   const struct client_option_t *recommended_option;
+  svn_boolean_t repos_move_target_chosen = FALSE;
+  svn_boolean_t wc_move_target_chosen = FALSE;
 
   option_id = svn_client_conflict_option_unspecified;
   local_abspath = svn_client_conflict_get_local_abspath(conflict);
@@ -1756,7 +1758,7 @@ handle_tree_conflict(svn_boolean_t *reso
                                 _("\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)
     {
@@ -1764,6 +1766,18 @@ handle_tree_conflict(svn_boolean_t *reso
 
       svn_pool_clear(iterpool);
 
+      if (!repos_move_target_chosen &&
+          possible_moved_to_repos_relpaths &&
+          possible_moved_to_repos_relpaths->nelts > 1)
+        SVN_ERR(svn_cmdline_printf(scratch_pool,
+                  _("Ambiguous move destinations exist in the repository; "
+                    "try the 'd' option\n")));
+      if (!wc_move_target_chosen && possible_moved_to_abspaths &&
+          possible_moved_to_abspaths->nelts > 1)
+        SVN_ERR(svn_cmdline_printf(scratch_pool,
+                  _("Ambiguous move destinations exist in the working copy; "
+                    "try the 'w' option\n")));
+
       SVN_ERR(prompt_user(&opt, tree_conflict_options, NULL,
                           conflict_description, pb, iterpool));
       *printed_description = TRUE;
@@ -1809,6 +1823,8 @@ handle_tree_conflict(svn_boolean_t *reso
               SVN_ERR(svn_client_conflict_option_set_moved_to_repos_relpath(
                         conflict_option, preferred_move_target_idx,
                         ctx, iterpool));
+              repos_move_target_chosen = TRUE;
+              wc_move_target_chosen = FALSE;
 
               /* Update option description. */
               SVN_ERR(build_tree_conflict_options(
@@ -1858,7 +1874,9 @@ handle_tree_conflict(svn_boolean_t *reso
           if (conflict_option)
             {
               SVN_ERR(svn_client_conflict_option_set_moved_to_abspath(
-                        conflict_option, preferred_move_target_idx, ctx, iterpool));
+                        conflict_option, preferred_move_target_idx, ctx,
+                        iterpool));
+              wc_move_target_chosen = TRUE;
 
               /* Update option description. */
               SVN_ERR(build_tree_conflict_options(



Mime
View raw message