You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/05/31 13:41:28 UTC

svn commit: r1129634 - in /subversion/trunk/subversion/libsvn_wc: wc_db.c wc_db.h workqueue.c

Author: rhuijben
Date: Tue May 31 11:41:28 2011
New Revision: 1129634

URL: http://svn.apache.org/viewvc?rev=1129634&view=rev
Log:
Following up on the enabling of the EXTERALS store, remove some old code that
is no longer needed.

* subversion/libsvn_wc/wc_db.c
  (create_db): Always add the EXTERNALS table.
  (insert_external_node): Remove fallback code. Install value 1 as external
    value instead of a literal "1".
  (svn_wc__db_external_read,
   svn_wc__db_externals_defined_below): Remove fallback code.
  (svn_wc__db_read_node_install_info): Remove specialization of file externals.
  (svn_wc__db_upgrade_apply_props): Remove disabling for format 28.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_read_node_install_info): Remove unneeded argument.

* subversion/libsvn_wc/workqueue.c
  (run_file_install): Update caller.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h
    subversion/trunk/subversion/libsvn_wc/workqueue.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1129634&r1=1129633&r2=1129634&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue May 31 11:41:28 2011
@@ -1379,9 +1379,7 @@ create_db(svn_sqlite__db_t **sdb,
   SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_SCHEMA));
   SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_NODES));
   SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_NODES_TRIGGERS));
-#if SVN_WC__VERSION >= SVN_WC__HAS_EXTERNALS_STORE
   SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_EXTERNALS));
-#endif
 
   /* Insert the repository. */
   SVN_ERR(create_repos_id(repos_id, repos_root_url, repos_uuid, *sdb,
@@ -2582,11 +2580,7 @@ insert_external_node(void *baton,
   svn_error_t *err;
   svn_boolean_t update_root;
   apr_int64_t repos_id;
-#if SVN_WC__VERSION >= SVN_WC__HAS_EXTERNALS_STORE
   svn_sqlite__stmt_t *stmt;
-#else
-  svn_wc__db_kind_t kind;
-#endif
 
   if (ieb->repos_id != INVALID_REPOS_ID)
     repos_id = ieb->repos_id;
@@ -2594,19 +2588,6 @@ insert_external_node(void *baton,
     SVN_ERR(create_repos_id(&repos_id, ieb->repos_root_url, ieb->repos_uuid,
                             wcroot->sdb, scratch_pool));
 
-#if SVN_WC__VERSION < SVN_WC__HAS_EXTERNALS_STORE
-  /* Currently externals can only be added under an existing directory */
-  SVN_ERR(read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                    NULL, NULL, NULL, NULL, NULL, NULL,
-                    wcroot, svn_relpath_dirname(local_relpath, scratch_pool),
-                    scratch_pool, scratch_pool));
-
-  if ((status != svn_wc__db_status_normal && status != svn_wc__db_status_added)
-      || kind != svn_wc__db_kind_dir)
-    return svn_error_create(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL, NULL);
-#endif
-
   /* And there must be no existing BASE node or it must be a file external */
   err = base_get_info(&status, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                       NULL, NULL, NULL, NULL, &update_root, NULL,
@@ -2660,45 +2641,12 @@ insert_external_node(void *baton,
     SVN_ERR(add_work_items(wcroot->sdb, ieb->work_items, scratch_pool));
 
   /* And the file external info skel */
-  {
-    const char *serialized;
-#if SVN_WC__VERSION < SVN_WC__HAS_EXTERNALS_STORE
-    svn_sqlite__stmt_t *stmt;
-    svn_opt_revision_t peg_rev;
-    svn_opt_revision_t rev;
-
-    if (SVN_IS_VALID_REVNUM(ieb->recorded_peg_revision))
-      {
-        peg_rev.kind = svn_opt_revision_number;
-        peg_rev.value.number = ieb->recorded_peg_revision;
-      }
-    else
-      peg_rev.kind = svn_opt_revision_head;
-
-    if (SVN_IS_VALID_REVNUM(ieb->recorded_revision))
-      {
-        rev.kind = svn_opt_revision_number;
-        rev.value.number = ieb->recorded_revision;
-      }
-    else
-      rev.kind = svn_opt_revision_head;
-
-    SVN_ERR(svn_wc__serialize_file_external(&serialized,
-                                            ieb->recorded_repos_relpath,
-                                            &peg_rev,
-                                            &rev,
-                                            scratch_pool));
-#else
-    serialized = "1";
-#endif
-    SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                      STMT_UPDATE_FILE_EXTERNAL));
-    SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, local_relpath,
-                              serialized));
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                    STMT_UPDATE_FILE_EXTERNAL));
+  SVN_ERR(svn_sqlite__bindf(stmt, "isi", wcroot->wc_id, local_relpath,
+                            (apr_int64_t)1));
+  SVN_ERR(svn_sqlite__step_done(stmt));
 
