subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1781872 - /subversion/trunk/subversion/libsvn_client/conflicts.c
Date Mon, 06 Feb 2017 10:50:21 GMT
Author: stsp
Date: Mon Feb  6 10:50:21 2017
New Revision: 1781872

URL: http://svn.apache.org/viewvc?rev=1781872&view=rev
Log:
Revert r1781862 for now. That commit had a silly bug where it assigned a
local abspath to a variable which is supposed to hold a repository relpath.

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=1781872&r1=1781871&r2=1781872&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Mon Feb  6 10:50:21 2017
@@ -2670,25 +2670,6 @@ get_moved_to_repos_relpath(
   return move->moved_to_repos_relpath;
 }
 
-/* Return a default working copy move target path. */
-static const char *
-select_default_move_target_abspath(
-  struct conflict_tree_incoming_delete_details *details,
-  apr_pool_t *scratch_pool)
-{
-  apr_array_header_t *repos_relpaths;
-  svn_sort__item_t item;
-
-  if (apr_hash_count(details->wc_move_targets) == 0)
-    return NULL;
-
-  repos_relpaths = svn_sort__hash(details->wc_move_targets,
-                                  svn_sort_compare_items_as_paths,
-                                  scratch_pool);
-  item = APR_ARRAY_IDX(repos_relpaths, 0, svn_sort__item_t);
-  return (const char *)item.key;
-}
-
 static const char *
 describe_incoming_deletion_upon_update(
   struct conflict_tree_incoming_delete_details *details,
@@ -9136,6 +9117,7 @@ configure_option_incoming_move_file_merg
       incoming_change == svn_wc_conflict_action_delete)
     {
       const char *victim_abspath;
+      apr_array_header_t *move_target_repos_relpaths;
       const char *description;
 
       victim_abspath = svn_client_conflict_get_local_abspath(conflict);
@@ -9155,12 +9137,27 @@ configure_option_incoming_move_file_merg
                                          incoming_new_pegrev,
                                          conflict->pool, scratch_pool));
             }
+          if (apr_hash_count(details->wc_move_targets) > 0)
+            {
+              svn_sort__item_t item;
 
-          /* Initialize to the first possible move target. Hopefully,
-           * in most cases there will only be one candidate anyway. */
-          details->move_target_repos_relpath =
-            select_default_move_target_abspath(details, scratch_pool);
-          details->wc_move_target_idx = 0;
+              /* Initialize to the first possible move target. Hopefully,
+               * in most cases there will only be one candidate anyway. */
+              move_target_repos_relpaths = 
+                svn_sort__hash(details->wc_move_targets,
+                               svn_sort_compare_items_as_paths,
+                               scratch_pool);
+              item = APR_ARRAY_IDX(move_target_repos_relpaths, 0,
+                                   svn_sort__item_t);
+              details->move_target_repos_relpath = item.key;
+              details->wc_move_target_idx = 0;
+            }
+          else
+            {
+              details->move_target_repos_relpath = NULL;
+              details->wc_move_target_idx = 0;
+              return SVN_NO_ERROR;
+            }
         }
 
       if (apr_hash_count(details->wc_move_targets) == 0)
@@ -9224,6 +9221,7 @@ configure_option_incoming_dir_merge(svn_
       const char *description;
       const char *wcroot_abspath;
       const char *victim_abspath;
+      apr_array_header_t *move_target_repos_relpaths;
 
       victim_abspath = svn_client_conflict_get_local_abspath(conflict);
       SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath, ctx->wc_ctx,
@@ -9246,12 +9244,27 @@ configure_option_incoming_dir_merge(svn_
                                          incoming_new_pegrev,
                                          conflict->pool, scratch_pool));
             }
+          if (apr_hash_count(details->wc_move_targets) > 0)
+            {
+              svn_sort__item_t item;
 
-          /* Initialize to the first possible move target. Hopefully,
-           * in most cases there will only be one candidate anyway. */
-          details->move_target_repos_relpath =
-            select_default_move_target_abspath(details, scratch_pool);
-          details->wc_move_target_idx = 0;
+              /* Initialize to the first possible move target. Hopefully,
+               * in most cases there will only be one candidate anyway. */
+              move_target_repos_relpaths = 
+                svn_sort__hash(details->wc_move_targets,
+                               svn_sort_compare_items_as_paths,
+                               scratch_pool);
+              item = APR_ARRAY_IDX(move_target_repos_relpaths, 0,
+                                   svn_sort__item_t);
+              details->move_target_repos_relpath = item.key;
+              details->wc_move_target_idx = 0;
+            }
+          else
+            {
+              details->move_target_repos_relpath = NULL;
+              details->wc_move_target_idx = 0;
+              return SVN_NO_ERROR;
+            }
         }
 
       if (apr_hash_count(details->wc_move_targets) == 0)



Mime
View raw message