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/19 15:53:20 UTC

svn commit: r1124782 - in /subversion/trunk/subversion: libsvn_wc/externals.c libsvn_wc/wc-metadata.sql libsvn_wc/wc_db.c libsvn_wc/wc_db.h tests/libsvn_wc/db-test.c

Author: rhuijben
Date: Thu May 19 13:53:20 2011
New Revision: 1124782

URL: http://svn.apache.org/viewvc?rev=1124782&view=rev
Log:
Update the 'public' svn_wc__db_ apis for externals to only return what we
want for 1.7 instead of also some of the NODES information.

* subversion/libsvn_wc/externals.c
  (edit_baton): Add some fields for data we can retrieve without
    an additional query later.
  (open_file): Retrieve data using base functions.
  (close_file): Use data we already have in the baton instead of db calls.
  (svn_wc__get_file_external_editor): Initialize new fields.
  (svn_wc__crawl_file_external): Use nodes for the information crawling.
  (svn_wc__read_external_info): Update caller.

* subversion/libsvn_wc/wc-metadata.sql
  (STMT_CREATE_EXTERNALS): Remove fields that we don't need.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_external_record_fileinfo): Remove function.
  (svn_wc__db_external_read): Update definition and implementation for the
    current db format. (But not for format 29 yet).
  (svn_wc__db_external_read_pristine_props,
   svn_wc__db_external_read_props): Remove function.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_external_add_file): Update documentation.
  (svn_wc__db_external_record_fileinfo): Remove function.
  (svn_wc__db_external_read): Update prototype and documentation.
  (svn_wc__db_external_read_pristine_props,
   svn_wc__db_external_read_props): Remove function.

* subversion/tests/libsvn_wc/db-test.c
  (test_externals_store): Update caller.

Modified:
    subversion/trunk/subversion/libsvn_wc/externals.c
    subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h
    subversion/trunk/subversion/tests/libsvn_wc/db-test.c

Modified: subversion/trunk/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/externals.c?rev=1124782&r1=1124781&r2=1124782&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/externals.c (original)
+++ subversion/trunk/subversion/libsvn_wc/externals.c Thu May 19 13:53:20 2011
@@ -376,6 +376,13 @@ struct edit_baton
   /* List of incoming propchanges */
   apr_array_header_t *propchanges;
 
+  /* The last change information */
+  svn_revnum_t changed_rev;
+  apr_time_t changed_date;
+  const char *changed_author;
+
+  svn_boolean_t had_props;
+
   svn_boolean_t file_closed;
 };
 
@@ -442,12 +449,12 @@ open_file(const char *path,
                                                       file_pool));
 
   *file_baton = eb;
