subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1839292 - in /subversion/trunk/subversion: include/svn_client.h libsvn_client/conflicts.c svn/conflict-callbacks.c tests/libsvn_client/conflicts-test.c
Date Mon, 27 Aug 2018 10:32:19 GMT
Author: stsp
Date: Mon Aug 27 10:32:19 2018
New Revision: 1839292

URL: http://svn.apache.org/viewvc?rev=1839292&view=rev
Log:
Introduce separate conflict option IDs for sibling move cases.

New option IDs had been avoided to make backporting to 1.10 easier.
Since the outstanding backport proposal was retracted in r1839283
it is time to use proper designations to make things less confusing.

* subversion/include/svn_client.h
  (svn_client_conflict_option_sibling_move_file_text_merge,
   svn_client_conflict_option_sibling_move_dir_merge): Declare.

* subversion/libsvn_client/conflicts.c
  (conflict_tree_get_details_local_missing,
   configure_option_sibling_move_merge): Use new options for
   sibling move cases instead of overloading the 'local move' IDs.
   A 'local move' is a different case.
  (init_wc_move_targets): Add sibling move options.
  (resolve_local_move_file_merge): Update docstring.
  (svn_client_conflict_option_get_moved_to_abspath_candidates,
   svn_client_conflict_option_set_moved_to_abspath): Add sibling move options.

* subversion/svn/conflict-callbacks.c
  (builtin_resolver_options): Assign menu key "m" to sibling move options.
  (build_tree_conflict_options, handle_tree_conflict); Support sibling
   move options.

* subversion/tests/libsvn_client/conflicts-test.c
  (test_cherry_pick_post_move_edit, test_cherry_pick_post_move_edit_dir):
   Update test expectations.

Modified:
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/libsvn_client/conflicts.c
    subversion/trunk/subversion/svn/conflict-callbacks.c
    subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c

Modified: subversion/trunk/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1839292&r1=1839291&r2=1839292&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Mon Aug 27 10:32:19 2018
@@ -4560,6 +4560,11 @@ typedef enum svn_client_conflict_option_
   /* Options for local move vs incoming edit on merge. */
   svn_client_conflict_option_local_move_file_text_merge,
   svn_client_conflict_option_local_move_dir_merge,
+
+  /* Options for local missing vs incoming edit on merge. */
+  svn_client_conflict_option_sibling_move_file_text_merge,
+  svn_client_conflict_option_sibling_move_dir_merge,
+
 } svn_client_conflict_option_id_t;
 
 /**

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1839292&r1=1839291&r2=1839292&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Mon Aug 27 10:32:19 2018
@@ -2862,10 +2862,10 @@ conflict_tree_get_details_local_missing(
 
       if (kind == svn_node_file)
           conflict->recommended_option_id =
-              svn_client_conflict_option_local_move_file_text_merge;
+              svn_client_conflict_option_sibling_move_file_text_merge;
       else if (kind == svn_node_dir)
           conflict->recommended_option_id =
-            svn_client_conflict_option_local_move_dir_merge;
+            svn_client_conflict_option_sibling_move_dir_merge;
     }
                                          
   conflict->tree_conflict_local_details = details;
@@ -4958,6 +4958,8 @@ init_wc_move_targets(struct conflict_tre
               svn_client_conflict_option_incoming_move_dir_merge,
               svn_client_conflict_option_local_move_file_text_merge,
               svn_client_conflict_option_local_move_dir_merge,
+              svn_client_conflict_option_sibling_move_file_text_merge,
+              svn_client_conflict_option_sibling_move_dir_merge,
             };
           apr_array_header_t *options;
 
@@ -8963,7 +8965,9 @@ unlock_wc:
   return SVN_NO_ERROR;
 }
 
-/* Implements conflict_option_resolve_func_t. */
+/* Implements conflict_option_resolve_func_t.
+ * Handles svn_client_conflict_option_local_move_file_text_merge
+ * and svn_client_conflict_option_sibling_move_file_text_merge. */
 static svn_error_t *
 resolve_local_move_file_merge(svn_client_conflict_option_t *option,
                               svn_client_conflict_t *conflict,
@@ -9007,11 +9011,11 @@ resolve_local_move_file_merge(svn_client
             NULL, conflict, scratch_pool,
             scratch_pool));
 
-  if (details->wc_siblings)
+  if (details->wc_siblings) /* local missing */
     merge_target_abspath = APR_ARRAY_IDX(details->wc_siblings,
                                          details->preferred_sibling_idx,
                                          const char *);
