You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/02/08 15:16:44 UTC

svn commit: r1444023 - in /subversion/trunk/subversion/libsvn_wc: wc-queries.sql wc_db.c

Author: rhuijben
Date: Fri Feb  8 14:16:44 2013
New Revision: 1444023

URL: http://svn.apache.org/r1444023
Log:
When the add part of a move is handled during post-commit, clear out its
moved_from information.

Easy fixup, knowing that sqlite has an index with exactly this information.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_CLEAR_MOVED_TO_FROM_DEST): New query.

* subversion/libsvn_wc/wc_db.c
  (moved_descendant_commit): Enable assertion. But not for production yet.
  (commit_node): When committing some kind of add, clear moved-to information
    if there is any. This improves the intermediate state during commit.
    (Note that this might be seen outside qlite transactions)

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=1444023&r1=1444022&r2=1444023&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Fri Feb  8 14:16:44 2013
@@ -295,6 +295,11 @@ WHERE wc_id = ?1
   AND (op_depth < ?3
        OR (op_depth = ?3 AND presence = MAP_BASE_DELETED))
 
+-- STMT_CLEAR_MOVED_TO_FROM_DEST
+UPDATE NODES SET moved_to = NULL
+WHERE wc_id = ?1
+  AND moved_to = ?2
+
 /* Get not-present descendants of a copied node. Not valid for the wc-root */
 -- STMT_SELECT_NOT_PRESENT_DESCENDANTS
 SELECT local_relpath FROM nodes

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1444023&r1=1444022&r2=1444023&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Feb  8 14:16:44 2013
@@ -10118,12 +10118,12 @@ moved_descendant_commit(svn_wc__db_wcroo
                                                 revision));
       SVN_ERR(svn_sqlite__update(&affected, stmt));
 
-      /* ### The following check should be valid, but triggers
-         copy_tests.py 84: copy a directory with whitespace to one without
-
-         indicating that we don't properly clean up in some other place,
-         or some commit ordering issue ### BH: Looking into this */
-      /* SVN_ERR_ASSERT(affected >= 1); */
+#ifdef SVN_DEBUG
+      /* Enable in release code?
+         Broken moves are not fatal yet, but this assertion would break
+         committing them */
+      SVN_ERR_ASSERT(affected >= 1); /* If this fails there is no move dest */
+#endif
 
       SVN_ERR(moved_descendant_commit(wcroot, to_relpath, to_op_depth,
                                       repos_id, new_repos_relpath, revision,
@@ -10327,6 +10327,14 @@ commit_node(svn_wc__db_wcroot_t *wcroot,
       SVN_ERR(moved_descendant_commit(wcroot, local_relpath, 0,
                                       repos_id, repos_relpath, new_revision,
                                       scratch_pool));
+
+      /* This node is no longer modified, so no node was moved here */
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                        STMT_CLEAR_MOVED_TO_FROM_DEST));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+                                            local_relpath));
+
+      SVN_ERR(svn_sqlite__step_done(stmt));
     }
 
   /* Update or add the BASE_NODE row with all the new information.  */