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 2013/01/04 12:36:17 UTC

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

Author: stsp
Date: Fri Jan  4 11:36:17 2013
New Revision: 1428798

URL: http://svn.apache.org/viewvc?rev=1428798&view=rev
Log:
Resolve a FIXME comment in wc-queries.sql.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_CLEAR_MOVED_TO_RELPATH): Require an op-depth parameter to avoid
   clearing the moved-to-relpath of an unrelated node in a multi-layer
   move scenario.

* subversion/libsvn_wc/wc_db.c
  (clear_moved_to, delete_node): Pass the op-depth corresponding to the
   relpath for which the moved-to column is being cleared.

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=1428798&r1=1428797&r2=1428798&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Fri Jan  4 11:36:17 2013
@@ -1387,10 +1387,9 @@ WHERE wc_id = ?1 AND moved_to = ?2 AND o
 UPDATE nodes SET moved_to = ?4
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
 
-/* ### FIXME: op-depth?  What about multiple moves? */
 -- STMT_CLEAR_MOVED_TO_RELPATH
 UPDATE nodes SET moved_to = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
 
 /* This statement returns pairs of move-roots below the path ?2 in WC_ID ?1.
  * Each row returns a moved-here path (always a child of ?2) in the first

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1428798&r1=1428797&r2=1428798&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jan  4 11:36:17 2013
@@ -5750,8 +5750,9 @@ clear_moved_to(const char *local_relpath
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_CLEAR_MOVED_TO_RELPATH));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
-                            moved_from_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id,
+                            moved_from_relpath,
+                            relpath_depth(moved_from_relpath)));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
   return SVN_NO_ERROR;
@@ -7051,8 +7052,10 @@ delete_node(void *baton,
             {
               SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                                 STMT_CLEAR_MOVED_TO_RELPATH));
-              SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
-                                        moved_from_op_root_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));
             }
         }