Author: rhuijben
Date: Sun Feb  8 11:43:50 2015
New Revision: 1658151

URL: http://svn.apache.org/r1658151
Log:
Following up on r1658146, fix a few more issues in handling replacements
during move-update handling.

This fixes an invalid obstruction tree conflict on virtually all replacements.

* subversion/libsvn_wc/wc_db_update_move.c
  (tc_editor_add_directory): When replacing ignore what is in the working
    copy if the type matches. Use a simple if like in add_file.
  (tc_editor_add_file): When replacing ignore what is in the working
    copy if the type matches.
  (tc_editor_delete): Properly record delete for the root when replaceing.
    Fix pool lifetime issue.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c?rev=1658151&r1=1658150&r2=1658151&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c Sun Feb  8 
11:43:50 2015
@@ -650,12 +650,13 @@ tc_editor_add_directory(node_move_baton_
 
   /* Check for unversioned tree-conflict */
   local_abspath = svn_dirent_join(b->wcroot->abspath, relpath, scratch_pool);
+
   SVN_ERR(svn_io_check_path(local_abspath, &wc_kind, scratch_pool));
+  if (wc_kind == old_kind)
+    wc_kind = svn_node_none; /* Node will be gone once we install */
 
-  switch (wc_kind)
+  if (wc_kind != svn_node_none)
     {
-    case svn_node_file:
-    default:
       SVN_ERR(create_node_tree_conflict(&conflict, nmb, relpath,
                                         wc_kind, svn_node_dir,
                                         move_dst_repos_relpath,
@@ -663,14 +664,11 @@ tc_editor_add_directory(node_move_baton_
                                         svn_wc_conflict_action_add, NULL,
                                         scratch_pool, scratch_pool));
       nmb->skip = TRUE;
-      break;
-
-    case svn_node_none:
+    }
+  else
+    {
       SVN_ERR(svn_wc__wq_build_dir_install(&work_item, b->db, local_abspath,
                                            scratch_pool, scratch_pool));
-      /* Fall through */
-    case svn_node_dir:
-      break;
     }
 
   SVN_ERR(update_move_list_add(b->wcroot, relpath,
@@ -739,6 +737,9 @@ tc_editor_add_file(node_move_baton_t *nm
   local_abspath = svn_dirent_join(b->wcroot->abspath, relpath, scratch_pool);
   SVN_ERR(svn_io_check_path(local_abspath, &wc_kind, scratch_pool));
 
+  if (wc_kind == old_kind)
+    wc_kind = svn_node_none; /* Node will be gone once we install */
+
   if (wc_kind != svn_node_none)
     {
       SVN_ERR(create_node_tree_conflict(&conflict, nmb, relpath,
@@ -1249,7 +1250,7 @@ tc_editor_delete(node_move_baton_t *nmb,
       else
         SVN_ERR(svn_wc__wq_build_file_remove(&work_items, b->db,
                                              b->wcroot->abspath, local_abspath,
-                                             iterpool, iterpool));
+                                             scratch_pool, iterpool));
 
         svn_pool_destroy(iterpool);
     }
@@ -1262,6 +1263,9 @@ tc_editor_delete(node_move_baton_t *nmb,
                                  svn_wc_notify_state_inapplicable,
                                  svn_wc_notify_state_inapplicable,
                                  conflict, work_items, scratch_pool));
+  else if (work_items)
+    SVN_ERR(svn_wc__db_wq_add_internal(b->wcroot, work_items,
+                                       scratch_pool));
 
   return SVN_NO_ERROR;
 }


Reply via email to