Author: cmpilato
Date: Fri Mar 18 02:52:57 2011
New Revision: 1082806

URL: http://svn.apache.org/viewvc?rev=1082806&view=rev
Log:
Eliminate another node walk, this time in the invalidate_wc_prop() RA
callback function.

* subversion/include/private/svn_wc_private.h,
* subversion/libsvn_wc/node.c
  (svn_wc__node_clear_dav_cache_recursive): New function.

* subversion/libsvn_client/ra.c
  (struct invalidate_wcprop_walk_baton, invalidate_wcprop_for_node):
    Remove as unused.
  (invalidate_wc_props): Trade a node walk for a one-stop recursive
    invalidation of the dav cache.

* notes/wc_node_walkers.txt
  Remove the description of this particular node walk.

Modified:
    subversion/trunk/notes/wc_node_walkers.txt
    subversion/trunk/subversion/include/private/svn_wc_private.h
    subversion/trunk/subversion/libsvn_client/ra.c
    subversion/trunk/subversion/libsvn_wc/node.c

Modified: subversion/trunk/notes/wc_node_walkers.txt
URL: 
http://svn.apache.org/viewvc/subversion/trunk/notes/wc_node_walkers.txt?rev=1082806&r1=1082805&r2=1082806&view=diff
==============================================================================
--- subversion/trunk/notes/wc_node_walkers.txt (original)
+++ subversion/trunk/notes/wc_node_walkers.txt Fri Mar 18 02:52:57 2011
@@ -54,12 +54,3 @@ subversion/libsvn_client/prop_commands.c
      restricted to those which match one of a specified set of
      changelists).  Stores results in a return hash -- no notification
      required.
-
-subversion/libsvn_client/ra.c
-
-   invalidate_wc_props() - Remove a particular property (by name) from
-     the dav cache of all items in a tree to infinite depth.  No
-     notifications.
-
-     NOTES: dav props are stored in a skel, so you can't simply whack
-     the specified prop in a relational fashion from the database.

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1082806&r1=1082805&r2=1082806&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Fri Mar 18 
02:52:57 2011
@@ -798,6 +798,15 @@ svn_wc__node_depth_is_exclude(svn_boolea
                               const char *local_abspath,
                               apr_pool_t *scratch_pool);
 
+/**
+ * Recursively clear the dav cache (wcprops) in @a wc_ctx for the tree
+ * rooted at @a local_abspath.
+ */
+svn_error_t *
+svn_wc__node_clear_dav_cache_recursive(svn_wc_context_t *wc_ctx,
+                                       const char *local_abspath,
+                                       apr_pool_t *scratch_pool);
+
 /* Set @ *min_revision and @ *max_revision to the lowest and highest revision
  * numbers found within @a local_abspath, using context @a wc_ctx.
  * If @ committed is TRUE, set @a *min_revision and @a *max_revision

Modified: subversion/trunk/subversion/libsvn_client/ra.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/ra.c?rev=1082806&r1=1082805&r2=1082806&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/ra.c (original)
+++ subversion/trunk/subversion/libsvn_client/ra.c Fri Mar 18 02:52:57 2011
@@ -201,43 +201,6 @@ set_wc_prop(void *baton,
 }
 
 
-struct invalidate_wcprop_walk_baton
-{
-  /* The wcprop to invalidate. */
-  const char *prop_name;
-
-  /* A context for accessing the working copy. */
-  svn_wc_context_t *wc_ctx;
-};
-
-
-/* This implements the `found_entry' prototype in
-   `svn_wc_entry_callbacks_t'. */
-static svn_error_t *
-invalidate_wcprop_for_node(const char *local_abspath,
-                           svn_node_kind_t kind,
-                           void *walk_baton,
-                           apr_pool_t *pool)
-{
-  struct invalidate_wcprop_walk_baton *wb = walk_baton;
-  svn_error_t *err;
-
-  /* It doesn't matter if we pass 0 or 1 for force here, since
-     property deletion is always permitted. */
-  err = svn_wc_prop_set4(wb->wc_ctx, local_abspath, wb->prop_name, NULL,
-                         FALSE, NULL, NULL, pool);
-  if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
-    {
-      svn_error_clear(err);
-      return SVN_NO_ERROR;
-    }
-  else if (err)
-    return svn_error_return(err);
-
-  return SVN_NO_ERROR;
-}
-
-
 /* This implements the `svn_ra_invalidate_wc_props_func_t' interface. */
 static svn_error_t *
 invalidate_wc_props(void *baton,
@@ -246,20 +209,20 @@ invalidate_wc_props(void *baton,
                     apr_pool_t *pool)
 {
   callback_baton_t *cb = baton;
-  struct invalidate_wcprop_walk_baton wb;
   const char *local_abspath;
 
-  wb.prop_name = prop_name;
-  wb.wc_ctx = cb->ctx->wc_ctx;
-
   local_abspath = svn_dirent_join(cb->base_dir_abspath, path, pool);
 
-  return svn_error_return(
-    svn_wc__node_walk_children(cb->ctx->wc_ctx, local_abspath, FALSE,
-                              invalidate_wcprop_for_node, &wb,
-                              svn_depth_infinity,
-                              cb->ctx->cancel_func, cb->ctx->cancel_baton,
-                              pool));
+  /* It's easier just to clear the whole dav_cache than to remove
+     individual items from it recursively like this.  And since we
+     know that the RA providers that ship with Subversion only
+     invalidate the one property they use the most from this cache,
+     and that we're intentionally trying to get away from the use of
+     the cache altogether anyway, there's little to lose in wiping the
+     whole cache.  Is it the most well-behaved approach to take?  Not
+     so much.  We choose not to care.  */
+  return svn_error_return(svn_wc__node_clear_dav_cache_recursive(
+                              cb->ctx->wc_ctx, local_abspath, pool));
 }
 
 

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1082806&r1=1082805&r2=1082806&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Fri Mar 18 02:52:57 2011
@@ -1524,3 +1524,11 @@ svn_wc__node_depth_is_exclude(svn_boolea
   return svn_error_return(err);
 }
 
+svn_error_t *
+svn_wc__node_clear_dav_cache_recursive(svn_wc_context_t *wc_ctx,
+                                       const char *local_abspath,
+                                       apr_pool_t *scratch_pool)
+{
+  return svn_error_return(svn_wc__db_base_clear_dav_cache_recursive(
+                              wc_ctx->db, local_abspath, scratch_pool));
+}


Reply via email to