-    SVN_ERR(svn_sqlite__step_done(stmt));
-  }
-#if SVN_WC__VERSION >= SVN_WC__HAS_EXTERNALS_STORE
   /* The externals table only support presence normal and excluded */
   SVN_ERR_ASSERT(ieb->presence == svn_wc__db_status_normal
                  || ieb->presence == svn_wc__db_status_excluded);
@@ -2729,7 +2677,7 @@ insert_external_node(void *baton,
     SVN_ERR(svn_sqlite__bind_revnum(stmt, 10, ieb->recorded_revision));
 
   SVN_ERR(svn_sqlite__insert(NULL, stmt));
-#endif
+
   return SVN_NO_ERROR;
 }
 
@@ -3036,11 +2984,9 @@ svn_wc__db_external_read(svn_wc__db_stat
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
-#if SVN_WC__VERSION >= SVN_WC__HAS_EXTERNALS_STORE
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_info;
   svn_error_t *err = NULL;
-#endif
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   if (! wri_abspath)
@@ -3054,72 +3000,6 @@ svn_wc__db_external_read(svn_wc__db_stat
 
   local_relpath = svn_dirent_skip_ancestor(wcroot->abspath, local_abspath);
 
-#if SVN_WC__VERSION < SVN_WC__HAS_EXTERNALS_STORE
-  {
-    svn_wc__db_status_t base_status;
-    svn_wc__db_kind_t base_kind;
-    svn_boolean_t update_root;
-
-    SVN_ERR(svn_wc__db_base_get_info(&base_status, &base_kind,
-                                     NULL, NULL, repos_root_url, repos_uuid,
-                                     NULL, NULL, NULL, NULL, NULL, NULL,
-                                     NULL, NULL, &update_root, NULL,
-                                     db, local_abspath,
-                                     result_pool, scratch_pool));
-
-    if (! update_root
-        || base_status != svn_wc__db_status_normal
-        || base_kind == svn_wc__db_kind_dir)
-      {
-        svn_boolean_t is_root;
-        SVN_ERR(svn_wc__db_is_wcroot(&is_root, db, local_abspath,
-                                     scratch_pool));
-
-        if (!is_root)
-          return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
-                                   _("The node '%s' is not an external"),
-                                   svn_dirent_local_style(local_abspath,
-                                                          scratch_pool));
-      }
-
-    if (status)
-      *status = svn_wc__db_status_normal;
-
-    if (kind)
-      *kind = base_kind;
-
-    if (definining_abspath)
-      *definining_abspath = NULL; /* Way to expensive to find now */
-
-    if (recorded_repos_relpath || recorded_peg_revision || recorded_revision)
-      {
-        const char *serialized;
-        const char *path;
-        svn_opt_revision_t peg_rev;
-        svn_opt_revision_t rev;
-
-        SVN_ERR(svn_wc__db_temp_get_file_external(&serialized, db,
-                                                  local_abspath,
-                                                  scratch_pool, scratch_pool));
-
-        SVN_ERR(svn_wc__unserialize_file_external(&path, &peg_rev, &rev,
-                                                  serialized, scratch_pool));
-
-        if (recorded_repos_relpath)
-          *recorded_repos_relpath = apr_pstrdup(result_pool, path);
-
-        if (recorded_peg_revision)
-          *recorded_peg_revision = (peg_rev.kind == svn_opt_revision_number)
-                                   ? peg_rev.value.number : SVN_INVALID_REVNUM;
-
-        if (recorded_revision)
-          *recorded_revision = (rev.kind == svn_opt_revision_number)
-                                   ? rev.value.number : SVN_INVALID_REVNUM;
-      }
-
-    return SVN_NO_ERROR;
-  }
-#else
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, 
                                     STMT_SELECT_EXTERNAL_INFO));
   SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