-  SVN_ERR(svn_wc__db_external_read(NULL, &kind, &eb->original_revision,
-                                   NULL, NULL, NULL, NULL, NULL, NULL,
-                                   &eb->original_checksum, NULL, NULL, NULL,
-                                   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                   NULL,
-                                   eb->db, eb->local_abspath, eb->wri_abspath,
+  SVN_ERR(svn_wc__db_base_get_info(NULL, &kind, &eb->original_revision,
+                                   NULL, NULL, NULL, &eb->changed_rev,
+                                   &eb->changed_date, &eb->changed_author,
+                                   NULL, &eb->original_checksum, NULL, NULL,
+                                   &eb->had_props, NULL, NULL,
+                                   eb->db, eb->local_abspath,
                                    eb->pool, file_pool));
 
   if (kind != svn_wc__db_kind_file)
@@ -557,14 +564,7 @@ close_file(void *file_baton,
 
       if (actual_md5_checksum == NULL)
         {
-          SVN_ERR(svn_wc__db_external_read(NULL, NULL, NULL, NULL, NULL, NULL,
-                                           NULL, NULL, NULL,
-                                           &actual_md5_checksum, NULL,
-                                           NULL, NULL, NULL, NULL, NULL,
-                                           NULL, NULL, NULL, NULL, NULL,
-                                           eb->db, eb->local_abspath,
-                                           eb->wri_abspath,
-                                           pool, pool));
+          actual_md5_checksum = eb->original_checksum;
 
           if (actual_md5_checksum != NULL
               && actual_md5_checksum->kind != svn_checksum_md5)
@@ -607,41 +607,17 @@ close_file(void *file_baton,
     apr_hash_t *new_dav_props = NULL;
     const svn_checksum_t *new_checksum = NULL;
     const svn_checksum_t *original_checksum = NULL;
-    svn_revnum_t changed_rev = SVN_INVALID_REVNUM;
-    apr_time_t changed_date = 0;
-    const char *changed_author = NULL;
+    
     svn_boolean_t added = !SVN_IS_VALID_REVNUM(eb->original_revision);
     const char *repos_relpath = svn_uri_is_child(eb->repos_root_url,
                                                       eb->url, pool);
 
     if (! added)
       {
-        svn_boolean_t had_props;
-        svn_boolean_t props_mod;
+        new_checksum = eb->original_checksum;
 
-        SVN_ERR(svn_wc__db_external_read(NULL, NULL, NULL, NULL, NULL, NULL,
-                                         &changed_rev, &changed_date,
-                                         &changed_author, &original_checksum,
-                                         NULL, NULL, NULL, NULL, NULL, NULL,
-                                         NULL, NULL, NULL, &had_props,
-                                         &props_mod,
-                                         eb->db, eb->local_abspath,
-                                         eb->wri_abspath,
-                                         pool, pool));
-
-        new_checksum = original_checksum;
-
-        if (had_props)
-          SVN_ERR(svn_wc__db_external_read_pristine_props(&base_props, eb->db,
-                                                          eb->local_abspath,
-                                                          eb->wri_abspath,
-                                                          pool, pool));
-
-        if (props_mod)
-          SVN_ERR(svn_wc__db_external_read_props(&actual_props, eb->db,
-                                                 eb->local_abspath,
-                                                 eb->wri_abspath,
-                                                 pool, pool));
+        SVN_ERR(svn_wc__db_base_get_props(&actual_props, eb->db,
+                                          eb->local_abspath, pool, pool));
       }
 
     if (!base_props)
@@ -672,15 +648,15 @@ close_file(void *file_baton,
             continue; /* authz or something */
 
           if (! strcmp(prop->name, SVN_PROP_ENTRY_LAST_AUTHOR))
-            changed_author = apr_pstrdup(pool, prop->value->data);
+            eb->changed_author = apr_pstrdup(pool, prop->value->data);
           else if (! strcmp(prop->name, SVN_PROP_ENTRY_COMMITTED_REV))
             {
               apr_int64_t rev;
               SVN_ERR(svn_cstring_atoi64(&rev, prop->value->data));
-              changed_rev = (svn_revnum_t)rev;
+              eb->changed_rev = (svn_revnum_t)rev;
             }
           else if (! strcmp(prop->name, SVN_PROP_ENTRY_COMMITTED_DATE))
-            SVN_ERR(svn_time_from_cstring(&changed_date, prop->value->data,
+            SVN_ERR(svn_time_from_cstring(&eb->changed_date, prop->value->data,
                                           pool));
         }
 
@@ -807,9 +783,9 @@ close_file(void *file_baton,
                         eb->repos_uuid,
                         *eb->target_revision,
                         new_pristine_props,
-                        changed_rev,
-                        changed_date,
-                        changed_author,
+                        eb->changed_rev,
+                        eb->changed_date,
+                        eb->changed_author,
                         new_checksum,
                         new_dav_props,
                         eb->record_ancestor_abspath,
@@ -928,6 +904,8 @@ svn_wc__get_file_external_editor(const s
   eb->recorded_repos_relpath = svn_uri_is_child(repos_root_url, recorded_url,
                                                 edit_pool);
 
+  eb->changed_rev = SVN_INVALID_REVNUM;
+
   if (recorded_peg_rev->kind == svn_opt_revision_number)
     eb->recorded_peg_revision = recorded_peg_rev->value.number;
   else
@@ -983,19 +961,21 @@ svn_wc__crawl_file_external(svn_wc_conte
   svn_revnum_t revision;
   const char *repos_root_url;
   const char *repos_relpath;
+  svn_boolean_t update_root;
 
   if (! wri_abspath)
     wri_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
-  err = svn_wc__db_external_read(NULL, &kind, &revision,
+  err = svn_wc__db_base_get_info(NULL, &kind, &revision,
                                  &repos_relpath, &repos_root_url, NULL, NULL,
-                                 NULL, NULL, NULL, NULL, &lock, NULL, NULL,
-                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                 db, local_abspath, wri_abspath,
+                                 NULL, NULL, NULL, NULL, NULL, &lock,
+                                 NULL, &update_root, NULL,
+                                 db, local_abspath,
                                  scratch_pool, scratch_pool);
 
   if (err
-      || kind == svn_wc__db_kind_dir)
+      || kind == svn_wc__db_kind_dir
+      || !update_root)
     {
       if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
         return svn_error_return(err);
@@ -1081,13 +1061,10 @@ svn_wc__read_external_info(svn_node_kind
   svn_wc__db_kind_t kind;
   svn_error_t *err;
 
-  err = svn_wc__db_external_read(&status, &kind, NULL, NULL,
-                                 defining_url ? &repos_root_url : NULL,
-                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                 NULL, NULL, defining_abspath, defining_url,
-                                 defining_operational_revision,
+  err = svn_wc__db_external_read(&status, &kind, defining_abspath,
+                                 defining_url ? &repos_root_url : NULL, NULL,
+                                 defining_url, defining_operational_revision,
                                  defining_revision,
-                                 NULL, NULL, NULL,
                                  wc_ctx->db, local_abspath, wri_abspath,
                                  result_pool, scratch_pool);
 

Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1124782&r1=1124781&r2=1124782&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Thu May 19 13:53:20 2011
@@ -545,34 +545,12 @@ CREATE TABLE EXTERNALS (
   /* Repository location fields */
   repos_id  INTEGER NOT NULL REFERENCES REPOSITORY (id),
 
-  /* Always set for file and symlink externals. NULL for directory externals */
-  repos_path  TEXT,
-  revision  INTEGER,
-
   /* Either 'normal' or 'excluded' */
   presence  TEXT NOT NULL,
 
-  /* Content fields */
-
   /* the kind of the external. */
   kind  TEXT NOT NULL,
 
-  /* Variouse information (NULL for directories; see NODES for explanation) */
-  properties  BLOB,
-  checksum  TEXT REFERENCES PRISTINE (checksum),
-  symlink_target  TEXT,
-
-  /* Last-Change fields (NULL for directories; see NODES for explanation) */
-  changed_revision  INTEGER,
-  changed_date      INTEGER,
-  changed_author    TEXT,
-
-  /* Various cache fields (NULL for directories; see NODES for explanation) */
-  recorded_size  INTEGER,
-  recorded_mod_time  INTEGER,
-  dav_cache  BLOB,
-
-
   /* The local relpath of the directory NODE defining this external 
      (Defaults to the parent directory of the file external after upgrade) */
   def_local_relpath         TEXT NOT NULL,

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1124782&r1=1124781&r2=1124782&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu May 19 13:53:20 2011
@@ -3002,64 +3002,19 @@ svn_wc__db_external_remove(svn_wc__db_t 
 }
 
 svn_error_t *
-svn_wc__db_external_record_fileinfo(svn_wc__db_t *db,
-                                    const char *local_abspath,
-                                    const char *wri_abspath,
-                                    svn_filesize_t recorded_size,
-                                    apr_time_t recorded_mod_time,
-                                    apr_pool_t *scratch_pool)
-{
-  svn_wc__db_wcroot_t *wcroot;
-  const char *local_relpath;
-  svn_sqlite__stmt_t *stmt;
-  int affected_rows;
-
-  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);
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_UPDATE_EXTERNAL_FILEINFO));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isii", wcroot->wc_id, local_relpath,
-                            recorded_size,
-                            recorded_mod_time));
-  SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
-
-  SVN_ERR_ASSERT(affected_rows == 1);
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
 svn_wc__db_external_read(svn_wc__db_status_t *status,
                          svn_wc__db_kind_t *kind,
-                         svn_revnum_t *revision,
-                         const char **repos_relpath,
+                         const char **definining_abspath,
                          const char **repos_root_url,
                          const char **repos_uuid,
-                         svn_revnum_t *changed_rev,
-                         apr_time_t *changed_date,
-                         const char **changed_author,
-                         const svn_checksum_t **checksum,
-                         const char **target,
-                         svn_wc__db_lock_t **lock,
-                         svn_filesize_t *recorded_size,
-                         apr_time_t *recorded_mod_time,
-                         const char **record_ancestor_abspath,
                          const char **recorded_repos_relpath,
                          svn_revnum_t *recorded_peg_revision,
                          svn_revnum_t *recorded_revision,
-                         svn_boolean_t *conflicted,
-                         svn_boolean_t *had_props,
-                         svn_boolean_t *props_mod,
                          svn_wc__db_t *db,
                          const char *local_abspath,
                          const char *wri_abspath,
                          apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool)
-{
+                         apr_pool_t *scratch_pool){
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
 #if SVN_WC__VERSION >= SVN_WC__HAS_EXTERNALS_STORE
@@ -3087,10 +3042,9 @@ svn_wc__db_external_read(svn_wc__db_stat
     svn_boolean_t update_root;
 
     SVN_ERR(svn_wc__db_base_get_info(&base_status, &base_kind,
-                                     revision, repos_relpath, repos_root_url,
-                                     repos_uuid, changed_rev, changed_date,
-                                     changed_author, NULL, checksum, target,
-                                     lock, had_props, &update_root, NULL,
+                                     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));
 
@@ -3110,8 +3064,8 @@ svn_wc__db_external_read(svn_wc__db_stat
     if (kind)
       *kind = base_kind;
 
-    if (record_ancestor_abspath)
-      *record_ancestor_abspath = NULL; /* Way to expensive to find now */
+    if (definining_abspath)
+      *definining_abspath = NULL; /* Way to expensive to find now */
 
     if (recorded_repos_relpath || recorded_peg_revision || recorded_revision)
       {
@@ -3139,14 +3093,6 @@ svn_wc__db_external_read(svn_wc__db_stat
                                    ? rev.value.number : SVN_INVALID_REVNUM;
       }
 
-    if (props_mod || recorded_size || recorded_mod_time || conflicted)
-      SVN_ERR(read_info(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                        NULL, NULL, NULL, NULL, NULL, NULL, recorded_size,
-                        recorded_mod_time, NULL, conflicted, NULL, NULL,
-                        props_mod, NULL, NULL, NULL,
-                        wcroot, local_relpath,
-                        result_pool, scratch_pool));
-
     return SVN_NO_ERROR;
   }
 #else
@@ -3267,113 +3213,6 @@ svn_wc__db_external_read(svn_wc__db_stat
 #endif
 }
 
-svn_error_t *
-svn_wc__db_external_read_pristine_props(apr_hash_t **props,
-                                        svn_wc__db_t *db,
-                                        const char *local_abspath,
-                                        const char *wri_abspath,
-                                        apr_pool_t *result_pool,
-                                        apr_pool_t *scratch_pool)
-{
-  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_row;
-  svn_error_t *err;
-#endif
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-
-  if (! wri_abspath)
-    wri_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
-
-  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(wcroot);
-
-  SVN_ERR_ASSERT(svn_dirent_is_ancestor(wcroot->abspath, local_abspath));
-
-  local_relpath = svn_dirent_skip_ancestor(wcroot->abspath, local_abspath);
-
-#if SVN_WC__VERSION < SVN_WC__HAS_EXTERNALS_STORE
-  return svn_error_return(svn_wc__db_read_pristine_props(props, db,
-                                                         local_abspath,
-                                                         result_pool,
-                                                         scratch_pool));
-#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));
-  SVN_ERR(svn_sqlite__step(&have_row, stmt));
-
-  if (have_row)
-    {
-      svn_wc__db_kind_t kind = svn_sqlite__column_token(stmt, 0, kind_map);
-
-      if (kind != svn_wc__db_kind_file
-          && kind != svn_wc__db_kind_symlink)
-        {
-          err = svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
-                              _("The node '%s' is not a file external."),
-                              svn_dirent_local_style(local_abspath,
-                                                     scratch_pool));
-        }
-      else
-        err = svn_sqlite__column_properties(props, stmt, 4, result_pool,
-                                            scratch_pool);
-
-      if (props && !*props)
-        *props = apr_hash_make(result_pool);
-    }
-  else
-    {
-      err = 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));
-    }
-
-  return svn_error_return(svn_error_compose_create(err,
-                                                   svn_sqlite__reset(stmt)));
-#endif
-}
-
-svn_error_t *
-svn_wc__db_external_read_props(apr_hash_t **props,
-                               svn_wc__db_t *db,
-                               const char *local_abspath,
-                               const char *wri_abspath,
-                               apr_pool_t *result_pool,
-                               apr_pool_t *scratch_pool)
-{
-  svn_wc__db_wcroot_t *wcroot;
-  const char *local_relpath;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-
-  if (! wri_abspath)
-    wri_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
-
-  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(wcroot);
-
-  SVN_ERR_ASSERT(svn_dirent_is_ancestor(wcroot->abspath, local_abspath));
-
-  local_relpath = svn_dirent_skip_ancestor(wcroot->abspath, local_abspath);
-
-#if SVN_WC__VERSION < SVN_WC__HAS_EXTERNALS_STORE
-  return svn_error_return(svn_wc__db_read_props(props, db, local_abspath,
-                                                result_pool, scratch_pool));
-#else
-  /* ### Where do we store actual properties? ACTUAL? New column? */
-  SVN_ERR(svn_wc__db_external_read_pristine_props(props, db, local_abspath,
-                                                  wri_abspath,
-                                                  result_pool, scratch_pool));
-  return SVN_NO_ERROR;
-#endif
-}
 
 
 /* Helper for svn_wc__db_op_copy to handle copying from one db to

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1124782&r1=1124781&r2=1124782&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Thu May 19 13:53:20 2011
@@ -1012,6 +1012,8 @@ svn_wc__db_pristine_check(svn_boolean_t 
 
 /* Adds (or overwrites) a file external LOCAL_ABSPATH to the working copy
    identified by WRI_ABSPATH.
+
+   It updates both EXTERNALS and NODES in one atomic step.
  */
 svn_error_t *
 svn_wc__db_external_add_file(svn_wc__db_t *db,
@@ -1103,16 +1105,6 @@ svn_wc__db_external_add_dir(svn_wc__db_t
                             const svn_skel_t *work_items,
                             apr_pool_t *scratch_pool);
 
-/* Record the specified size and timestamp for the file external LOCAL_ABSPATH
-   in the working copy identified by WRI_ABSPATH */
-svn_error_t *
-svn_wc__db_external_record_fileinfo(svn_wc__db_t *db,
-                                    const char *local_abspath,
-                                    const char *wri_abspath,
-                                    svn_filesize_t recorded_size,
-                                    apr_time_t recorded_mod_time,
-                                    apr_pool_t *scratch_pool);
-
 /* Remove a registered external LOCAL_ABSPATH from the working copy identified
    by WRI_ABSPATH.
  */
@@ -1127,7 +1119,7 @@ svn_wc__db_external_remove(svn_wc__db_t 
 
 /* Reads information on the external LOCAL_ABSPATH as stored in the working
    copy identified with WRI_ABSPATH (If NULL the parent directory of
-   LOCAL_ABSPATH).
+   LOCAL_ABSPATH is taken as WRI_ABSPATH).
 
    Return SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not an external in
    this working copy.
@@ -1136,13 +1128,11 @@ svn_wc__db_external_remove(svn_wc__db_t 
       svn_wc__db_status_normal           The external is available
       svn_wc__db_status_excluded         The external is user excluded
 
-   When KIND is requested it has the kind of external
-
-   If REVISION is requested, and the node is NOT a directory, then
-   the value will be set to the revision of the file external.
+   When KIND is requested then the value will be set to the kind of external.
 
-   If REPOS_RELPATH is requested, and the node is NOT a directory, then
-   the value will be set to the repository relative path of the file external.
+   If DEFININING_ABSPATH is requested, then the value will be set to the
+   absolute path of the directory which originally defined the external.
+   (The path with the svn:externals property)
 
    If REPOS_ROOT_URL is requested, then the value will be set to the
    repository root of the external.
@@ -1150,14 +1140,6 @@ svn_wc__db_external_remove(svn_wc__db_t 
    If REPOS_UUID is requested, then the value will be set to the
    repository uuid of the external.
 
-   When any of CHANGED_REV, CHANGED_DATE, CHANGED_AUTHOR, CHECKSUM, TARGET,
-   LOCK, RECORDED_SIZE, RECORDED_MOD_TIME, CONFLICTED, HAD_PROPS or PROPS_MOD
-   is requested,  and the node is NOT a directory, their value will set like
-   how svn_wc__db_read_info() would handle the value.
-
-   If RECORD_ANCESTOR_ABSPATH is requested, then the value will be set to the
-   absolute path of the directory which originally defined the external.
-
    If RECORDED_REPOS_RELPATH is requested, then the value will be set to the
    original repository relative path inside REPOS_ROOT_URL of the external.
 
@@ -1173,76 +1155,21 @@ svn_wc__db_external_remove(svn_wc__db_t 
 svn_error_t *
 svn_wc__db_external_read(svn_wc__db_status_t *status,
                          svn_wc__db_kind_t *kind,
-                         svn_revnum_t *revision,
-                         const char **repos_relpath,
+                         const char **defining_abspath,
+
                          const char **repos_root_url,
                          const char **repos_uuid,
-                         svn_revnum_t *changed_rev,
-                         apr_time_t *changed_date,
-                         const char **changed_author,
-
-                         const svn_checksum_t **checksum, /* files only */
-                         const char **target, /* symlinks only */
-
-                         /* For files and symlinks */
-                         svn_wc__db_lock_t **lock,
-
-                         /* Recorded for files present in the working copy */
-                         svn_filesize_t *recorded_size,
-                         apr_time_t *recorded_mod_time,
-
-                         /* following fields are stored as copy from the
-                            property which defined the external.
-                            (Currently only for file externals) */
-                         const char **record_ancestor_abspath,
+
                          const char **recorded_repos_relpath,
                          svn_revnum_t *recorded_peg_revision,
                          svn_revnum_t *recorded_revision,
 
-                         /* From ACTUAL */
-                         svn_boolean_t *conflicted,
-
-                         /* Derived (only for files) */
-                         svn_boolean_t *had_props,
-                         svn_boolean_t *props_mod,
-
                          svn_wc__db_t *db,
                          const char *local_abspath,
                          const char *wri_abspath,
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool);
 
-/* For file and symlink externals reads the pristine properties of
-   LOCAL_ABSPATH as stored in the working copy identified by WRI_ABSPATH
-   (If NULL the parent directory of LOCAL_ABSPATH).
-
-   Return SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not an external in
-   this working copy.
- */
-svn_error_t *
-svn_wc__db_external_read_pristine_props(apr_hash_t **props,
-                                        svn_wc__db_t *db,
-                                        const char *local_abspath,
-                                        const char *wri_abspath,
-                                        apr_pool_t *result_pool,
-                                        apr_pool_t *scratch_pool);
-
-/* For file and symlink externals reads the actual properties of
-   LOCAL_ABSPATH as stored in the working copy identified by WRI_ABSPATH
-   (If NULL the parent directory of LOCAL_ABSPATH).
-
-   Return SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not an external in
-   this working copy.
- */
-svn_error_t *
-svn_wc__db_external_read_props(apr_hash_t **props,
-                               svn_wc__db_t *db,
-                               const char *local_abspath,
-                               const char *wri_abspath,
-                               apr_pool_t *result_pool,
-                               apr_pool_t *scratch_pool);
-
-
 /* @} */
 
 /* @defgroup svn_wc__db_op  Operations on WORKING tree

Modified: subversion/trunk/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/db-test.c?rev=1124782&r1=1124781&r2=1124782&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/db-test.c Thu May 19 13:53:20 2011
@@ -1467,53 +1467,25 @@ test_externals_store(apr_pool_t *pool)
   {
     svn_wc__db_status_t status;
     svn_wc__db_kind_t kind;
-    svn_revnum_t revision;
-    const char *repos_relpath;
     const char *repos_root_url;
     const char *repos_uuid;
-    svn_revnum_t changed_rev;
-    apr_time_t changed_date;
-    const char *changed_author;
-    const svn_checksum_t *checksum;
-    const char *target;
-    svn_wc__db_lock_t *lock;
-    svn_filesize_t recorded_size;
-    apr_time_t recorded_mod_time;
     const char *record_ancestor_abspath;
     const char *recorded_repos_relpath;
     svn_revnum_t recorded_peg_revision;
     svn_revnum_t recorded_revision;
-    svn_boolean_t conflicted;
-    svn_boolean_t had_props;
-    svn_boolean_t props_mod;
 
-    SVN_ERR(svn_wc__db_external_read(&status, &kind, &revision, &repos_relpath,
+    SVN_ERR(svn_wc__db_external_read(&status, &kind, &record_ancestor_abspath,
                                      &repos_root_url, &repos_uuid,
-                                     &changed_rev, &changed_date,
-                                     &changed_author, &checksum, &target,
-                                     &lock, &recorded_size, &recorded_mod_time,
-                                     &record_ancestor_abspath,
                                      &recorded_repos_relpath,
                                      &recorded_peg_revision,
-                                     &recorded_revision, &conflicted,
-                                     &had_props, &props_mod,
+                                     &recorded_revision,
                                      db, file_external_path, local_abspath,
                                      pool, pool));
 
     SVN_TEST_ASSERT(status == svn_wc__db_status_normal);
     SVN_TEST_ASSERT(kind == svn_wc__db_kind_file);
-    SVN_TEST_ASSERT(revision == 12);
-    SVN_TEST_STRING_ASSERT(repos_relpath, "some/location");
     SVN_TEST_STRING_ASSERT(repos_root_url, "svn://some-repos/svn");
     SVN_TEST_STRING_ASSERT(repos_uuid, "not-a-uuid");
-    SVN_TEST_ASSERT(changed_rev == 10);
-    SVN_TEST_ASSERT(changed_date == 987654);
-    SVN_TEST_STRING_ASSERT(changed_author, "somebody");
-    SVN_TEST_ASSERT(svn_checksum_match(orig_checksum, checksum));
-    SVN_TEST_ASSERT(target == NULL);
-    SVN_TEST_ASSERT(lock == NULL);
-    SVN_TEST_ASSERT(recorded_size == SVN_INVALID_FILESIZE);
-    SVN_TEST_ASSERT(recorded_mod_time == 0);
 #if SVN_WC__VERSION >= SVN_WC__HAS_EXTERNALS_STORE
     SVN_TEST_STRING_ASSERT(record_ancestor_abspath, subdir);
 #else
@@ -1522,18 +1494,14 @@ test_externals_store(apr_pool_t *pool)
     SVN_TEST_STRING_ASSERT(recorded_repos_relpath, "some/new-location");
     SVN_TEST_ASSERT(recorded_peg_revision == 90);
     SVN_TEST_ASSERT(recorded_revision == 12);
-    SVN_TEST_ASSERT(!conflicted);
-    SVN_TEST_ASSERT(had_props);
-    SVN_TEST_ASSERT(!props_mod);
 
     {
       apr_hash_t *new_props;
       svn_string_t *v;
 
-      SVN_ERR(svn_wc__db_external_read_pristine_props(&new_props, db,
-                                                     file_external_path,
-                                                     local_abspath,
-                                                     pool, pool));
+      SVN_ERR(svn_wc__db_base_get_props(&new_props, db,
+                                        file_external_path,
+                                        pool, pool));
 
       SVN_TEST_ASSERT(new_props != NULL);
       v = apr_hash_get(new_props, "key", APR_HASH_KEY_STRING);