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 2017/02/21 12:14:01 UTC

svn commit: r1783879 - /subversion/trunk/subversion/libsvn_client/conflicts.c

Author: stsp
Date: Tue Feb 21 12:14:01 2017
New Revision: 1783879

URL: http://svn.apache.org/viewvc?rev=1783879&view=rev
Log:
Stop recommending resolution options which follow incoming moves for merges.

It makes sense for update and switch. If merging, however, the user may want
to apply an incoming edit to the node's old location, e.g. when backporting
a file edit to an older release branch where the move should not be applied.
Recommending that the move be applied without user interaction is not helpful
in such a case. Instead, the resolver should offer two options:
apply the move + edits, or apply edits at the old location.
The latter option is not yet implemented.

* subversion/libsvn_client/conflicts.c
  (init_wc_move_targets): Only recommend options which follow incoming moves
   for conflicts raised by update and switch operations.

Modified:
    subversion/trunk/subversion/libsvn_client/conflicts.c

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1783879&r1=1783878&r2=1783879&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Tue Feb 21 12:14:01 2017
@@ -4059,9 +4059,11 @@ init_wc_move_targets(struct conflict_tre
   const char *victim_abspath;
   svn_node_kind_t victim_node_kind;
   svn_revnum_t incoming_new_pegrev;
+  svn_wc_operation_t operation;
 
   victim_abspath = svn_client_conflict_get_local_abspath(conflict);
   victim_node_kind = svn_client_conflict_tree_get_victim_node_kind(conflict);
+  operation = svn_client_conflict_get_operation(conflict);
   SVN_ERR(svn_client_conflict_get_incoming_new_repos_location(
             NULL, &incoming_new_pegrev, NULL, conflict,
             scratch_pool, scratch_pool));
@@ -4084,8 +4086,11 @@ init_wc_move_targets(struct conflict_tre
     get_moved_to_repos_relpath(details, scratch_pool);
   details->wc_move_target_idx = 0;
 
-  /* If only one move target exists recommend a resolution option. */
-  if (apr_hash_count(details->wc_move_targets) == 1)
+  /* If only one move target exists after an update or switch,
+   * recommend a resolution option which follows the incoming move. */
+  if (apr_hash_count(details->wc_move_targets) == 1 &&
+      (operation == svn_wc_operation_update ||
+       operation == svn_wc_operation_switch))
     {
       apr_array_header_t *wc_abspaths;