You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2014/04/09 18:53:32 UTC

svn commit: r1586033 - in /subversion/branches/remote-only-status/subversion/libsvn_wc: status.c wc_db.c wc_db.h

Author: brane
Date: Wed Apr  9 16:53:32 2014
New Revision: 1586033

URL: http://svn.apache.org/r1586033
Log:
On the remote-only-status branch: Perform some delicate surgery with a hammer.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_base_read_info, svn_wc__db_base_read_info_fn_t): Remove.
* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_read_info): Removed wrapper implementation.
  (read_info_with_txn): Renamed back to svn_wc__db_read_info.
  (svn_wc__db_base_read_info): Removed.
* subversion/libsvn_wc/status.c
  (internal_status): Use svn_wc__db_base_get_info() in the remote-only case.

Modified:
    subversion/branches/remote-only-status/subversion/libsvn_wc/status.c
    subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.c
    subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.h

Modified: subversion/branches/remote-only-status/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_wc/status.c?rev=1586033&r1=1586032&r2=1586033&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_wc/status.c Wed Apr  9 16:53:32 2014
@@ -2849,18 +2849,27 @@ internal_status(svn_wc_status3_t **statu
      these values to determine if a node is switched */
   if (!is_root)
     {
-      const svn_wc__db_base_read_info_fn_t read_info_fn =
-        (check_working_copy ? svn_wc__db_read_info : svn_wc__db_base_read_info);
       const char *const parent_abspath = svn_dirent_dirname(local_abspath,
                                                             scratch_pool);
-      SVN_ERR(read_info_fn(NULL, NULL, NULL,
-                           &parent_repos_relpath,
-                           &parent_repos_root_url,
-                           &parent_repos_uuid,
-                           NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                           NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                           NULL, NULL, NULL, NULL, NULL,
-                           db, parent_abspath, result_pool, scratch_pool));
+      if (check_working_copy)
+        SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL,
+                                     &parent_repos_relpath,
+                                     &parent_repos_root_url,
+                                     &parent_repos_uuid,
+                                     NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                     NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                     NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                     db, parent_abspath,
+                                     result_pool, scratch_pool));
+      else
+        SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, NULL,
+                                         &parent_repos_relpath,
+                                         &parent_repos_root_url,
+                                         &parent_repos_uuid,
+                                         NULL, NULL, NULL, NULL, NULL,
+                                         NULL, NULL, NULL, NULL, NULL,
+                                         db, parent_abspath,
+                                         result_pool, scratch_pool));
     }
   else
     {

Modified: subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.c?rev=1586033&r1=1586032&r2=1586033&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.c Wed Apr  9 16:53:32 2014
@@ -8763,71 +8763,6 @@ svn_wc__db_read_info_internal(svn_wc__db
 }
 
 
-static svn_error_t *
-read_info_with_txn(svn_wc__db_status_t *status,
-                   svn_node_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,
-                   svn_depth_t *depth,
-                   const svn_checksum_t **checksum,
-                   const char **target,
-                   const char **original_repos_relpath,
-                   const char **original_root_url,
-                   const char **original_uuid,
-                   svn_revnum_t *original_revision,
-                   svn_wc__db_lock_t **lock,
-                   svn_filesize_t *recorded_size,
-                   apr_time_t *recorded_time,
-                   const char **changelist,
-                   svn_boolean_t *conflicted,
-                   svn_boolean_t *op_root,
-                   svn_boolean_t *have_props,
-                   svn_boolean_t *props_mod,
-                   svn_boolean_t *have_base,
-                   svn_boolean_t *have_more_work,
-                   svn_boolean_t *have_work,
-                   svn_wc__db_t *db,
-                   const char *local_abspath,
-                   svn_boolean_t base_tree_only,
-                   apr_pool_t *result_pool,
-                   apr_pool_t *scratch_pool)
-{
-  svn_wc__db_wcroot_t *wcroot;
-  const char *local_relpath;
-  apr_int64_t repos_id, original_repos_id;
-
-  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_WC__DB_WITH_TXN4(
-          read_info(status, kind, revision, repos_relpath, &repos_id,
-                    changed_rev, changed_date, changed_author,
-                    depth, checksum, target, original_repos_relpath,
-                    &original_repos_id, original_revision, lock,
-                    recorded_size, recorded_time, changelist, conflicted,
-                    op_root, have_props, props_mod,
-                    have_base, have_more_work, have_work,
-                    wcroot, local_relpath, base_tree_only,
-                    result_pool, scratch_pool),
-          svn_wc__db_fetch_repos_info(repos_root_url, repos_uuid,
-                                      wcroot->sdb, repos_id, result_pool),
-          svn_wc__db_fetch_repos_info(original_root_url, original_uuid,
-                                      wcroot->sdb, original_repos_id,
-                                      result_pool),
-        SVN_NO_ERROR,
-        wcroot);
-
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_wc__db_read_info(svn_wc__db_status_t *status,
                      svn_node_kind_t *kind,
@@ -8861,65 +8796,35 @@ svn_wc__db_read_info(svn_wc__db_status_t
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool)
 {
-  return svn_error_trace(read_info_with_txn(
-                             status, kind, revision,
-                             repos_relpath, repos_root_url, repos_uuid,
-                             changed_rev, changed_date, changed_author,
-                             depth, checksum, target, original_repos_relpath,
-                             original_root_url, original_uuid,
-                             original_revision, lock,
-                             recorded_size, recorded_time, changelist,
-                             conflicted, op_root, have_props, props_mod,
-                             have_base, have_more_work, have_work,
-                             db, local_abspath, FALSE /* base_tree_only */,
-                             result_pool, scratch_pool));
-}
+  svn_wc__db_wcroot_t *wcroot;
+  const char *local_relpath;
+  apr_int64_t repos_id, original_repos_id;
 
-svn_error_t *
-svn_wc__db_base_read_info(svn_wc__db_status_t *status,
-                          svn_node_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,
-                          svn_depth_t *depth,
-                          const svn_checksum_t **checksum,
-                          const char **target,
-                          const char **original_repos_relpath,
-                          const char **original_root_url,
-                          const char **original_uuid,
-                          svn_revnum_t *original_revision,
-                          svn_wc__db_lock_t **lock,
-                          svn_filesize_t *recorded_size,
-                          apr_time_t *recorded_time,
-                          const char **changelist,
-                          svn_boolean_t *conflicted,
-                          svn_boolean_t *op_root,
-                          svn_boolean_t *have_props,
-                          svn_boolean_t *props_mod,
-                          svn_boolean_t *have_base,
-                          svn_boolean_t *have_more_work,
-                          svn_boolean_t *have_work,
-                          svn_wc__db_t *db,
-                          const char *local_abspath,
-                          apr_pool_t *result_pool,
-                          apr_pool_t *scratch_pool)
-{
-  return svn_error_trace(read_info_with_txn(
-                             status, kind, revision,
-                             repos_relpath, repos_root_url, repos_uuid,
-                             changed_rev, changed_date, changed_author,
-                             depth, checksum, target, original_repos_relpath,
-                             original_root_url, original_uuid,
-                             original_revision, lock,
-                             recorded_size, recorded_time, changelist,
-                             conflicted, op_root, have_props, props_mod,
-                             have_base, have_more_work, have_work,
-                             db, local_abspath, TRUE /* base_tree_only */,
-                             result_pool, scratch_pool));
+  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_WC__DB_WITH_TXN4(
+          read_info(status, kind, revision, repos_relpath, &repos_id,
+                    changed_rev, changed_date, changed_author,
+                    depth, checksum, target, original_repos_relpath,
+                    &original_repos_id, original_revision, lock,
+                    recorded_size, recorded_time, changelist, conflicted,
+                    op_root, have_props, props_mod,
+                    have_base, have_more_work, have_work,
+                    wcroot, local_relpath, FALSE /* base_tree_only */,
+                    result_pool, scratch_pool),
+          svn_wc__db_fetch_repos_info(repos_root_url, repos_uuid,
+                                      wcroot->sdb, repos_id, result_pool),
+          svn_wc__db_fetch_repos_info(original_root_url, original_uuid,
+                                      wcroot->sdb, original_repos_id,
+                                      result_pool),
+        SVN_NO_ERROR,
+        wcroot);
+
+  return SVN_NO_ERROR;
 }
 
 static svn_error_t *

Modified: subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.h?rev=1586033&r1=1586032&r2=1586033&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_wc/wc_db.h Wed Apr  9 16:53:32 2014
@@ -1926,71 +1926,6 @@ svn_wc__db_read_info(svn_wc__db_status_t
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool);
 
-/* Like svn_wc__db_read_info, but only retrieves information about the
-   BASE tree. The signature is the same so that these two functions
-   can be interchanged. */
-svn_error_t *
-svn_wc__db_base_read_info(svn_wc__db_status_t *status,  /* ### derived */
-                          svn_node_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,
-                          svn_depth_t *depth,  /* dirs only */
-                          const svn_checksum_t **checksum, /* files only */
-                          const char **target, /* symlinks only */
-
-                          /* ### the following fields if copied/moved (history) */
-                          const char **original_repos_relpath,
-                          const char **original_root_url,
-                          const char **original_uuid,
-                          svn_revnum_t *original_revision,
-
-                          /* For BASE nodes */
-                          svn_wc__db_lock_t **lock,
-
-                          /* Recorded for files present in the working copy */
-                          svn_filesize_t *recorded_size,
-                          apr_time_t *recorded_time,
-
-                          /* From ACTUAL */
-                          const char **changelist,
-                          svn_boolean_t *conflicted,
-
-                          /* ### the followed are derived fields */
-                          svn_boolean_t *op_root,
-
-                          svn_boolean_t *had_props,
-                          svn_boolean_t *props_mod,
-
-                          svn_boolean_t *have_base,
-                          svn_boolean_t *have_more_work,
-                          svn_boolean_t *have_work,
-
-                          svn_wc__db_t *db,
-                          const char *local_abspath,
-                          apr_pool_t *result_pool,
-                          apr_pool_t *scratch_pool);
-
-/* Typedef for the db(_base)_read_info prototype.  Used in status.c to
-   declare a reference to either svn_wc__db_read_info or
-   svn_wc__db_base_read_info. */
-typedef svn_error_t *(*svn_wc__db_base_read_info_fn_t)(
-    svn_wc__db_status_t *, svn_node_kind_t *, svn_revnum_t *,
-    const char **, const char **, const char **,
-    svn_revnum_t *, apr_time_t *, const char **,
-    svn_depth_t *, const svn_checksum_t **, const char **,
-    const char **, const char **, const char **, svn_revnum_t *,
-    svn_wc__db_lock_t **, svn_filesize_t *, apr_time_t *,
-    const char **, svn_boolean_t *, svn_boolean_t *,
-    svn_boolean_t *, svn_boolean_t *, svn_boolean_t *,
-    svn_boolean_t *, svn_boolean_t *, svn_wc__db_t *,
-    const char *, apr_pool_t *, apr_pool_t *);
-
-
 /* Structure used as linked list in svn_wc__db_info_t to describe all nodes
    in this location that were moved to another location */
 struct svn_wc__db_moved_to_info_t