@@ -3173,7 +3053,6 @@ svn_wc__db_external_read(svn_wc__db_stat
 
   return svn_error_return(
                 svn_error_compose_create(err, svn_sqlite__reset(stmt)));
-#endif
 }
 
 svn_error_t *
@@ -3186,9 +3065,7 @@ svn_wc__db_externals_defined_below(apr_h
   svn_wc__db_wcroot_t *wcroot;
   svn_sqlite__stmt_t *stmt;
   const char *local_relpath;
-#if SVN_WC__VERSION >= SVN_WC__HAS_EXTERNALS_STORE
   svn_boolean_t have_row;
-#endif
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
@@ -3201,9 +3078,6 @@ svn_wc__db_externals_defined_below(apr_h
 
   SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
 
-#if SVN_WC__VERSION < SVN_WC__HAS_EXTERNALS_STORE
-  *externals = NULL;
-#else
   *externals = apr_hash_make(result_pool);
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
@@ -3223,7 +3097,7 @@ svn_wc__db_externals_defined_below(apr_h
 
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
     }
-#endif
+
   return svn_error_return(svn_sqlite__reset(stmt));
 }
 
@@ -7271,7 +7145,6 @@ svn_wc__db_read_node_install_info(const 
                                   const char **target,
                                   apr_hash_t **pristine_props,
                                   apr_time_t *changed_date,
-                                  svn_boolean_t *is_file_external,
                                   svn_wc__db_t *db,
                                   const char *local_abspath,
                                   const char *wri_abspath,
@@ -7283,7 +7156,6 @@ svn_wc__db_read_node_install_info(const 
   svn_sqlite__stmt_t *stmt;
   svn_error_t *err = NULL;
   svn_boolean_t have_row;
-  svn_boolean_t try_external = FALSE;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
@@ -7310,9 +7182,6 @@ svn_wc__db_read_node_install_info(const 
   if (wcroot_abspath != NULL)
     *wcroot_abspath = apr_pstrdup(result_pool, wcroot->abspath);
 
-  if (is_file_external)
-    *is_file_external = FALSE;
-
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_NODE_INFO));
 
@@ -7333,12 +7202,6 @@ svn_wc__db_read_node_install_info(const 
       if (status)
         *status = db_status;
 
-      if (is_file_external
-          && (db_status == svn_wc__db_status_not_present
-              || db_status == svn_wc__db_status_excluded
-              || db_status == svn_wc__db_status_absent))
-        try_external = TRUE;
-
       if (kind)
         *kind = svn_sqlite__column_token(stmt, 4, kind_map);
 
@@ -7356,68 +7219,14 @@ svn_wc__db_read_node_install_info(const 
         *changed_date = svn_sqlite__column_int64(stmt, 9);
     }
   else
-    try_external = (is_file_external != NULL);
-
-  SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
-
-#if SVN_WC__VERSION >= SVN_WC__HAS_EXTERNALS_STORE
-  if (try_external)
-    {
-      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                        STMT_SELECT_EXTERNAL_INFO));
-
-      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-
-      SVN_ERR(svn_sqlite__step(is_file_external, stmt));
-
-      if (*is_file_external)
-        {
-          svn_wc__db_kind_t external_kind;
-          
-          external_kind = svn_sqlite__column_token(stmt, 0, kind_map);
-
-          if (external_kind == svn_wc__db_kind_file
-              || external_kind == svn_wc__db_kind_symlink)
-            {
-              if (status)
-                *status = svn_wc__db_status_normal;
-
-              if (kind)
-                *kind = external_kind;
-
-              if (sha1_checksum)
-                err = svn_sqlite__column_checksum(sha1_checksum, stmt, 5,
-                                                  result_pool);
-
-              if (target)
-                *target = svn_sqlite__column_text(stmt, 6, result_pool);
-
-              if (!err && pristine_props)
-                err = svn_sqlite__column_properties(pristine_props, stmt, 4,
-                                                    result_pool, scratch_pool);
-
-              if (changed_date)
-                *changed_date = svn_sqlite__column_int64(stmt, 8);
-            }
-          else
-            {
-              *is_file_external = FALSE;
-              try_external = FALSE;
-            }
-        }
-
-      SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
-    }
-#else
-  try_external = FALSE;
-#endif
-
-  if (!have_row && ! try_external)
-    return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+    return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND,
+                             svn_sqlite__reset(stmt),
                              _("The node '%s' is not installable"),
                              svn_dirent_local_style(local_abspath,
                                                     scratch_pool));
 
