Author: philip
Date: Wed May  4 10:49:08 2011
New Revision: 1099404

URL: http://svn.apache.org/viewvc?rev=1099404&view=rev
Log:
Enable the single-txn delete and remove the old implementation.

* subversion/libsvn_wc/adm_ops.c
  (svn_wc_delete4): Remove conditional code, note some code that may
   need to move.

* subversion/libsvn_wc/update_editor.c
  (add_directory, close_file): Use new delete function.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_DELETE_CHILD_NODES_RECURSIVE,
   STMT_CLEAR_ACTUAL_NODE_LEAVING_CONFLICT, STMT_UPDATE_NODE_WORKING_PRESENCE,
   STMT_INSERT_WORKING_NODE_FROM_NODE, STMT_UPDATE_OP_DEPTH_REDUCE_RECURSIVE,
   STMT_UPDATE_WORKING_TO_DELETED, STMT_SELECT_NODES_GE_OP_DEPTH_RECURSIVE,
   STMT_SELECT_ACTUAL_NODE_RECURSIVE): Delete.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_temp_op_delete): Remove.

* subversion/libsvn_wc/wc_db.c
  (struct temp_op_delete_baton_t): Remove.
  (remove_children, db_working_actual_remove, db_working_update_presence,
   db_working_insert, is_add_or_root_of_copy, temp_op_delete_txn,
   svn_wc__db_temp_op_delete): Remove.

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

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1099404&r1=1099403&r2=1099404&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Wed May  4 10:49:08 2011
@@ -726,6 +726,8 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
 
   switch (status)
     {
+      /* ### Move this check into svn_wc__db_op_delete so that we
+             check the whole tree? */
       case svn_wc__db_status_absent:
       case svn_wc__db_status_excluded:
       case svn_wc__db_status_not_present:
@@ -738,71 +740,12 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
         break;
     }
 
-#ifdef SVN_NEW_DELETE
   SVN_ERR(svn_wc__db_op_delete(db, local_abspath, pool));
 
   if (notify_func)
     SVN_ERR(svn_wc__db_delete_list_notify(notify_func, notify_baton,
                                           db, local_abspath, pool));
   /* ### else: Delete the list */
