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/30 20:50:53 UTC

svn commit: r1129290 - in /subversion/trunk/subversion/libsvn_client: client.h externals.c switch.c update.c

Author: rhuijben
Date: Mon May 30 18:50:53 2011
New Revision: 1129290

URL: http://svn.apache.org/viewvc?rev=1129290&view=rev
Log:
Remove the walking of 'old' externals property values from the update and
switch processing. We can rely on the externals store now.

* subversion/libsvn_client/client.h
  (svn_client__handle_externals): Remove unused argument.

* subversion/libsvn_client/externals.c
  (USE_EXTERNALS_STORE): Remove define.
  (svn_client__handle_externals): Remove unused argument and pre format 29
    code.

* subversion/libsvn_client/switch.c
  (switch_internal): Update caller.

* subversion/libsvn_client/update.c
  (update_internal): Update caller.

Modified:
    subversion/trunk/subversion/libsvn_client/client.h
    subversion/trunk/subversion/libsvn_client/externals.c
    subversion/trunk/subversion/libsvn_client/switch.c
    subversion/trunk/subversion/libsvn_client/update.c

Modified: subversion/trunk/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/client.h?rev=1129290&r1=1129289&r2=1129290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/client.h (original)
+++ subversion/trunk/subversion/libsvn_client/client.h Mon May 30 18:50:53 2011
@@ -884,10 +884,10 @@ svn_client__do_commit(const char *base_u
 
 /*** Externals (Modules) ***/
 
-/* Handle changes to the svn:externals property described by EXTERNALS_OLD,
-   EXTERNALS_NEW, and AMBIENT_DEPTHS.  The tree's top level directory
-   is at TO_ABSPATH which has a root URL of REPOS_ROOT_URL (optional).
-   A write lock should be  held.
+/* Handle changes to the svn:externals property described by EXTERNALS_NEW,
+   and AMBIENT_DEPTHS.  The tree's top level directory
+   is at TARGET_ABSPATH which has a root URL of REPOS_ROOT_URL.
+   A write lock should be held.
 
    For each changed value of the property, discover the nature of the
    change and behave appropriately -- either check a new "external"
@@ -914,8 +914,7 @@ svn_client__do_commit(const char *base_u
 
    Use POOL for temporary allocation. */
 svn_error_t *
-svn_client__handle_externals(apr_hash_t *externals_old,
-                             apr_hash_t *externals_new,
+svn_client__handle_externals(apr_hash_t *externals_new,
                              apr_hash_t *ambient_depths,
                              const char *repos_root_url,
                              const char *target_abspath,

Modified: subversion/trunk/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/externals.c?rev=1129290&r1=1129289&r2=1129290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/externals.c (original)
+++ subversion/trunk/subversion/libsvn_client/externals.c Mon May 30 18:50:53 2011
@@ -41,8 +41,6 @@
 
 #include "svn_private_config.h"
 #include "private/svn_wc_private.h"
-
-#define USE_EXTERNALS_STORE
 
 /* Closure for handle_external_item_change. */
 struct external_change_baton_t
@@ -1152,8 +1150,7 @@ handle_externals_change(const struct ext
 
 
 svn_error_t *
-svn_client__handle_externals(apr_hash_t *externals_old,
-                             apr_hash_t *externals_new,
+svn_client__handle_externals(apr_hash_t *externals_new,
                              apr_hash_t *ambient_depths,
                              const char *repos_root_url,
                              const char *target_abspath,
@@ -1162,7 +1159,7 @@ svn_client__handle_externals(apr_hash_t 
                              svn_client_ctx_t *ctx,
                              apr_pool_t *scratch_pool)
 {
-  apr_hash_t *combined;
+  apr_hash_t *external_defs;
   apr_hash_index_t *hi;
   apr_pool_t *iterpool;
   apr_hash_t *old_external_urls;
@@ -1176,12 +1173,6 @@ svn_client__handle_externals(apr_hash_t 
   eb.timestamp_sleep = timestamp_sleep;
   eb.is_export = FALSE;
 
-  if (! externals_old)
-    combined = externals_new;
-  else if (! externals_new)
-    combined = externals_old;
-  else
-    combined = apr_hash_overlay(scratch_pool, externals_old, externals_new);
 
   iterpool = svn_pool_create(scratch_pool);
 
@@ -1189,81 +1180,29 @@ svn_client__handle_externals(apr_hash_t 
 
   /* Parse the old externals. This part will be replaced by reading EXTERNALS
      from the DB. */
-#ifdef USE_EXTERNALS_STORE
-  {
-    apr_hash_t *external_defs;
-    SVN_ERR(svn_wc__externals_defined_below(&external_defs,
-                                            ctx->wc_ctx, target_abspath,
-                                            scratch_pool, iterpool));
-
-    for (hi = apr_hash_first(scratch_pool, external_defs);
-         hi;
-         hi = apr_hash_next(hi))
-      {
-        const char *old_url;
-        const char *item_abspath = svn__apr_hash_index_key(hi);
-
-        /* This should be moved into the external processing code once
-           the EXTERNALS store is in place */
-        SVN_ERR(svn_wc__read_external_info(NULL, NULL, &old_url, NULL, NULL,
-                                           ctx->wc_ctx, target_abspath,
-                                           item_abspath, FALSE,
-                                           scratch_pool, iterpool));
+  SVN_ERR(svn_wc__externals_defined_below(&external_defs,
+                                          ctx->wc_ctx, target_abspath,
+                                          scratch_pool, iterpool));
 
-        apr_hash_set(old_external_urls, item_abspath,
-                     APR_HASH_KEY_STRING, old_url);
-      }
-  }
-#else
-  if (externals_old)
+  for (hi = apr_hash_first(scratch_pool, external_defs);
+       hi;
+       hi = apr_hash_next(hi))
     {
-      for (hi = apr_hash_first(scratch_pool, externals_old);
-           hi;
-           hi = apr_hash_next(hi))
-        {
-          const char *old_desc_text;
-          apr_array_header_t *old_desc;
-          const char *def_abspath;
-          const char *url;
-          int i;
-
-          svn_pool_clear(iterpool);
-
-          def_abspath = svn__apr_hash_index_key(hi);
-          old_desc_text = svn__apr_hash_index_val(hi);
-
-          SVN_ERR(svn_wc_parse_externals_description3(&old_desc, def_abspath,
-                                                      old_desc_text,
-                                                      FALSE, iterpool));
-
-          SVN_ERR(svn_wc__node_get_url(&url, ctx->wc_ctx, def_abspath,
-                                       iterpool, iterpool));
-
-          SVN_ERR_ASSERT(url);
-
-          for (i = 0; old_desc && (i < old_desc->nelts); i++)
-            {
-              svn_wc_external_item2_t *item;
-              const char *item_abspath;
-              const char *old_url;
-
-              item = APR_ARRAY_IDX(old_desc, i, svn_wc_external_item2_t *);
-              item_abspath = svn_dirent_join(def_abspath, item->target_dir,
-                                               scratch_pool);
+      const char *old_url;
+      const char *item_abspath = svn__apr_hash_index_key(hi);
 
-              SVN_ERR(resolve_relative_external_url(&old_url, item,
-                                                    repos_root_url,
-                                                    url, scratch_pool,
-                                                    iterpool));
+      /* This should be moved into the external processing code once
+         the EXTERNALS store is in place */
+      SVN_ERR(svn_wc__read_external_info(NULL, NULL, &old_url, NULL, NULL,
+                                         ctx->wc_ctx, target_abspath,
+                                         item_abspath, FALSE,
+                                         scratch_pool, iterpool));
 
-              apr_hash_set(old_external_urls, item_abspath,
-                           APR_HASH_KEY_STRING, old_url);
-            }
-         }
+      apr_hash_set(old_external_urls, item_abspath,
+                   APR_HASH_KEY_STRING, old_url);
     }
-#endif
 
-  for (hi = apr_hash_first(scratch_pool, combined);
+  for (hi = apr_hash_first(scratch_pool, externals_new);
        hi;
        hi = apr_hash_next(hi))
     {

Modified: subversion/trunk/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/switch.c?rev=1129290&r1=1129289&r2=1129290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/switch.c (original)
+++ subversion/trunk/subversion/libsvn_client/switch.c Mon May 30 18:50:53 2011
@@ -88,7 +88,6 @@ switch_internal(svn_revnum_t *result_rev
   apr_array_header_t *preserved_exts;
   svn_boolean_t server_supports_depth;
   struct svn_client__dirent_fetcher_baton_t dfb;
-  svn_client__external_func_baton_t efb;
   svn_config_t *cfg = ctx->config ? apr_hash_get(ctx->config,
                                                  SVN_CONFIG_CATEGORY_CONFIG,
                                                  APR_HASH_KEY_STRING)
@@ -223,11 +222,6 @@ switch_internal(svn_revnum_t *result_rev
 
   /* Fetch the switch (update) editor.  If REVISION is invalid, that's
      okay; the RA driver will call editor->set_target_revision() later on. */
-  efb.externals_new = apr_hash_make(pool);
-  efb.externals_old = apr_hash_make(pool);
-  efb.ambient_depths = apr_hash_make(pool);
-  efb.result_pool = pool;
-
   SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
                                 SVN_RA_CAPABILITY_DEPTH, pool));
 
@@ -257,11 +251,6 @@ switch_internal(svn_revnum_t *result_rev
                             switch_rev_url,
                             switch_editor, switch_edit_baton, pool));
 
-  SVN_ERR(svn_wc__externals_gather_definitions(&efb.externals_old,
-                                               &efb.ambient_depths,
-                                               ctx->wc_ctx, local_abspath,
-                                               depth, pool, pool));
-
   /* Drive the reporter structure, describing the revisions within
      PATH.  When we call reporter->finish_report, the update_editor
      will be driven by svn_repos_dir_delta2.
@@ -298,9 +287,7 @@ switch_internal(svn_revnum_t *result_rev
                                                    ctx->wc_ctx, local_abspath,
                                                    depth, pool, pool));
 
-      new_depths = apr_hash_overlay(pool, new_depths, efb.ambient_depths);
-      SVN_ERR(svn_client__handle_externals(efb.externals_old,
-                                           new_externals,
+      SVN_ERR(svn_client__handle_externals(new_externals,
                                            new_depths,
                                            source_root, local_abspath,
                                            depth, use_sleep,

Modified: subversion/trunk/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/update.c?rev=1129290&r1=1129289&r2=1129290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/update.c (original)
+++ subversion/trunk/subversion/libsvn_client/update.c Mon May 30 18:50:53 2011
@@ -207,7 +207,6 @@ update_internal(svn_revnum_t *result_rev
   svn_ra_session_t *ra_session;
   const char *preserved_exts_str;
   apr_array_header_t *preserved_exts;
-  svn_client__external_func_baton_t efb;
   struct svn_client__dirent_fetcher_baton_t dfb;
   svn_boolean_t server_supports_depth;
   svn_boolean_t tree_conflicted;
@@ -364,12 +363,6 @@ update_internal(svn_revnum_t *result_rev
                                           local_abspath, ra_session, revision,
                                           pool));
 
-  /* Build a baton for the externals-info-gatherer callback. */
-  efb.externals_new = apr_hash_make(pool);
-  efb.externals_old = apr_hash_make(pool);
-  efb.ambient_depths = apr_hash_make(pool);
-  efb.result_pool = pool;
-
   SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
                                 SVN_RA_CAPABILITY_DEPTH, pool));
 
@@ -401,11 +394,6 @@ update_internal(svn_revnum_t *result_rev
                             depth_is_sticky ? depth : svn_depth_unknown,
                             FALSE, update_editor, update_edit_baton, pool));
 
-  SVN_ERR(svn_wc__externals_gather_definitions(&efb.externals_old,
-                                               &efb.ambient_depths,
-                                               ctx->wc_ctx, local_abspath,
-                                               depth, pool, pool));
-
   /* Drive the reporter structure, describing the revisions within
      PATH.  When we call reporter->finish_report, the
      update_editor will be driven by svn_repos_dir_delta2. */
@@ -438,9 +426,7 @@ update_internal(svn_revnum_t *result_rev
                                                    ctx->wc_ctx, local_abspath,
                                                    depth, pool, pool));
 
-      new_depths = apr_hash_overlay(pool, new_depths, efb.ambient_depths);
-      SVN_ERR(svn_client__handle_externals(efb.externals_old,
-                                           new_externals,
+      SVN_ERR(svn_client__handle_externals(new_externals,
                                            new_depths,
                                            repos_root, local_abspath,
                                            depth, use_sleep,