Author: rhuijben
Date: Thu Sep  7 11:10:46 2017
New Revision: 1807589

URL: http://svn.apache.org/viewvc?rev=1807589&view=rev
Log:
Following up on r1807584 remove more dead code, which should fix the build
breakage caused by that previous patch.

* subversion/libsvn_wc/upgrade.c
  (read_tree_conflicts,
   migrate_single_tree_conflict_data,
   migrate_tree_conflict_data): Remove functions.

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

Modified: subversion/trunk/subversion/libsvn_wc/upgrade.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upgrade.c?rev=1807589&r1=1807588&r2=1807589&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_wc/upgrade.c Thu Sep  7 11:10:46 2017
@@ -653,178 +653,6 @@ ensure_repos_info(svn_wc_entry_t *entry,
 }
 
 
-/*
- * Read tree conflict descriptions from @a conflict_data.  Set @a *conflicts
- * to a hash of pointers to svn_wc_conflict_description2_t objects indexed by
- * svn_wc_conflict_description2_t.local_abspath, all newly allocated in @a
- * pool.  @a dir_path is the path to the working copy directory whose conflicts
- * are being read.  The conflicts read are the tree conflicts on the immediate
- * child nodes of @a dir_path.  Do all allocations in @a pool.
- *
- * Note: There were some concerns about this function:
- *
- * ### this is BAD. the CONFLICTS structure should not be dependent upon
- * ### DIR_PATH. each conflict should be labeled with an entry name, not
- * ### a whole path. (and a path which happens to vary based upon invocation
- * ### of the user client and these APIs)
- *
- * those assumptions were baked into former versions of the data model, so
- * they have to stick around here.  But they have been removed from the
- * New Way. */
-static svn_error_t *
-read_tree_conflicts(apr_hash_t **conflicts,
-                    const char *conflict_data,
-                    const char *dir_path,
-                    apr_pool_t *pool)
-{
-  const svn_skel_t *skel;
-  apr_pool_t *iterpool;
-
-  *conflicts = apr_hash_make(pool);
-
-  if (conflict_data == NULL)
-    return SVN_NO_ERROR;
-
-  skel = svn_skel__parse(conflict_data, strlen(conflict_data), pool);
-  if (skel == NULL)
-    return svn_error_create(SVN_ERR_WC_CORRUPT, NULL,
-                            _("Error parsing tree conflict skel"));
-
-  iterpool = svn_pool_create(pool);
-  for (skel = skel->children; skel != NULL; skel = skel->next)
-    {
-      const svn_wc_conflict_description2_t *conflict;
-
-      svn_pool_clear(iterpool);
-      SVN_ERR(svn_wc__deserialize_conflict(&conflict, skel, dir_path,
-                                           pool, iterpool));
-      if (conflict != NULL)
-        svn_hash_sets(*conflicts,
-                      svn_dirent_basename(conflict->local_abspath, pool),
-                      conflict);
-    }
-  svn_pool_destroy(iterpool);
-
-  return SVN_NO_ERROR;
-}
-
-/* */
-static svn_error_t *
-migrate_single_tree_conflict_data(svn_sqlite__db_t *sdb,
-                                  const char *tree_conflict_data,
-                                  apr_int64_t wc_id,
-                                  const char *local_relpath,
-                                  apr_pool_t *scratch_pool)
-{
-  apr_hash_t *conflicts;
-  apr_hash_index_t *hi;
-  apr_pool_t *iterpool;
-
-  SVN_ERR(read_tree_conflicts(&conflicts, tree_conflict_data, local_relpath,
-                              scratch_pool));
-
-  iterpool = svn_pool_create(scratch_pool);
-  for (hi = apr_hash_first(scratch_pool, conflicts);
-       hi;
-       hi = apr_hash_next(hi))
-    {
-      const svn_wc_conflict_description2_t *conflict = apr_hash_this_val(hi);
-      const char *conflict_relpath;
-      const char *conflict_data;
-      svn_sqlite__stmt_t *stmt;
-      svn_boolean_t have_row;
-      svn_skel_t *skel;
-
-      svn_pool_clear(iterpool);
-
-      conflict_relpath = svn_dirent_join(local_relpath,
-                                         svn_dirent_basename(
-                                           conflict->local_abspath, iterpool),
-                                         iterpool);
-
-      SVN_ERR(svn_wc__serialize_conflict(&skel, conflict, iterpool, iterpool));
-      conflict_data = svn_skel__unparse(skel, iterpool)->data;
-
-      /* See if we need to update or insert an ACTUAL node. */
-      SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_ACTUAL_NODE));
-      SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, conflict_relpath));
-      SVN_ERR(svn_sqlite__step(&have_row, stmt));
-      SVN_ERR(svn_sqlite__reset(stmt));
-
-      if (have_row)
-        {
-          /* There is an existing ACTUAL row, so just update it. */
-          SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
-                                            STMT_UPDATE_ACTUAL_CONFLICT));
-        }
-      else
-        {
-          /* We need to insert an ACTUAL row with the tree conflict data. */
-          SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
-                                            STMT_INSERT_ACTUAL_CONFLICT));
-        }
-
-      SVN_ERR(svn_sqlite__bindf(stmt, "iss", wc_id, conflict_relpath,
-                                conflict_data));
-      if (!have_row)
-        SVN_ERR(svn_sqlite__bind_text(stmt, 4, local_relpath));
-
-      SVN_ERR(svn_sqlite__step_done(stmt));
-    }
-
-  svn_pool_destroy(iterpool);
-
-  return SVN_NO_ERROR;
-}
-
-
-/* */
-static svn_error_t *
-migrate_tree_conflict_data(svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-  svn_boolean_t have_row;
-  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-
-  /* Iterate over each node which has a set of tree conflicts, then insert
-     all of them into the new schema.  */
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
-                                    STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT));
-
-  /* Get all the existing tree conflict data. */
-  SVN_ERR(svn_sqlite__step(&have_row, stmt));
-  while (have_row)
-    {
-      apr_int64_t wc_id;
-      const char *local_relpath;
-      const char *tree_conflict_data;
-
-      svn_pool_clear(iterpool);
-
-      wc_id = svn_sqlite__column_int64(stmt, 0);
-      local_relpath = svn_sqlite__column_text(stmt, 1, iterpool);
-      tree_conflict_data = svn_sqlite__column_text(stmt, 2, iterpool);
-
-      SVN_ERR(migrate_single_tree_conflict_data(sdb, tree_conflict_data,
-                                                wc_id, local_relpath,
-                                                iterpool));
-
-      /* We don't need to do anything but step over the previously
-         prepared statement. */
-      SVN_ERR(svn_sqlite__step(&have_row, stmt));
-    }
-  SVN_ERR(svn_sqlite__reset(stmt));
-
-  /* Erase all the old tree conflict data.  */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
-                                    STMT_UPGRADE_21_ERASE_OLD_CONFLICTS));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-
-  svn_pool_destroy(iterpool);
-  return SVN_NO_ERROR;
-}
-
 /* ### need much more docco
 
    ### this function should be called within a sqlite transaction. it makes


Reply via email to