Author: rhuijben
Date: Sun May 29 15:33:26 2011
New Revision: 1128892

URL: http://svn.apache.org/viewvc?rev=1128892&view=rev
Log:
Remove the svn:externals handling from the adm crawler and the status walker.
The new externals handling wants the old definition as stored in the db instead
of some old svn:externals value. (And its cheaper to query the new db table in
a specific query then to handle externals through the entire crawl).

Crawl the current svn:externals values from deprecated.c to keep the code
compatible with older api users.

* subversion/include/svn_wc.h
  (svn_wc_walk_status): Remove two arguments.
  (svn_wc_get_status_editor5): Remove two arguments.
  (svn_wc_crawl_revisions5): Remove two arguments.

* subversion/libsvn_client/diff.c
  (diff_repos_wc): Update caller.

* subversion/libsvn_client/merge.c
  (get_mergeinfo_paths): Update caller

* subversion/libsvn_client/patch.c
  (check_dir_empty): Update caller.

* subversion/libsvn_client/status.c
  (svn_client_status5): Update caller.

* subversion/libsvn_client/switch.c
  (switch_internal): Gather old values locally until we switch to format 29.

* subversion/libsvn_client/update.c
  (update_internal): Gather old values locally until we switch to format 29.

* subversion/libsvn_wc/adm_crawler.c
  (read_externals_info): Remove function.
  (report_revisions_and_depths): Remove 3 arguments. Update caller.
  (svn_wc_crawl_revisions5): Remove 2 arguments. Update caller.

* subversion/libsvn_wc/deprecated.c
  (gather_traversal_info): New function.
  (svn_wc_crawl_revisions4): Update caller.
  (svn_wc_get_status_editor4): Update caller.

* subversion/libsvn_wc/diff_local.c
  (svn_wc_diff6): Update caller.

* subversion/libsvn_wc/status.c
  (walk_status_baton): Remove callback.
  (handle_externals): Update caller.
  (close_edit): Update caller.
  (svn_wc_get_status_editor5): Remove 2 arguments.
  (svn_wc__internal_walk_status): Remove 2 arguments.
  (svn_wc_walk_status): Remove 2 arguments.

* subversion/libsvn_wc/update_editor.c
  (node_has_local_mods): Update caller.

