subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r959128 - /subversion/trunk/subversion/libsvn_wc/entries.c
Date Tue, 29 Jun 2010 22:22:15 GMT
Author: rhuijben
Date: Tue Jun 29 22:22:14 2010
New Revision: 959128

URL: http://svn.apache.org/viewvc?rev=959128&view=rev
Log:
Following up on r959123, remove more unused entry write code.

* subversion/libsvn_wc/entries.c
  (write_one_entry_baton): Remove struct.
  (write_one_entry_cb, write_one_entry): Remove functions.

Modified:
    subversion/trunk/subversion/libsvn_wc/entries.c

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=959128&r1=959127&r2=959128&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Tue Jun 29 22:22:14 2010
@@ -2392,193 +2392,6 @@ svn_wc__write_upgraded_entries(svn_wc__d
                                    scratch_pool));
 }
 
-struct write_one_entry_baton
-{
-  svn_wc__db_t *db;
-  const char *local_abspath;
-  const svn_wc_entry_t *this_dir;
-  const svn_wc_entry_t *this_entry;
-};
-
-/* Rewrites a single entry inside a sqlite transaction
-   Implements svn_sqlite__transaction_callback_t. */
-static svn_error_t *
-write_one_entry_cb(void *baton,
-                   svn_sqlite__db_t *sdb,
-                   apr_pool_t *scratch_pool)
-{
-  struct write_one_entry_baton *woeb = baton;
-  svn_wc__db_t *db = woeb->db;
-  const char *local_abspath = woeb->local_abspath;
-  const svn_wc_entry_t *this_dir = woeb->this_dir;
-  const svn_wc_entry_t *this_entry = woeb->this_entry;
-  const char *this_abspath = svn_dirent_join(local_abspath, this_entry->name,
-                                             scratch_pool);
-  const void *base_props = NULL;
-  const void *working_props = NULL;
-  const void *actual_props = NULL;
-  apr_size_t base_prop_len;
-  apr_size_t working_prop_len;
-  apr_size_t actual_prop_len;
-  apr_hash_t *dav_cache;
-  const svn_checksum_t *base_checksum;
-  svn_sqlite__stmt_t *stmt;
-  const char *repos_root;
-  apr_int64_t repos_id;
-  apr_int64_t wc_id;
-  svn_error_t *err;
-  svn_boolean_t got_row;
-
-  SVN_ERR_ASSERT(this_dir && this_entry);
-
-  /* Get the repos ID. */
-  if (this_dir->uuid != NULL)
-    {
-      /* ### does this need to be done on a per-entry basis instead of
-         ### the per-directory way we do it now?  me thinks yes...
-         ###
-         ### when do we harvest repository entries which no longer have
-         ### any members?  */
-      SVN_ERR(svn_wc__db_repos_ensure(&repos_id, db, local_abspath,
-                                      this_dir->repos, this_dir->uuid,
-                                      scratch_pool));
-      repos_root = this_dir->repos;
-    }
-  else
-    {
-      repos_id = 0;
-      repos_root = NULL;
-    }
-
-  SVN_ERR(fetch_wc_id(&wc_id, sdb));
-
-  /* Before we nuke all the nodes, we need to get a few values */
-
-  /* The dav cache is not in STMT_SELECT_BASE_NODE */
-  err = svn_wc__db_base_get_dav_cache(&dav_cache, db, this_abspath,
-                                      scratch_pool, scratch_pool);
-  if (err)
-    {
-      if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
-        return svn_error_return(err);
-      svn_error_clear(err); /* No BASE record */
-      dav_cache = NULL;
-    }
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_BASE_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, this_entry->name));
-  SVN_ERR(svn_sqlite__step(&got_row, stmt));
-  if (got_row)
-    {
-      base_props = svn_sqlite__column_blob(stmt, 13, &base_prop_len,
-                                           scratch_pool);
-
-      err = svn_sqlite__column_checksum(&base_checksum, stmt, 5, scratch_pool);
-      /* ### SVN_EXPERIMENTAL_PRISTINE:
-         base_checksum is originally MD-5 but will later be SHA-1.  The
-         base_checksum is not yet handled by this function. */
-
-      SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
-    }
-  else
-    SVN_ERR(svn_sqlite__reset(stmt));
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_WORKING_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, this_entry->name));
-  SVN_ERR(svn_sqlite__step(&got_row, stmt));
-  if (got_row)
-    {
-      /* No need to store the working checksum, that is stored in the entry */
-      working_props = svn_sqlite__column_blob(stmt, 15, &working_prop_len,
-                                              scratch_pool);
-    }
-  SVN_ERR(svn_sqlite__reset(stmt));
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_ACTUAL_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, this_entry->name));
-  SVN_ERR(svn_sqlite__step(&got_row, stmt));
-  if (got_row)
-    {
-      actual_props = svn_sqlite__column_blob(stmt, 6, &actual_prop_len,
-                                             scratch_pool);
-    }
-  SVN_ERR(svn_sqlite__reset(stmt));
-
-  /* Remove the WORKING, BASE and ACTUAL nodes for this entry */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_DELETE_WORKING_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, this_entry->name));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_DELETE_BASE_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, this_entry->name));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_DELETE_ACTUAL_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, this_entry->name));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-
-  SVN_ERR(write_entry(db, sdb, wc_id, repos_id, repos_root, this_entry,
-                      this_entry->name, this_abspath, this_dir,
-                      actual_props != NULL, FALSE, scratch_pool));
-
-  if (dav_cache)
-    SVN_ERR(svn_wc__db_base_set_dav_cache(db, this_abspath, dav_cache,
-                                          scratch_pool));
-
-  if (base_props)
-    {
-      SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_UPDATE_BASE_PROPS));
-      SVN_ERR(svn_sqlite__bindf(stmt, "isb", wc_id, this_entry->name,
-                                base_props, base_prop_len));
-      SVN_ERR(svn_sqlite__step_done(stmt));
-    }
-
-  if (working_props)
-    {
-      SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
-                                        STMT_UPDATE_WORKING_PROPS));
-      SVN_ERR(svn_sqlite__bindf(stmt, "isb", wc_id, this_entry->name,
-                                working_props, working_prop_len));
-      SVN_ERR(svn_sqlite__step_done(stmt));
-    }
-
-  if (actual_props)
-    {
-      SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
-                                        STMT_UPDATE_ACTUAL_PROPS));
-      SVN_ERR(svn_sqlite__bindf(stmt, "isb", wc_id, this_entry->name,
-                                actual_props, actual_prop_len));
-      SVN_ERR(svn_sqlite__step_done(stmt));
-    }
-
-  /* TODO: Update base checksum if needed */
-  return SVN_NO_ERROR;
-}
-
-/* */
-static svn_error_t *
-write_one_entry(svn_wc__db_t *db,
-                const char *local_abspath,
-                const svn_wc_entry_t *this_dir,
-                const svn_wc_entry_t *this_entry,
-                apr_pool_t *scratch_pool)
-{
-  struct write_one_entry_baton woeb;
-  svn_sqlite__db_t *sdb;
-
-  /* ### need the SDB so we can jam rows directly into it.  */
-  SVN_ERR(svn_wc__db_temp_borrow_sdb(&sdb, db, local_abspath,
-                                     svn_wc__db_openmode_readwrite,
-                                     scratch_pool));
-  woeb.db = db;
-  woeb.local_abspath = local_abspath;
-  woeb.this_dir = this_dir;
-  woeb.this_entry = this_entry;
-
-  /* Run this operation in a transaction to speed up SQLite.
-     See http://www.sqlite.org/faq.html#q19 for more details */
-  return svn_error_return(
-      svn_sqlite__with_transaction(sdb, write_one_entry_cb, &woeb,
-                                   scratch_pool));
-}
 
 svn_wc_entry_t *
 svn_wc_entry_dup(const svn_wc_entry_t *entry, apr_pool_t *pool)



Mime
View raw message