-  else
+  else /* local move */
     merge_target_abspath = details->moved_to_abspath;
 
   SVN_ERR(svn_wc__get_tmpdir(&wc_tmpdir, ctx->wc_ctx,
@@ -10407,11 +10411,9 @@ configure_option_sibling_move_merge(svn_
               (incoming_new_kind == svn_node_file ||
                incoming_new_kind == svn_node_none))
             {
-              /* ### This is actually a 'sibling move', not a 'local move'.
-               * ### Does this case need a separate resolution option? */
               add_resolution_option(
                 options, conflict,
-                svn_client_conflict_option_local_move_file_text_merge,
+                svn_client_conflict_option_sibling_move_file_text_merge,
                 _("Apply to corresponding local location"),
                 description, resolve_local_move_file_merge);
             }
@@ -10419,9 +10421,7 @@ configure_option_sibling_move_merge(svn_
             {
               add_resolution_option(
                 options, conflict,
-                /* ### This is actually a 'sibling move', not a 'local move'.
-                 * ### Does this case need a separate resolution option? */
-                svn_client_conflict_option_local_move_dir_merge,
+                svn_client_conflict_option_sibling_move_dir_merge,
                 _("Apply to corresponding local location"),
                 description, resolve_sibling_move_dir_merge);
             }
@@ -10580,7 +10580,9 @@ svn_client_conflict_option_get_moved_to_
                  svn_client_conflict_option_get_id(option) ==
                  svn_client_conflict_option_incoming_move_dir_merge ||
                  svn_client_conflict_option_get_id(option) ==
-                 svn_client_conflict_option_local_move_dir_merge);
+                 svn_client_conflict_option_sibling_move_file_text_merge ||
+                 svn_client_conflict_option_get_id(option) ==
+                 svn_client_conflict_option_sibling_move_dir_merge);
 
   victim_abspath = svn_client_conflict_get_local_abspath(conflict);
   operation = svn_client_conflict_get_operation(conflict);
@@ -10671,7 +10673,11 @@ svn_client_conflict_option_set_moved_to_
                  svn_client_conflict_option_get_id(option) ==
                  svn_client_conflict_option_local_move_file_text_merge ||
                  svn_client_conflict_option_get_id(option) ==
-                 svn_client_conflict_option_incoming_move_dir_merge);
+                 svn_client_conflict_option_incoming_move_dir_merge ||
+                 svn_client_conflict_option_get_id(option) ==
+                 svn_client_conflict_option_sibling_move_file_text_merge ||
+                 svn_client_conflict_option_get_id(option) ==
+                 svn_client_conflict_option_sibling_move_dir_merge);
 
   victim_abspath = svn_client_conflict_get_local_abspath(conflict);
   operation = svn_client_conflict_get_operation(conflict);

Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=1839292&r1=1839291&r2=1839292&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Mon Aug 27 10:32:19 2018
@@ -442,6 +442,10 @@ static const resolver_option_t builtin_r
   { "m", svn_client_conflict_option_local_move_file_text_merge },
   { "m", svn_client_conflict_option_local_move_dir_merge },
 
+  /* Options for local missing vs incoming edit. */
+  { "m", svn_client_conflict_option_sibling_move_file_text_merge },
+  { "m", svn_client_conflict_option_sibling_move_dir_merge },
+
   { NULL }
 };
 
@@ -1542,7 +1546,9 @@ build_tree_conflict_options(
                     result_pool, iterpool));
         }
       else if (id == svn_client_conflict_option_local_move_file_text_merge ||
-          id == svn_client_conflict_option_local_move_dir_merge)
+          id == svn_client_conflict_option_local_move_dir_merge ||
+          id == svn_client_conflict_option_sibling_move_file_text_merge ||
+          id == svn_client_conflict_option_sibling_move_dir_merge)
           SVN_ERR(svn_client_conflict_option_get_moved_to_abspath_candidates(
                     possible_moved_to_abspaths, builtin_option,
                     result_pool, iterpool));
@@ -1889,6 +1895,20 @@ handle_tree_conflict(svn_boolean_t *reso
             }
           if (conflict_option == NULL)
             {
+              conflict_option =
+                svn_client_conflict_option_find_by_id( 
+                  options,
+                  svn_client_conflict_option_sibling_move_file_text_merge);
+            }
+          if (conflict_option == NULL)
+            {
+              conflict_option =
+                svn_client_conflict_option_find_by_id( 
+                  options,
+                  svn_client_conflict_option_sibling_move_dir_merge);
+            }
+          if (conflict_option == NULL)
+            {
               conflict_option =
                 svn_client_conflict_option_find_by_id( 
                   options, svn_client_conflict_option_incoming_move_dir_merge);

Modified: subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c?rev=1839292&r1=1839291&r2=1839292&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c Mon Aug 27 10:32:19 2018
@@ -4982,7 +4982,7 @@ test_cherry_pick_post_move_edit(const sv
     svn_client_conflict_option_id_t expected_opts[] = {
       svn_client_conflict_option_postpone,
       svn_client_conflict_option_accept_current_wc_state,
-      svn_client_conflict_option_local_move_file_text_merge,
+      svn_client_conflict_option_sibling_move_file_text_merge,
       -1 /* end of list */
     };
     SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts,
@@ -4992,7 +4992,7 @@ test_cherry_pick_post_move_edit(const sv
   /* Try to resolve the conflict. */
   SVN_ERR(svn_client_conflict_tree_resolve_by_id(
             conflict,
-            svn_client_conflict_option_local_move_file_text_merge,
+            svn_client_conflict_option_sibling_move_file_text_merge,
             ctx, b->pool));
 
   /* The node "A1/mu-moved" should no longer exist. */
@@ -5658,7 +5658,7 @@ test_cherry_pick_post_move_edit_dir(cons
     svn_client_conflict_option_id_t expected_opts[] = {
       svn_client_conflict_option_postpone,
       svn_client_conflict_option_accept_current_wc_state,
-      svn_client_conflict_option_local_move_dir_merge,
+      svn_client_conflict_option_sibling_move_dir_merge,
       -1 /* end of list */
     };
     SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts,
@@ -5668,7 +5668,7 @@ test_cherry_pick_post_move_edit_dir(cons
   /* Try to resolve the conflict. */
   SVN_ERR(svn_client_conflict_tree_resolve_by_id(
             conflict,
-            svn_client_conflict_option_local_move_dir_merge,
+            svn_client_conflict_option_sibling_move_dir_merge,
             ctx, b->pool));
 
   /* The node "B-moved" should no longer exist. */



Mime
View raw message