* subversion/libsvn_wc/wc.h
  (svn_wc__internal_walk_status): Update prototype.

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_client/diff.c
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/libsvn_client/patch.c
    subversion/trunk/subversion/libsvn_client/status.c
    subversion/trunk/subversion/libsvn_client/switch.c
    subversion/trunk/subversion/libsvn_client/update.c
    subversion/trunk/subversion/libsvn_wc/adm_crawler.c
    subversion/trunk/subversion/libsvn_wc/deprecated.c
    subversion/trunk/subversion/libsvn_wc/diff_local.c
    subversion/trunk/subversion/libsvn_wc/externals.c
    subversion/trunk/subversion/libsvn_wc/status.c
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/libsvn_wc/wc.h

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Sun May 29 15:33:26 2011
@@ -3904,12 +3904,6 @@ typedef void (*svn_wc_status_func_t)(voi
  * If @a cancel_func is non-NULL, call it with @a cancel_baton while walking
  * to determine if the client has canceled the operation.
  *
- * If @a external_func is non-NULL and an external definition is found
- * while walking @a local_abspath, call @a external_func with @a
- * external_baton, with the local abspath on which the definition was
- * found, and with the current external definition provided as both
- * the @a old_val and @a new_val parameters of the callback function.
- *
  * This function uses @a scratch_pool for temporary allocations.
  *
  * @since New in 1.7.
@@ -3924,8 +3918,6 @@ svn_wc_walk_status(svn_wc_context_t *wc_
                    const apr_array_header_t *ignore_patterns,
                    svn_wc_status_func4_t status_func,
                    void *status_baton,
-                   svn_wc_external_update_t external_func,
-                   void *external_baton,
                    svn_cancel_func_t cancel_func,
                    void *cancel_baton,
                    apr_pool_t *scratch_pool);
@@ -3979,12 +3971,6 @@ svn_wc_walk_status(svn_wc_context_t *wc_
  * If @a cancel_func is non-NULL, call it with @a cancel_baton while building
  * the @a statushash to determine if the client has canceled the operation.
  *
- * If @a external_func is non-NULL and an external definition is found while
- * walking @a local_abspath, the editor will call @a external_func with @a
- * external_baton, with the local abspath on which the definition was
- * found, and with the current external definition provided as both
- * the @a old_val and @a new_val parameters of the callback function.
- *
  * If @a server_performs_filtering is TRUE, assume that the server handles
  * the ambient depth filtering, so this doesn't have to be handled in the
  * editor.
@@ -4009,8 +3995,6 @@ svn_wc_get_status_editor5(const svn_delt
                           const apr_array_header_t *ignore_patterns,
                           svn_wc_status_func4_t status_func,
                           void *status_baton,
-                          svn_wc_external_update_t external_func,
-                          void *external_baton,
                           svn_cancel_func_t cancel_func,
                           void *cancel_baton,
                           apr_pool_t *result_pool,
@@ -5088,12 +5072,6 @@ svn_wc_process_committed(const char *pat
  * use_commit_times is TRUE, then set restored files' timestamps to
  * their last-commit-times.
  *
- * If @a external_func is non-NULL and an external definition is found
- * while walking @a local_abspath, call @a external_func with @a
- * external_baton, with the local abspath on which the definition was
- * found, and with the current external definition provided as both
- * the @a old_val and @a new_val parameters of the callback function.
- *
  * @since New in 1.7.
  */
 svn_error_t *
@@ -5106,8 +5084,6 @@ svn_wc_crawl_revisions5(svn_wc_context_t
                         svn_boolean_t honor_depth_exclude,
                         svn_boolean_t depth_compatibility_trick,
                         svn_boolean_t use_commit_times,
-                        svn_wc_external_update_t external_func,
-                        void *external_baton,
                         svn_cancel_func_t cancel_func,
                         void *cancel_baton,
                         svn_wc_notify_func2_t notify_func,

Modified: subversion/trunk/subversion/libsvn_client/diff.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Sun May 29 15:33:26 2011
@@ -1920,9 +1920,10 @@ diff_repos_wc(const char *path1,
   SVN_ERR(svn_wc_crawl_revisions5(ctx->wc_ctx, abspath2,
                                   reporter, reporter_baton,
                                   FALSE, depth, TRUE, (! 
server_supports_depth),
-                                  FALSE, NULL, NULL, /* notification is N/A */
+                                  FALSE,
                                   ctx->cancel_func, ctx->cancel_baton,
-                                  NULL, NULL, pool));
+                                  NULL, NULL, /* notification is N/A */
+                                  pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Sun May 29 15:33:26 2011
@@ -5694,7 +5694,6 @@ get_mergeinfo_paths(apr_array_header_t *
                              depth, TRUE, TRUE, TRUE, NULL,
                              pre_merge_status_cb,
                              &pre_merge_status_baton,
-                             NULL, NULL,
                              merge_cmd_baton->ctx->cancel_func,
                              merge_cmd_baton->ctx->cancel_baton,
                              scratch_pool));

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Sun May 29 15:33:26 2011
@@ -2405,7 +2405,7 @@ check_dir_empty(svn_boolean_t *empty, co
   btn.result_pool = scratch_pool;
   SVN_ERR(svn_wc_walk_status(wc_ctx, local_abspath, svn_depth_immediates,
                              TRUE, TRUE, FALSE, NULL, find_existing_children,
-                             &btn, NULL, NULL, NULL, NULL, scratch_pool));
+                             &btn, NULL, NULL, scratch_pool));
   *empty = TRUE;
 
   /* Do we delete all children? */

Modified: subversion/trunk/subversion/libsvn_client/status.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/status.c?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/status.c (original)
+++ subversion/trunk/subversion/libsvn_client/status.c Sun May 29 15:33:26 2011
@@ -263,7 +263,6 @@ svn_client_status5(svn_revnum_t *result_
   apr_array_header_t *ignores;
   svn_error_t *err;
   apr_hash_t *changelist_hash = NULL;
-  struct svn_client__external_func_baton_t externals_store = { NULL };
 
   if (svn_path_is_url(path))
     return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
@@ -338,12 +337,6 @@ svn_client_status5(svn_revnum_t *result_
       sb.anchor_relpath = dir;
     }
 
-  if (!ignore_externals)
-    {
-      externals_store.result_pool = pool;
-      externals_store.externals_new = apr_hash_make(pool);
-    }
-
   /* Get the status edit, and use our wrapping status function/baton
      as the callback pair. */
   SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
@@ -386,10 +379,6 @@ svn_client_status5(svn_revnum_t *result_
                                     depth, get_all,
                                     no_ignore, server_supports_depth,
                                     ignores, tweak_status, &sb,
-                                    ignore_externals
-                                        ? NULL
-                                        : svn_client__external_info_gatherer,
-                                    ignore_externals ? NULL : &externals_store,
                                     ctx->cancel_func, ctx->cancel_baton,
                                     pool, pool));
 
@@ -470,7 +459,7 @@ svn_client_status5(svn_revnum_t *result_
                                           &lock_fetch_reporter, &rb, FALSE,
                                           depth, TRUE,
                                           (! server_supports_depth),
-                                          FALSE, NULL, NULL,
+                                          FALSE,
                                           ctx->cancel_func, ctx->cancel_baton,
                                           NULL, NULL, pool));
         }
@@ -493,10 +482,6 @@ svn_client_status5(svn_revnum_t *result_
       err = svn_wc_walk_status(ctx->wc_ctx, target_abspath,
                                depth, get_all, no_ignore, FALSE, ignores,
                                tweak_status, &sb,
-                               ignore_externals
-                                   ? NULL
-                                   : svn_client__external_info_gatherer,
-                               ignore_externals ? NULL : &externals_store,
                                ctx->cancel_func, ctx->cancel_baton,
                                pool);
 
@@ -527,10 +512,18 @@ svn_client_status5(svn_revnum_t *result_
      in the future.
   */
   if (SVN_DEPTH_IS_RECURSIVE(depth) && (! ignore_externals))
-    SVN_ERR(svn_client__do_external_status(ctx, externals_store.externals_new,
-                                           depth, get_all,
-                                           update, no_ignore,
-                                           status_func, status_baton, pool));
+    {
+      apr_hash_t *externals_new;
+      SVN_ERR(svn_wc__externals_gather_definitions(&externals_new, NULL,
+                                                   ctx->wc_ctx, target_abspath,
+                                                   depth, pool, pool));
+
+
+      SVN_ERR(svn_client__do_external_status(ctx, externals_new,
+                                             depth, get_all,
+                                             update, no_ignore,
+                                             status_func, status_baton, pool));
+    }
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_client/switch.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/switch.c?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/switch.c (original)
+++ subversion/trunk/subversion/libsvn_client/switch.c Sun May 29 15:33:26 2011
@@ -244,7 +244,7 @@ switch_internal(svn_revnum_t *result_rev
                                     diff3_cmd, preserved_exts,
                                     svn_client__dirent_fetcher, &dfb,
                                     ctx->conflict_func2, ctx->conflict_baton2,
-                                    svn_client__external_info_gatherer, &efb,
+                                    NULL, NULL,
                                     ctx->cancel_func, ctx->cancel_baton,
                                     ctx->notify_func2, ctx->notify_baton2,
                                     pool, pool));
@@ -257,6 +257,11 @@ 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.
@@ -269,7 +274,6 @@ switch_internal(svn_revnum_t *result_rev
                                 report_baton, TRUE, depth, (! depth_is_sticky),
                                 (! server_supports_depth),
                                 use_commit_times,
-                                svn_client__external_info_gatherer, &efb,
                                 ctx->cancel_func, ctx->cancel_baton,
                                 ctx->notify_func2, ctx->notify_baton2, pool);
 

Modified: subversion/trunk/subversion/libsvn_client/update.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/update.c?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/update.c (original)
+++ subversion/trunk/subversion/libsvn_client/update.c Sun May 29 15:33:26 2011
@@ -389,10 +389,7 @@ update_internal(svn_revnum_t *result_rev
                                     diff3_cmd, preserved_exts,
                                     svn_client__dirent_fetcher, &dfb,
                                     ctx->conflict_func2, ctx->conflict_baton2,
-                                    ignore_externals
-                                        ? NULL
-                                        : svn_client__external_info_gatherer,
-                                    &efb,
+                                    NULL, NULL,
                                     ctx->cancel_func, ctx->cancel_baton,
                                     ctx->notify_func2, ctx->notify_baton2,
                                     pool, pool));
@@ -404,6 +401,11 @@ 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. */
@@ -411,10 +413,7 @@ update_internal(svn_revnum_t *result_rev
                                 report_baton, TRUE, depth, (! depth_is_sticky),
                                 (! server_supports_depth),
                                 use_commit_times,
-                                ignore_externals
-                                        ? NULL
-                                        : svn_client__external_info_gatherer,
-                                &efb, ctx->cancel_func, ctx->cancel_baton,
+                                ctx->cancel_func, ctx->cancel_baton,
                                 ctx->notify_func2, ctx->notify_baton2,
                                 pool);
 

Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Sun May 29 15:33:26 2011
@@ -189,41 +189,6 @@ restore_node(svn_wc__db_t *db,
   return SVN_NO_ERROR;
 }
 
-/* Check if there is an externals definition stored on LOCAL_ABSPATH
-   using DB.  In that case send the externals definition and DEPTH to
-   EXTERNAL_FUNC.  Use SCRATCH_POOL for temporary allocations. */
-static svn_error_t *
-read_externals_info(svn_wc__db_t *db,
-                    const char *local_abspath,
-                    svn_wc_external_update_t external_func,
-                    void *external_baton,
-                    svn_depth_t depth,
-                    apr_pool_t *scratch_pool)
-{
-  apr_hash_t *props;
-  const svn_string_t *val;
-
-  SVN_ERR_ASSERT(external_func != NULL);
-
-  /* Directly use a DB api here as this code path is extensively used on
-     update. On top of that we already know that this an existing directory. */
-  SVN_ERR(svn_wc__db_base_get_props(&props, db, local_abspath,
-                                    scratch_pool, scratch_pool));
-
-  if (!props)
-    return SVN_NO_ERROR;
-
-  val = apr_hash_get(props, SVN_PROP_EXTERNALS, APR_HASH_KEY_STRING);
-
-  if (val)
-    {
-      SVN_ERR((external_func)(external_baton, local_abspath, val, val, depth,
-                              scratch_pool));
-    }
-
-  return SVN_NO_ERROR;
-}
-
 /* The recursive crawler that describes a mixed-revision working
    copy to an RA layer.  Used to initiate updates.
 
@@ -264,9 +229,6 @@ read_externals_info(svn_wc__db_t *db,
    DEPTH_COMPATIBILITY_TRICK means the same thing here as it does
    in svn_wc_crawl_revisions5().
 
-   If EXTERNAL_FUNC is non-NULL, then send externals information with
-   the help of EXTERNAL_BATON
-
    If RESTORE_FILES is set, then unexpectedly missing working files
    will be restored from text-base and NOTIFY_FUNC/NOTIFY_BATON
    will be called to report the restoration.  USE_COMMIT_TIMES is
@@ -287,9 +249,6 @@ report_revisions_and_depths(svn_wc__db_t
                             svn_boolean_t depth_compatibility_trick,
                             svn_boolean_t report_everything,
                             svn_boolean_t use_commit_times,
-                            svn_boolean_t had_props,
-                            svn_wc_external_update_t external_func,
-                            void *external_baton,
                             svn_cancel_func_t cancel_func,
                             void *cancel_baton,
                             svn_wc_notify_func2_t notify_func,
@@ -328,12 +287,6 @@ report_revisions_and_depths(svn_wc__db_t
 
   /*** Do the real reporting and recursing. ***/
 
-  /* If "this dir" has "svn:externals" property set on it,
-   * call the external_func callback. */
-  if (external_func && had_props)
-    SVN_ERR(read_externals_info(db, dir_abspath, external_func,
-                                external_baton, dir_depth, iterpool));
-
   /* Looping over current directory's BASE children: */
   for (hi = apr_hash_first(scratch_pool, base_children); 
        hi != NULL;
@@ -636,9 +589,6 @@ report_revisions_and_depths(svn_wc__db_t
                                                   depth_compatibility_trick,
                                                   start_empty,
                                                   use_commit_times,
-                                                  ths->had_props,
-                                                  external_func,
-                                                  external_baton,
                                                   cancel_func, cancel_baton,
                                                   notify_func, notify_baton,
                                                   iterpool));
@@ -667,8 +617,6 @@ svn_wc_crawl_revisions5(svn_wc_context_t
                         svn_boolean_t honor_depth_exclude,
                         svn_boolean_t depth_compatibility_trick,
                         svn_boolean_t use_commit_times,
-                        svn_wc_external_update_t external_func,
-                        void *external_baton,
                         svn_cancel_func_t cancel_func,
                         void *cancel_baton,
                         svn_wc_notify_func2_t notify_func,
@@ -685,7 +633,6 @@ svn_wc_crawl_revisions5(svn_wc_context_t
   svn_depth_t target_depth;
   svn_wc__db_lock_t *target_lock;
   svn_node_kind_t disk_kind;
-  svn_boolean_t had_props;
   svn_depth_t report_depth;
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
@@ -696,7 +643,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
                                  &repos_relpath, &repos_root_url,
                                  NULL, NULL, NULL, NULL, &target_depth,
                                  NULL, NULL, &target_lock,
-                                 &had_props, NULL, NULL,
+                                 NULL, NULL, NULL,
                                  db, local_abspath, scratch_pool,
                                  scratch_pool);
 
@@ -823,8 +770,6 @@ svn_wc_crawl_revisions5(svn_wc_context_t
                                             depth_compatibility_trick,
                                             start_empty,
                                             use_commit_times,
-                                            had_props,
-                                            external_func, external_baton,
                                             cancel_func, cancel_baton,
                                             notify_func, notify_baton,
                                             scratch_pool);

Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Sun May 29 15:33:26 2011
@@ -104,6 +104,57 @@ traversal_info_update(void *baton,
   return SVN_NO_ERROR;
 }
 
+/* Helper for functions that used to gather traversal_info */
+svn_error_t *
+gather_traversal_info(svn_wc_context_t *wc_ctx,
+                      const char *local_abspath,
+                      const char *path,
+                      svn_depth_t depth,
+                      struct svn_wc_traversal_info_t *traversal_info,
+                      svn_boolean_t gather_as_old,
+                      svn_boolean_t gather_as_new,
+                      apr_pool_t *scratch_pool)
+{
+  apr_hash_t *externals;
+  apr_hash_t *ambient_depths;
+  apr_hash_index_t *hi;
+
+  SVN_ERR(svn_wc__externals_gather_definitions(&externals, &ambient_depths,
+                                               wc_ctx, local_abspath,
+                                               depth,
+                                               scratch_pool, scratch_pool));
+
+  for (hi = apr_hash_first(scratch_pool, externals);
+       hi;
+       hi = apr_hash_next(hi))
+    {
+      const char *node_abspath = svn__apr_hash_index_key(hi);
+      const char *relpath;
+
+      relpath = svn_dirent_join(path,
+                                svn_dirent_skip_ancestor(local_abspath,
+                                                         node_abspath),
+                                traversal_info->pool);
+
+      if (gather_as_old)
+        apr_hash_set(traversal_info->externals_old,
+                     relpath, APR_HASH_KEY_STRING,
+                     svn__apr_hash_index_val(hi));
+
+      if (gather_as_new)
+        apr_hash_set(traversal_info->externals_new,
+                     relpath, APR_HASH_KEY_STRING,
+                     svn__apr_hash_index_val(hi));
+
+      apr_hash_set(traversal_info->depths,
+                   relpath, APR_HASH_KEY_STRING,
+                   apr_hash_get(ambient_depths, node_abspath,
+                                APR_HASH_KEY_STRING));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 
 /*** From adm_crawler.c ***/
 
@@ -125,21 +176,10 @@ svn_wc_crawl_revisions4(const char *path
   svn_wc_context_t *wc_ctx;
   svn_wc__db_t *wc_db = svn_wc__adm_get_db(adm_access);
   const char *local_abspath;
-  svn_wc_external_update_t external_func = NULL;
-  struct traversal_info_update_baton *eb = NULL;
 
   SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL, wc_db, pool));
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
 
-  if (traversal_info)
-    {
-      eb = apr_palloc(pool, sizeof(*eb));
-      eb->traversal = traversal_info;
-      eb->db = wc_db;
-
-      external_func = traversal_info_update;
-    }
-
   SVN_ERR(svn_wc_crawl_revisions5(wc_ctx,
                                   local_abspath,
                                   reporter,
@@ -149,14 +189,16 @@ svn_wc_crawl_revisions4(const char *path
                                   honor_depth_exclude,
                                   depth_compatibility_trick,
                                   use_commit_times,
-                                  external_func,
-                                  eb,
                                   NULL /* cancel_func */,
                                   NULL /* cancel_baton */,
                                   notify_func,
                                   notify_baton,
                                   pool));
 
+  if (traversal_info)
+    SVN_ERR(gather_traversal_info(wc_ctx, local_abspath, path, depth,
+                                  traversal_info, TRUE, FALSE, pool));
+
   return svn_error_return(svn_wc_context_destroy(wc_ctx));
 }
 
@@ -2563,8 +2605,6 @@ svn_wc_get_status_editor4(const svn_delt
   struct status4_wrapper_baton *swb = apr_palloc(pool, sizeof(*swb));
   svn_wc__db_t *wc_db;
   svn_wc_context_t *wc_ctx;
-  svn_wc_external_update_t external_func = NULL;
-  struct traversal_info_update_baton *eb = NULL;
   const char *anchor_abspath;
 
   swb->old_func = status_func;
@@ -2590,15 +2630,6 @@ svn_wc_get_status_editor4(const svn_delt
       swb->anchor_relpath = NULL;
     }
 
-  if (traversal_info)
-    {
-      eb = apr_palloc(pool, sizeof(*eb));
-      eb->traversal = traversal_info;
-      eb->db = wc_db;
-
-      external_func = traversal_info_update;
-    }
-
   SVN_ERR(svn_wc_get_status_editor5(editor, edit_baton, set_locks_baton,
                                     edit_revision, wc_ctx, anchor_abspath,
                                     target, depth, get_all,
@@ -2606,10 +2637,24 @@ svn_wc_get_status_editor4(const svn_delt
                                     FALSE /* server_performs_filtering */,
                                     ignore_patterns,
                                     status4_wrapper_func, swb,
-                                    external_func, eb,
                                     cancel_func, cancel_baton,
                                     pool, pool));
 
+  if (traversal_info)
+    {
+      const char *local_path = svn_wc_adm_access_path(anchor);
+      const char *local_abspath = anchor_abspath;
+      if (*target)
+        {
+          local_path = svn_dirent_join(local_path, target, pool);
+          local_abspath = svn_dirent_join(local_abspath, target, pool);
+        }
+
+      SVN_ERR(gather_traversal_info(wc_ctx, local_abspath, local_path, depth,
+                                    traversal_info, TRUE, TRUE,
+                                    pool));
+    }
+
   /* We can't destroy wc_ctx here, because the editor needs it while it's
      driven. */
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/libsvn_wc/diff_local.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/diff_local.c?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/trunk/subversion/libsvn_wc/diff_local.c Sun May 29 15:33:26 2011
@@ -560,9 +560,7 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
                                        TRUE /* no_ignore */,
                                        FALSE /* ignore_text_mods */,
                                        NULL /* ignore_patterns */,
-                                       diff_status_callback,
-                                       &eb,
-                                       NULL, NULL, /* external func & baton */
+                                       diff_status_callback, &eb,
                                        cancel_func, cancel_baton,
                                        scratch_pool));
 

Modified: subversion/trunk/subversion/libsvn_wc/externals.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/externals.c?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/externals.c (original)
+++ subversion/trunk/subversion/libsvn_wc/externals.c Sun May 29 15:33:26 2011
@@ -1245,18 +1245,28 @@ svn_wc__externals_gather_definitions(apr
   else
     {
       const svn_string_t *value;
+      svn_error_t *err;
       *externals = apr_hash_make(result_pool);
 
       local_abspath = apr_pstrdup(result_pool, local_abspath);
 
-      SVN_ERR(svn_wc_prop_get2(&value, wc_ctx, local_abspath,
-                               SVN_PROP_EXTERNALS, result_pool, scratch_pool));
+      err = svn_wc_prop_get2(&value, wc_ctx, local_abspath,
+                             SVN_PROP_EXTERNALS, result_pool, scratch_pool);
+
+      if (err)
+        {
+          if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+            return svn_error_return(err);
+
+          svn_error_clear(err);
+          value = NULL;
+        }
 
       if (value)
         apr_hash_set(*externals, local_abspath, APR_HASH_KEY_STRING,
                      value->data);
 
-      if (depths)
+      if (value && depths)
         {
           svn_depth_t node_depth;
           *depths = apr_hash_make(result_pool);

Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Sun May 29 15:33:26 2011
@@ -71,10 +71,6 @@ struct walk_status_baton
   /* Externals info harvested during the status run. */
   apr_hash_t *externals;
 
-  /* Externals function/baton */
-  svn_wc_external_update_t external_func;
-  void *external_baton;
-
   /*** Repository lock handling ***/
   /* The repository root URL, if set. */
   const char *repos_root;
@@ -986,14 +982,6 @@ handle_externals(const struct walk_statu
       apr_array_header_t *ext_items;
       int i;
 
-      if (wb->external_func &&
-          svn_dirent_is_ancestor(wb->target_abspath, local_abspath))
-        {
-          SVN_ERR((wb->external_func)(wb->external_baton, local_abspath,
-                                      prop_val, prop_val, depth,
-                                      scratch_pool));
-        }
-
       /* Now, parse the thing, and copy the parsed results into
          our "global" externals hash. */
       SVN_ERR(svn_wc_parse_externals_description3(&ext_items, local_abspath,
@@ -2194,8 +2182,6 @@ close_edit(void *edit_baton,
                              eb->ignores,
                              eb->status_func,
                              eb->status_baton,
-                             eb->wb.external_func,
-                             eb->wb.external_baton,
                              eb->cancel_func,
                              eb->cancel_baton,
                              pool));
@@ -2222,8 +2208,6 @@ svn_wc_get_status_editor5(const svn_delt
                           const apr_array_header_t *ignore_patterns,
                           svn_wc_status_func4_t status_func,
                           void *status_baton,
-                          svn_wc_external_update_t external_func,
-                          void *external_baton,
                           svn_cancel_func_t cancel_func,
                           void *cancel_baton,
                           apr_pool_t *result_pool,
@@ -2256,8 +2240,6 @@ svn_wc_get_status_editor5(const svn_delt
   eb->wb.db               = wc_ctx->db;
   eb->wb.target_abspath   = eb->target_abspath;
   eb->wb.ignore_text_mods = FALSE;
-  eb->wb.external_func    = external_func;
-  eb->wb.external_baton   = external_baton;
   eb->wb.externals        = apr_hash_make(result_pool);
   eb->wb.repos_locks      = NULL;
   eb->wb.repos_root       = NULL;
@@ -2332,8 +2314,6 @@ svn_wc__internal_walk_status(svn_wc__db_
                              const apr_array_header_t *ignore_patterns,
                              svn_wc_status_func4_t status_func,
                              void *status_baton,
-                             svn_wc_external_update_t external_func,
-                             void *external_baton,
                              svn_cancel_func_t cancel_func,
                              void *cancel_baton,
                              apr_pool_t *scratch_pool)
@@ -2348,8 +2328,6 @@ svn_wc__internal_walk_status(svn_wc__db_
   wb.target_abspath = local_abspath;
   wb.ignore_text_mods = ignore_text_mods;
   wb.externals = apr_hash_make(scratch_pool);
-  wb.external_func = external_func;
-  wb.external_baton = external_baton;
   wb.repos_root = NULL;
   wb.repos_locks = NULL;
 
@@ -2413,8 +2391,6 @@ svn_wc_walk_status(svn_wc_context_t *wc_
                    const apr_array_header_t *ignore_patterns,
                    svn_wc_status_func4_t status_func,
                    void *status_baton,
-                   svn_wc_external_update_t external_func,
-                   void *external_baton,
                    svn_cancel_func_t cancel_func,
                    void *cancel_baton,
                    apr_pool_t *scratch_pool)
@@ -2429,8 +2405,6 @@ svn_wc_walk_status(svn_wc_context_t *wc_
                                         ignore_patterns,
                                         status_func,
                                         status_baton,
-                                        external_func,
-                                        external_baton,
                                         cancel_func,
                                         cancel_baton,
                                         scratch_pool));

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Sun May 29 15:33:26 
2011
@@ -1183,7 +1183,6 @@ node_has_local_mods(svn_boolean_t *modif
                                      svn_depth_infinity,
                                      FALSE, FALSE, FALSE, NULL,
                                      modcheck_callback, &modcheck_baton,
-                                     NULL, NULL,
                                      cancel_func, cancel_baton,
                                      scratch_pool);
 

Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1128892&r1=1128891&r2=1128892&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Sun May 29 15:33:26 2011
@@ -542,8 +542,6 @@ svn_wc__internal_walk_status(svn_wc__db_
                              const apr_array_header_t *ignore_patterns,
                              svn_wc_status_func4_t status_func,
                              void *status_baton,
-                             svn_wc_external_update_t external_func,
-                             void *external_baton,
                              svn_cancel_func_t cancel_func,
                              void *cancel_baton,
                              apr_pool_t *scratch_pool);


Reply via email to