You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by eh...@apache.org on 2010/09/12 18:05:52 UTC

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

Author: ehu
Date: Sun Sep 12 16:05:52 2010
New Revision: 996334

URL: http://svn.apache.org/viewvc?rev=996334&view=rev
Log:
Two more NODES queries.

 * subversion/libsvn_wc/wc-queries.sql
   (STMT_UPDATE_BASE_NODE_FILEINFO,
    STMT_UPDATE_WORKING_NODE_FILEINFO): New.

 * subversion/libsvn_wc/wc_db.c
   (record_fileinfo): Update NODES when updating BASE_/WORKING_NODE.


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=996334&r1=996333&r2=996334&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Sun Sep 12 16:05:52 2010
@@ -241,10 +241,22 @@ where repos_id = ?1 and
 UPDATE BASE_NODE SET translated_size = ?3, last_mod_time = ?4
 WHERE wc_id = ?1 AND local_relpath = ?2;
 
+-- STMT_UPDATE_BASE_NODE_FILEINFO
+update nodes set translated_size = ?3, last_mod_time = ?4
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
 -- STMT_UPDATE_WORKING_FILEINFO
 UPDATE WORKING_NODE SET translated_size = ?3, last_mod_time = ?4
 WHERE wc_id = ?1 AND local_relpath = ?2;
 
+-- STMT_UPDATE_WORKING_NODE_FILEINFO
+update nodes set translated_size = ?3, last_mod_time = ?4
+where wc_id = ?1 and local_relpath = ?2
+  and op_depth = (select op_depth from nodes
+                  where wc_id = ?1 and local_relpath = ?2
+                  order by op_depth desc
+                  limit 1);
+
 -- STMT_UPDATE_ACTUAL_TREE_CONFLICTS
 update actual_node set tree_conflict_data = ?3
 where wc_id = ?1 and local_relpath = ?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=996334&r1=996333&r2=996334&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Sun Sep 12 16:05:52 2010
@@ -6052,7 +6052,7 @@ record_fileinfo(void *baton, svn_sqlite_
                                "information."),
                              svn_dirent_local_style(rb->local_abspath,
                                                     scratch_pool));
-
+#ifndef SVN_WC__NODES_ONLY
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
                                     working_exists
                                       ? STMT_UPDATE_WORKING_FILEINFO
@@ -6063,6 +6063,23 @@ record_fileinfo(void *baton, svn_sqlite_
   SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
 
   SVN_ERR_ASSERT(affected_rows == 1);
+#endif
+
+#ifdef SVN_WC__NODES
+  /* ### Instead of doing it this way, we just ought to update the highest
+     op_depth level. That way, there's no need to find out which
+     tree to update first */
+  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+                                    working_exists
+                                      ? STMT_UPDATE_WORKING_NODE_FILEINFO
+                                      : STMT_UPDATE_BASE_NODE_FILEINFO));
+  SVN_ERR(svn_sqlite__bindf(stmt, "isii",
+                            rb->wc_id, rb->local_relpath,
+                            rb->translated_size, rb->last_mod_time));
+  SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+
+  SVN_ERR_ASSERT(affected_rows == 1);
+#endif
 
   return SVN_NO_ERROR;
 }