Author: rhuijben
Date: Thu Feb 28 19:31:27 2013
New Revision: 1451308

URL: http://svn.apache.org/r1451308
Log:
* subversion/libsvn_wc/wc-queries.sql
  (STMT_UPDATE_MOVED_TO): Rename to ...
  (STMT_UPDATE_MOVED_TO_DESCENDANTS): ... this to make the name show
    recursiveness.
  (STMT_CLEAR_MOVED_TO_DESCENDANTS): New statement.

* subversion/libsvn_wc/wc_db.c
  (delete_node): When not calling STMT_UPDATE_MOVED_TO_DESCENDANTS, call
    STMT_CLEAR_MOVED_TO_DESCENDANTS to ensure the simple state that there
    is no longer anything moved to the path that is now deleted.

    Remove separate code that did about the same thing for just the root.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1451308&r1=1451307&r2=1451308&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Thu Feb 28 19:31:27 
2013
@@ -1499,11 +1499,17 @@ WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND moved_to IS NOT NULL
 
--- STMT_UPDATE_MOVED_TO
+-- STMT_UPDATE_MOVED_TO_DESCENDANTS
 UPDATE nodes SET moved_to = RELPATH_SKIP_JOIN(?2, ?3, moved_to)
  WHERE wc_id = ?1
    AND IS_STRICT_DESCENDANT_OF(moved_to, ?2)
 
+-- STMT_CLEAR_MOVED_TO_DESCENDANTS
+UPDATE nodes SET moved_to = NULL
+ WHERE wc_id = ?1
+   AND IS_STRICT_DESCENDANT_OF(moved_to, ?2)
+
+
 /* This statement returns pairs of move-roots below the path ?2 in WC_ID ?1,
  * where the source of the move is within the subtree rooted at path ?2, and
  * the destination of the move is outside the subtree rooted at path ?2. */

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1451308&r1=1451307&r2=1451308&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Feb 28 19:31:27 2013
@@ -7599,12 +7599,20 @@ delete_node(void *baton,
       /* And update all moved_to values still pointing to this location */
 
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                        STMT_UPDATE_MOVED_TO));
+                                        STMT_UPDATE_MOVED_TO_DESCENDANTS));
       SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id,
                                              local_relpath,
                                              b->moved_to_relpath));
       SVN_ERR(svn_sqlite__update(NULL, stmt));
     }
+  else
+    {
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                        STMT_CLEAR_MOVED_TO_DESCENDANTS));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+                                            local_relpath));
+      SVN_ERR(svn_sqlite__update(NULL, stmt));
+    }
 
   /* Find children that were moved out of the subtree rooted at this node.
    * We'll need to update their op-depth columns because their deletion
@@ -7676,35 +7684,6 @@ delete_node(void *baton,
         }
 
       select_depth = relpath_depth(local_relpath);
-
-      /* When deleting a moved-here op-root, clear moved-to data at the
-       * pre-move location, transforming the move into a normal delete.
-       * This way, deleting the copied half of a move has the same effect
-       * as reverting it. */
-      if (status == svn_wc__db_status_added ||
-          status == svn_wc__db_status_moved_here)
-        {
-          const char *moved_from_relpath;
-          const char *moved_from_op_root_relpath;
-
-          SVN_ERR(scan_addition(&status, NULL, NULL, NULL, NULL, NULL, NULL,
-                                &moved_from_relpath,
-                                &moved_from_op_root_relpath, NULL,
-                                wcroot, local_relpath,
-                                scratch_pool, scratch_pool));
-          if (status == svn_wc__db_status_moved_here &&
-              moved_from_relpath && moved_from_op_root_relpath &&
-              strcmp(moved_from_relpath, moved_from_op_root_relpath) == 0)
-            {
-              SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                                STMT_CLEAR_MOVED_TO_RELPATH));
-              SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id,
-                                        moved_from_op_root_relpath,
-                                        relpath_depth(
-                                          moved_from_op_root_relpath)));
-              SVN_ERR(svn_sqlite__step_done(stmt));
-            }
-        }
     }
   else
     {


Reply via email to