+  SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
+
   return SVN_NO_ERROR;
 }
 
@@ -9917,7 +9726,6 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
                                sdb, scratch_pool));
     }
 
-#if SVN_WC__VERSION >= SVN_WC__HAS_EXTERNALS_STORE
   if (kind == svn_wc__db_kind_dir)
     {
       const svn_string_t *externals = NULL;
@@ -9965,7 +9773,6 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
             }
         }
     }
-#endif
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1129634&r1=1129633&r2=1129634&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Tue May 31 11:41:28 2011
@@ -1907,10 +1907,6 @@ svn_wc__db_read_pristine_info(svn_wc__db
    (a valid reference into the pristine store) and PRISTINE_PROPS to the node's
    pristine properties (to use for installing the file).
 
-   If IS_FILE_EXTERNAL is not NULL, check if the node might be a file external
-   when the node is not present in the working copy and return that information
-   instead and set *IS_FILE_EXTERNAL to true.
-
    If WRI_ABSPATH is not NULL, check for information in the working copy
    identified by WRI_ABSPATH.
    */
@@ -1922,7 +1918,6 @@ svn_wc__db_read_node_install_info(const 
                                   const char **target,
                                   apr_hash_t **pristine_props,
                                   apr_time_t *changed_date,
-                                  svn_boolean_t *is_file_external,
                                   svn_wc__db_t *db,
                                   const char *local_abspath,
                                   const char *wri_abspath,

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1129634&r1=1129633&r2=1129634&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Tue May 31 11:41:28 2011
@@ -630,7 +630,6 @@ run_file_install(svn_wc__db_t *db,
   const char *wcroot_abspath;
   const char *source_abspath;
   const svn_checksum_t *checksum;
-  svn_boolean_t is_file_external;
   apr_hash_t *props;
   apr_time_t changed_date;
 
@@ -646,7 +645,6 @@ run_file_install(svn_wc__db_t *db,
   SVN_ERR(svn_wc__db_read_node_install_info(&wcroot_abspath, NULL, NULL,
                                             &checksum, NULL, &props,
                                             &changed_date,
-                                            &is_file_external,
                                             db, local_abspath, wri_abspath,
                                             scratch_pool, scratch_pool));
 
@@ -748,7 +746,7 @@ run_file_install(svn_wc__db_t *db,
     }
 
   /* ### this should happen before we rename the file into place.  */
-  if (record_fileinfo && !is_file_external)
+  if (record_fileinfo)
     {
       SVN_ERR(get_and_record_fileinfo(db, local_abspath,
                                       FALSE /* ignore_enoent */,