-#else
-  if (kind == svn_wc__db_kind_dir)
-    {
-      /* ### NODE_DATA We recurse into the subtree here, which is fine,
-         except that we also need to record the op_depth to pass to
-         svn_wc__db_temp_op_delete(), which is determined by the original
-         path for which svn_wc_delete4() was called. We need a helper
-         function which receives the op_depth as an argument to apply to
-         the entire subtree.
-       */
-      apr_pool_t *iterpool = svn_pool_create(pool);
-      const apr_array_header_t *children;
-      int i;
-
-      SVN_ERR(svn_wc__db_read_children(&children, db, local_abspath,
-                                       pool, pool));
-
-      for (i = 0; i < children->nelts; i++)
-        {
-          const char *child_basename = APR_ARRAY_IDX(children, i, const char 
*);
-          const char *child_abspath;
-          svn_boolean_t hidden;
-
-          svn_pool_clear(iterpool);
-
-          child_abspath = svn_dirent_join(local_abspath, child_basename,
-                                          iterpool);
-          SVN_ERR(svn_wc__db_node_hidden(&hidden, db, child_abspath, 
iterpool));
-          if (hidden)
-            continue;
-
-          SVN_ERR(svn_wc_delete4(wc_ctx, child_abspath,
-                                 keep_local, delete_unversioned_target,
-                                 cancel_func, cancel_baton,
-                                 notify_func, notify_baton,
-                                 iterpool));
-        }
-
-      svn_pool_destroy(iterpool);
-    }
-
-  /* ### Maybe we should disallow deleting switched nodes here? */
-
-    {
-      /* ### The following two operations should be inside one SqLite
-             transaction. For even better behavior the tree operation
-             before this block needs the same handling.
-             Luckily most of this is for free once properties and pristine
-             are handled in the WC-NG way. */
-      SVN_ERR(svn_wc__db_temp_op_delete(wc_ctx->db, local_abspath, pool));
-    }
-
-  /* Report the deletion to the caller. */
-  if (notify_func != NULL)
-    (*notify_func)(notify_baton,
-                   svn_wc_create_notify(local_abspath, svn_wc_notify_delete,
-                                        pool), pool);
-#endif
 
   /* By the time we get here, anything that was scheduled to be added has
      become unversioned */

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1099404&r1=1099403&r2=1099404&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed May  4 10:49:08 
2011
@@ -2047,7 +2047,7 @@ add_directory(const char *path,
      ### we record a delete instead, which will allow resolving the conflict
      ### to theirs with 'svn revert'. */
   if (db->shadowed && db->obstruction_found)
-    SVN_ERR(svn_wc__db_temp_op_delete(eb->db, db->local_abspath, pool));
+    SVN_ERR(svn_wc__db_op_delete(eb->db, db->local_abspath, pool));
 
   /* If this add was obstructed by dir scheduled for addition without
      history let close_file() handle the notification because there
@@ -3954,7 +3954,7 @@ close_file(void *file_baton,
      ### we record a delete instead, which will allow resolving the conflict
      ### to theirs with 'svn revert'. */
   if (fb->shadowed && fb->obstruction_found)
-    SVN_ERR(svn_wc__db_temp_op_delete(eb->db, fb->local_abspath, pool));
+    SVN_ERR(svn_wc__db_op_delete(eb->db, fb->local_abspath, pool));
 
     /* ### ugh. deal with preserving the file external value in the database.
        ### there is no official API, so we do it this way. maybe we should

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1099404&r1=1099403&r2=1099404&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Wed May  4 10:49:08 
2011
@@ -521,11 +521,6 @@ WHERE wc_id = ?1 AND (local_relpath = ?2
                                            OR local_relpath LIKE ?3 ESCAPE '#')
                                       AND kind = 'file'))
 
--- STMT_DELETE_CHILD_NODES_RECURSIVE
-DELETE FROM nodes
-WHERE wc_id = ?1 AND local_relpath LIKE ?2 ESCAPE '#' AND op_depth = ?3
-  AND presence = ?4
-
 -- STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST
 UPDATE actual_node
 SET properties = NULL,
@@ -567,20 +562,6 @@ SET properties = NULL,
     right_checksum = NULL
 WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
 
--- STMT_CLEAR_ACTUAL_NODE_LEAVING_CONFLICT
-UPDATE actual_node
-SET properties = NULL,
-    text_mod = NULL,
-    changelist = NULL,
-    conflict_old = NULL,
-    conflict_new = NULL,
-    conflict_working = NULL,
-    prop_reject = NULL,
-    older_checksum = NULL,
-    left_checksum = NULL,
-    right_checksum = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2
-
 -- STMT_UPDATE_NODE_BASE_DEPTH
 UPDATE nodes SET depth = ?3
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
@@ -605,11 +586,6 @@ WHERE wc_id = ?1 AND local_relpath = ?2 
 UPDATE nodes SET presence = ?3
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
 
--- STMT_UPDATE_NODE_WORKING_PRESENCE
-UPDATE nodes SET presence = ?4
-WHERE wc_id = ?1 AND local_relpath = ?2
-  AND op_depth = ?3
-
 -- STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH
 UPDATE nodes SET presence = ?3, revision = ?4, repos_path = ?5
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
@@ -740,19 +716,6 @@ SELECT wc_id, local_relpath, ?3 /*op_dep
 FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
 
--- STMT_INSERT_WORKING_NODE_FROM_NODE
-INSERT OR REPLACE INTO nodes (
-    wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
-    changed_revision, changed_date, changed_author, depth, symlink_target,
-    translated_size, last_mod_time, properties)
-SELECT wc_id, local_relpath, ?3 /*op_depth*/, parent_relpath, ?4 /*presence*/,
-       kind, checksum, changed_revision, changed_date, changed_author, depth,
-       symlink_target, translated_size, last_mod_time, properties
-FROM nodes
-WHERE wc_id = ?1 AND local_relpath = ?2
-ORDER BY op_depth DESC
-LIMIT 1
-
 -- STMT_INSERT_WORKING_NODE_FROM_NODE_RECURSIVE
 INSERT INTO nodes (
     wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
@@ -800,10 +763,6 @@ WHERE wc_id = ?1 AND local_relpath = ?2
   AND op_depth = (SELECT MAX(op_depth) FROM nodes
                   WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0)
 
--- STMT_UPDATE_OP_DEPTH_REDUCE_RECURSIVE
-UPDATE nodes SET op_depth = ?3 - 1
-WHERE wc_id = ?1 AND local_relpath LIKE ?2 ESCAPE '#' AND op_depth = ?3
-
 -- STMT_UPDATE_OP_DEPTH_INCREASE_RECURSIVE
 UPDATE nodes SET op_depth = ?3 + 1
 WHERE wc_id = ?1 AND local_relpath LIKE ?2 ESCAPE '#' AND op_depth = ?3
@@ -812,15 +771,6 @@ WHERE wc_id = ?1 AND local_relpath LIKE 
 UPDATE nodes SET op_depth = ?4
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
 
--- STMT_UPDATE_WORKING_TO_DELETED
-UPDATE nodes SET
-  repos_id = NULL, repos_path = NULL, revision = NULL,
-  moved_here = NULL, depth = NULL, properties = NULL,
-  symlink_target = NULL, checksum = NULL,
-  changed_revision = NULL, changed_date = NULL, changed_author = NULL,
-  translated_size = NULL, last_mod_time = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
-
 -- STMT_DETERMINE_WHICH_TREES_EXIST
 SELECT op_depth FROM nodes WHERE wc_id = ?1 AND local_relpath = ?2
 ORDER BY op_depth
@@ -886,18 +836,6 @@ WHERE wc_id = ?1 AND local_relpath = ?2 
 UPDATE nodes SET repos_id = ?3, repos_path = ?4
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
 
--- STMT_SELECT_NODES_GE_OP_DEPTH_RECURSIVE
-SELECT 1
-FROM nodes
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
-  AND op_depth >= ?4
-
--- STMT_SELECT_ACTUAL_NODE_RECURSIVE
-SELECT 1
-FROM actual_node
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
-  AND tree_conflict_data IS NULL
-
 -- STMT_SELECT_ACTUAL_CHILDREN
 SELECT 1 FROM actual_node WHERE wc_id = ?1 AND parent_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=1099404&r1=1099403&r2=1099404&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed May  4 10:49:08 2011
@@ -4567,37 +4567,6 @@ svn_wc__db_temp_op_set_dir_depth(svn_wc_
 }
 
 
-/* Delete child sub-trees of LOCAL_RELPATH that are presence=not-present
-   and at the same op_depth.
-
-   ### Do we need to handle incomplete here? */
-static svn_error_t *
-remove_children(svn_wc__db_wcroot_t *wcroot,
-                const char *local_relpath,
-                svn_wc__db_status_t status,
-                apr_int64_t op_depth,
-                apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_DELETE_CHILD_NODES_RECURSIVE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isit", wcroot->wc_id,
-                            construct_like_arg(local_relpath,
-                                               scratch_pool),
-                            op_depth, presence_map, status));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-
-  return SVN_NO_ERROR;
-}
-
-
-/* ### Forward declarations to avoid function movement churn.  */
-static svn_error_t *
-db_working_actual_remove(svn_wc__db_wcroot_t *wcroot,
-                         const char *local_relpath,
-                         apr_pool_t *scratch_pool);
-
 static svn_error_t *
 info_below_working(svn_boolean_t *have_base,
                    svn_boolean_t *have_work,
@@ -4608,242 +4577,6 @@ info_below_working(svn_boolean_t *have_b
                    apr_pool_t *scratch_pool);
 
 
-/* Update the working node for LOCAL_ABSPATH setting presence=STATUS */
-static svn_error_t *
-db_working_update_presence(apr_int64_t op_depth,
-                           svn_wc__db_status_t status,
-                           svn_wc__db_wcroot_t *wcroot,
-                           const char *local_relpath,
-                           apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_UPDATE_NODE_WORKING_PRESENCE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isit", wcroot->wc_id, local_relpath,
-                            op_depth, presence_map, status));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-
-  if (status == svn_wc__db_status_base_deleted)
-    {
-      /* Switching to base-deleted is undoing an add/copy.  By this
-         stage an add will have no children. */
-      const apr_array_header_t *children;
-      apr_pool_t *iterpool;
-      int i;
-
-      /* Children of the copy will be marked deleted in the layer
-         above. */
-      SVN_ERR(remove_children(wcroot, local_relpath,
-                              svn_wc__db_status_base_deleted, op_depth + 1,
-                              scratch_pool));
-
-      /* Children of the copy that overlay a lower level become
-         base_deleted, otherwise they get removed. */
-      SVN_ERR(gather_repo_children(&children, wcroot, local_relpath,
-                                   op_depth, scratch_pool, scratch_pool));
-      iterpool = svn_pool_create(scratch_pool);
-      for (i = 0; i < children->nelts; ++i)
-        {
-          const char *name = APR_ARRAY_IDX(children, i, const char *);
-          const char *child_relpath;
-          svn_boolean_t below_base;
-          svn_boolean_t below_work;
-          svn_wc__db_status_t below_status;
-
-          svn_pool_clear(iterpool);
-
-          child_relpath = svn_relpath_join(local_relpath, name, iterpool);
-          SVN_ERR(info_below_working(&below_base, &below_work, &below_status,
-                                     wcroot, child_relpath, op_depth,
-                                     iterpool));
-          if ((below_base || below_work)
-              && (below_status == svn_wc__db_status_normal
-                  || below_status == svn_wc__db_status_added
-                  || below_status == svn_wc__db_status_incomplete))
-            SVN_ERR(db_working_update_presence(op_depth,
-                                               svn_wc__db_status_base_deleted,
-                                               wcroot, child_relpath,
-                                               iterpool));
-          else
-            SVN_ERR(db_working_actual_remove(wcroot, child_relpath, iterpool));
-        }
-      svn_pool_destroy(iterpool);
-
-      /* Reset information that does not apply to deleted */
-      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                        STMT_UPDATE_WORKING_TO_DELETED));
-      SVN_ERR(svn_sqlite__bindf(stmt, "isi", wcroot->wc_id, local_relpath,
-                                op_depth));
-      SVN_ERR(svn_sqlite__step_done(stmt));
-    }
-  else
-    SVN_ERR_MALFUNCTION();
-
-  return SVN_NO_ERROR;
-}
-
-
-/* Delete working and actual nodes for LOCAL_ABSPATH.  When called any
-   remaining working child sub-trees should be presence=not-present
-   and will be deleted. */
-static svn_error_t *
-db_working_actual_remove(svn_wc__db_wcroot_t *wcroot,
-                         const char *local_relpath,
-                         apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-  apr_int64_t op_depth;
-
-  /* Precondition: There is a working row in NODES.
-
-     Record its op_depth, which is needed for postcondition checking. */
-  {
-    svn_boolean_t have_row;
-
-    SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                      STMT_SELECT_WORKING_NODE));
-    SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-    SVN_ERR(svn_sqlite__step(&have_row, stmt));
-    SVN_ERR_ASSERT(have_row);
-    op_depth = svn_sqlite__column_int64(stmt, 0);
-    SVN_ERR(svn_sqlite__reset(stmt));
-  }
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_DELETE_WORKING_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_CLEAR_ACTUAL_NODE_LEAVING_CONFLICT));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_DELETE_ACTUAL_NODE_WITHOUT_CONFLICT));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-
-  SVN_ERR(remove_children(wcroot, local_relpath,
-                          svn_wc__db_status_base_deleted,
-                          op_depth + 1, scratch_pool));
-  SVN_ERR(remove_children(wcroot, local_relpath, svn_wc__db_status_normal,
-                          op_depth, scratch_pool));
-  SVN_ERR(remove_children(wcroot, local_relpath, svn_wc__db_status_not_present,
-                          op_depth, scratch_pool));
-  SVN_ERR(remove_children(wcroot, local_relpath, svn_wc__db_status_incomplete,
-                          op_depth, scratch_pool));
-
-#ifdef SVN_DEBUG
-  /* Postcondition: There are no NODES rows in this subtree, at same or
-     greater op_depth. */
-  {
-    svn_boolean_t have_row;
-
-    SVN_ERR(svn_sqlite__get_statement(
-              &stmt, wcroot->sdb,
-              STMT_SELECT_NODES_GE_OP_DEPTH_RECURSIVE));
-    SVN_ERR(svn_sqlite__bindf(stmt, "issi", wcroot->wc_id, local_relpath,
-                              construct_like_arg(local_relpath, scratch_pool),
-                              op_depth));
-    SVN_ERR(svn_sqlite__step(&have_row, stmt));
-    SVN_ERR_ASSERT(! have_row);
-    SVN_ERR(svn_sqlite__reset(stmt));
-  }
-
-  /* Postcondition: There are no ACTUAL_NODE rows in this subtree, save
-     those with conflict information. */
-  {
-    svn_boolean_t have_row;
-
-    SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                      STMT_SELECT_ACTUAL_NODE_RECURSIVE));
-    SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, local_relpath,
-                              construct_like_arg(local_relpath,
-                                                 scratch_pool)));
-    SVN_ERR(svn_sqlite__step(&have_row, stmt));
-    SVN_ERR_ASSERT(! have_row);
-    SVN_ERR(svn_sqlite__reset(stmt));
-  }
-#endif
-
-  return SVN_NO_ERROR;
-}
-
-
-/* Insert a working node for LOCAL_ABSPATH with presence=STATUS. */
-static svn_error_t *
-db_working_insert(svn_wc__db_status_t status,
-                  svn_wc__db_wcroot_t *wcroot,
-                  const char *local_relpath,
-                  apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-  const char *like_arg = construct_like_arg(local_relpath, scratch_pool);
-  apr_int64_t op_depth = relpath_depth(local_relpath);
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_INSERT_WORKING_NODE_FROM_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isit", wcroot->wc_id,
-                            local_relpath, op_depth, presence_map, status));
-  SVN_ERR(svn_sqlite__insert(NULL, stmt));
-
-  if (status == svn_wc__db_status_base_deleted)
-    {
-      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                        STMT_UPDATE_WORKING_TO_DELETED));
-      SVN_ERR(svn_sqlite__bindf(stmt, "isi", wcroot->wc_id, local_relpath,
-                                op_depth));
-      SVN_ERR(svn_sqlite__update(NULL, stmt));
-
-      /* Need to update the op_depth of all deleted child trees -- this
-         relies on the recursion having already deleted the trees so
-         that they are all at op_depth+1.
-    
-         ### Rewriting the op_depth means that the number of queries is
-         ### O(depth^2).  Fix it by implementing svn_wc__db_op_delete so
-         ### that the recursion gets moved from adm_ops.c to wc_db.c and
-         ### one transaction does the whole tree and thus each op_depth
-         ### only gets written once. */
-      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                        
STMT_UPDATE_OP_DEPTH_REDUCE_RECURSIVE));
-      SVN_ERR(svn_sqlite__bindf(stmt, "isi",
-                                wcroot->wc_id, like_arg, op_depth + 1));
-      SVN_ERR(svn_sqlite__update(NULL, stmt));
-    }
-  else
-    SVN_ERR_MALFUNCTION();
-
-  return SVN_NO_ERROR;
-}
-
-
-/* Set *ROOT_OF_COPY to TRUE if LOCAL_ABSPATH is an add or the root of
-   a copy, to FALSE otherwise. */
-static svn_error_t*
-is_add_or_root_of_copy(svn_boolean_t *add_or_root_of_copy,
-                       svn_wc__db_wcroot_t *wcroot,
-                       const char *local_relpath,
-                       apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-  apr_int64_t op_depth;
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_SELECT_WORKING_NODE));
-
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-  SVN_ERR(svn_sqlite__step_row(stmt));
-
-  op_depth = svn_sqlite__column_int64(stmt, 0);
-
-  *add_or_root_of_copy = (op_depth == relpath_depth(local_relpath));
-
-  return svn_error_return(svn_sqlite__reset(stmt));
-}
-
-
 /* Convert STATUS, the raw status obtained from the presence map, to
    the status appropriate for a working (op_depth > 0) node and return
    it in *WORKING_STATUS. */
