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/06/13 21:04:47 UTC

svn commit: r1748311 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_client/conflicts.c libsvn_wc/conflicts.c

Author: stsp
Date: Mon Jun 13 21:04:47 2016
New Revision: 1748311

URL: http://svn.apache.org/viewvc?rev=1748311&view=rev
Log:
When guessing a move target in the working copy, take node kind into account.

* subversion/include/private/svn_wc_private.h
  (svn_wc__guess_incoming_move_target_node): Add 'victim_node_kind' parameter.

* subversion/libsvn_client/conflicts.c
  (configure_option_incoming_move_file_merge): Rename 'local_abspath' to
   'victim_abspath' for clarity. Pass victim node kind to libsvn_wc.

* subversion/libsvn_wc/conflicts.c
  (svn_wc__guess_incoming_move_target_node): Use 'victim_node_kind' parameter
   to filter out candidates with mismatching node kind.

Modified:
    subversion/trunk/subversion/include/private/svn_wc_private.h
    subversion/trunk/subversion/libsvn_client/conflicts.c
    subversion/trunk/subversion/libsvn_wc/conflicts.c

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1748311&r1=1748310&r2=1748311&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Mon Jun 13 21:04:47 2016
@@ -1892,6 +1892,7 @@ svn_wc__conflict_tree_update_moved_away_
 
 /* Find a node in the working copy which corresponds to the new location
  * MOVED_TO_REPOS_RELPATH@REV of the tree conflict victim at VICTIM_ABSPATH.
+ * The node must be of the same node kind as VICTIM_NODE_KIND.
  * If no such node can be found, set *MOVED_TO_ABSPATH to NULL.
  *
  * The node should be useful for conflict resolution, e.g. it should be
@@ -1909,6 +1910,7 @@ svn_error_t *
 svn_wc__guess_incoming_move_target_node(const char **moved_to_abspath,
                                         svn_wc_context_t *wc_ctx,
                                         const char *victim_abspath,
+                                        svn_node_kind_t victim_node_kind,
                                         const char *moved_to_repos_relpath,
                                         svn_revnum_t rev,
                                         apr_pool_t *result_pool,

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1748311&r1=1748310&r2=1748311&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Mon Jun 13 21:04:47 2016
@@ -6645,16 +6645,16 @@ configure_option_incoming_move_file_merg
     {
       svn_client_conflict_option_t *option;
       const char *wcroot_abspath;
-      const char *local_abspath;
+      const char *victim_abspath;
       struct repos_move_info *move;
       const char *moved_to_abspath;
 
       option = apr_pcalloc(options->pool, sizeof(*option));
       option->id = svn_client_conflict_option_incoming_move_file_text_merge;
+      victim_abspath = svn_client_conflict_get_local_abspath(conflict);
       SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath, conflict->ctx->wc_ctx,
-                                 conflict->local_abspath, scratch_pool,
+                                 victim_abspath, scratch_pool,
                                  scratch_pool));
-      local_abspath = svn_client_conflict_get_local_abspath(conflict);
 
       /* Find the last move in the move chain. This should correspond to
        * the node's location in incoming_new_pegrev. */
@@ -6664,7 +6664,8 @@ configure_option_incoming_move_file_merg
         move = move->next;
 
       SVN_ERR(svn_wc__guess_incoming_move_target_node(
-                &moved_to_abspath, conflict->ctx->wc_ctx, local_abspath,
+                &moved_to_abspath, conflict->ctx->wc_ctx,
+                victim_abspath, victim_node_kind,
                 move->moved_to_repos_relpath, incoming_new_pegrev,
                 scratch_pool, scratch_pool));
       if (moved_to_abspath == NULL)
@@ -6677,7 +6678,7 @@ configure_option_incoming_move_file_merg
           options->pool,
           _("follow move-away of '%s' and merge with '%s'"),
           svn_dirent_local_style(svn_dirent_skip_ancestor(wcroot_abspath,
-                                                          local_abspath),
+                                                          victim_abspath),
                                  scratch_pool),
           svn_dirent_local_style(svn_dirent_skip_ancestor(wcroot_abspath,
                                                           moved_to_abspath),

Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=1748311&r1=1748310&r2=1748311&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Mon Jun 13 21:04:47 2016
@@ -3689,6 +3689,7 @@ svn_error_t *
 svn_wc__guess_incoming_move_target_node(const char **moved_to_abspath,
                                         svn_wc_context_t *wc_ctx,
                                         const char *victim_abspath,
+                                        svn_node_kind_t victim_node_kind,
                                         const char *moved_to_repos_relpath,
                                         svn_revnum_t rev,
                                         apr_pool_t *result_pool,
@@ -3709,6 +3710,7 @@ svn_wc__guess_incoming_move_target_node(
    * unlikely candidates, and return the first node which is "good enough".
    * Nodes which are tree conflict victims don't count, and nodes which
    * cannot be modified (e.g. replaced or deleted nodes) don't count.
+   * Nodes which are of a different node kind don't count either.
    * Ignore switched nodes as well, since that is an unlikely case during
    * update/swtich/merge conflict resolution. And externals shouldn't even
    * be on our candidate list in the first place.
@@ -3724,6 +3726,7 @@ svn_wc__guess_incoming_move_target_node(
       svn_wc__db_status_t status;
       svn_boolean_t is_wcroot;
       svn_boolean_t is_switched;
+      svn_node_kind_t node_kind;
 
       svn_pool_clear(iterpool);
 
@@ -3735,17 +3738,20 @@ svn_wc__guess_incoming_move_target_node(
       if (tree_conflicted)
         continue;
 
-      SVN_ERR(svn_wc__db_read_info(&status,
+      SVN_ERR(svn_wc__db_read_info(&status, &node_kind,
                                    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                   NULL, NULL, NULL, NULL, NULL,
+                                   NULL, NULL, NULL, NULL,
                                    wc_ctx->db, local_abspath, iterpool,
                                    iterpool));
       if (status != svn_wc__db_status_normal &&
           status != svn_wc__db_status_added)
         continue;
 
+      if (node_kind != victim_node_kind)
+        continue;
+
       SVN_ERR(svn_wc__db_is_switched(&is_wcroot, &is_switched, NULL,
                                      wc_ctx->db, local_abspath, iterpool));
       if (is_wcroot || is_switched)