@@ -4950,143 +4683,6 @@ info_below_working(svn_boolean_t *have_b
 }
 
 
-struct temp_op_delete_baton_t {
-  /* The following two are only needed for svn_wc__db_temp_forget_directory */
-  svn_wc__db_t *db;
-  const char *local_abspath;
-};
-
-
-/* Deletes LOCAL_RELPATH using WCROOT. */
-static svn_error_t *
-temp_op_delete_txn(void *baton,
-                   svn_wc__db_wcroot_t *wcroot,
-                   const char *local_relpath,
-                   apr_pool_t *scratch_pool)
-{
-  struct temp_op_delete_baton_t *b = baton;
-  svn_wc__db_status_t status;
-  svn_wc__db_status_t new_working_status;
-  svn_boolean_t have_work;
-  svn_boolean_t add_work = FALSE;
-  svn_boolean_t del_work = FALSE;
-  svn_boolean_t mod_work = FALSE;
-
-  SVN_ERR(read_info(&status,
-                    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                    NULL, NULL, NULL,
-                    NULL, NULL, &have_work,
-                    wcroot, local_relpath,
-                    scratch_pool, scratch_pool));
-
-  if (!have_work)
-    {
-      /* No structural changes  */
-      if (status == svn_wc__db_status_normal
-          || status == svn_wc__db_status_incomplete)
-        {
-          add_work = TRUE;
-        }
-    }
-  else if (status == svn_wc__db_status_added)
-    {
-      /* ADD/COPY-HERE/MOVE-HERE that could be a replace */
-      svn_boolean_t add_or_root_of_copy;
-
-      SVN_ERR(is_add_or_root_of_copy(&add_or_root_of_copy, wcroot,
-                                     local_relpath, scratch_pool));
-      if (add_or_root_of_copy)
-        {
-          svn_boolean_t below_base;
-          svn_boolean_t below_work;
-          svn_wc__db_status_t below_status;
-
-          SVN_ERR(info_below_working(&below_base, &below_work, &below_status,
-                                     wcroot, local_relpath, -1, scratch_pool));
-
-          if ((below_base || below_work)
-              && below_status != svn_wc__db_status_not_present
-              && below_status != svn_wc__db_status_deleted)
-            mod_work = TRUE;
-          else
-            del_work = TRUE;
-        }
-      else
-        {
-          add_work = TRUE;
-        }
-    }
-  else if (status == svn_wc__db_status_incomplete)
-    {
-      svn_boolean_t add_or_root_of_copy;
-      SVN_ERR(is_add_or_root_of_copy(&add_or_root_of_copy, wcroot,
-                                     local_relpath, scratch_pool));
-      if (add_or_root_of_copy)
-        del_work = TRUE;
-      else
-        add_work = TRUE;
-    }
-
-  if (del_work)
-    {
-      SVN_ERR(db_working_actual_remove(wcroot, local_relpath,
-                                       scratch_pool));
-
-      /* This is needed for access batons? */
-      SVN_ERR(svn_wc__db_temp_forget_directory(b->db, b->local_abspath,
-                                               scratch_pool));
-    }
-  else if (add_work)
-    {
-      new_working_status = svn_wc__db_status_base_deleted;
-      SVN_ERR(db_working_insert(new_working_status, wcroot,
-                                local_relpath, scratch_pool));
-    }
-  else if (mod_work)
-    {
-      new_working_status = svn_wc__db_status_base_deleted;
-      SVN_ERR(db_working_update_presence(relpath_depth(local_relpath),
-                                         new_working_status, wcroot,
-                                         local_relpath, scratch_pool));
-    }
-  else
-    {
-      /* Already deleted, or absent or excluded. */
-      /* ### Nothing to do, return an error?  Which one? */
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_wc__db_temp_op_delete(svn_wc__db_t *db,
-                          const char *local_abspath,
-                          apr_pool_t *scratch_pool)
-{
-  svn_wc__db_wcroot_t *wcroot;
-  const char *local_relpath;
-  struct temp_op_delete_baton_t b;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-
-  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                              db, local_abspath, scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(wcroot);
-
-  /* These two for svn_wc__db_temp_forget_directory */
-  b.db = db;
-  b.local_abspath = local_abspath;
-
-  SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, temp_op_delete_txn, &b,
-                              scratch_pool));
-
-  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
 struct op_delete_baton_t {
   apr_int64_t delete_depth;  /* op-depth for root of delete */
 };

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1099404&r1=1099403&r2=1099404&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Wed May  4 10:49:08 2011
@@ -2535,14 +2535,6 @@ svn_wc__db_temp_op_set_dir_depth(svn_wc_
                                  svn_depth_t depth,
                                  apr_pool_t *scratch_pool);
 
-/* Performs a non-recursive delete on local_abspath, just like a
-   schedule delete on a local_abspath entry would have been performed
-   before. */
-svn_error_t *
-svn_wc__db_temp_op_delete(svn_wc__db_t *db,
-                          const char *local_abspath,
-                          apr_pool_t *scratch_pool);
-
 /* ### temp function. return the FORMAT for the directory LOCAL_ABSPATH.  */
 svn_error_t *
 svn_wc__db_temp_get_format(int *format,


Reply via email to