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 2010/06/24 21:18:08 UTC

svn commit: r957688 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_wc/node.c

Author: rhuijben
Date: Thu Jun 24 19:18:07 2010
New Revision: 957688

URL: http://svn.apache.org/viewvc?rev=957688&view=rev
Log:
* subversion/include/private/svn_wc_private.h
  (svn_wc__node_walk_children): Update comment.

* subversion/libsvn_wc/node.c
  (svn_wc__node_walk_children): Assert passed depths are valid and properly
    check for hidden nodes instead of only checking the depth value
    for excluded.

Modified:
    subversion/trunk/subversion/include/private/svn_wc_private.h
    subversion/trunk/subversion/libsvn_wc/node.c

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=957688&r1=957687&r2=957688&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Thu Jun 24 19:18:07 2010
@@ -374,8 +374,8 @@ svn_wc__node_get_copyfrom_info(const cha
                                apr_pool_t *scratch_pool);
 
 /**
- * Recursively call @a callbacks->found_node for all nodes underneath
- * @a local_abspath.
+ * Recursively call @a walk_callback for all nodes underneath
+ * @a local_abspath, restricted by @a walk_depth.
  */
 svn_error_t *
 svn_wc__node_walk_children(svn_wc_context_t *wc_ctx,

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=957688&r1=957687&r2=957688&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Thu Jun 24 19:18:07 2010
@@ -622,26 +622,28 @@ svn_wc__internal_walk_children(svn_wc__d
                                apr_pool_t *scratch_pool)
 {
   svn_wc__db_kind_t kind;
-  svn_depth_t depth;
+  svn_wc__db_status_t status;
+
+  SVN_ERR_ASSERT(walk_depth >= svn_depth_empty
+                 && walk_depth <= svn_depth_infinity);
 
-  SVN_ERR(svn_wc__db_read_info(NULL, &kind, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, &depth, NULL,
+  /* Check if the node exists before the first callback */
+  SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL,
                                db, local_abspath, scratch_pool, scratch_pool));
 
-  if (kind == svn_wc__db_kind_file || depth == svn_depth_exclude)
-    {
-      return svn_error_return(
-        walk_callback(local_abspath, walk_baton, scratch_pool));
-    }
+  SVN_ERR(walk_callback(local_abspath, walk_baton, scratch_pool));
+
+  if (kind == svn_wc__db_kind_file
+      || status == svn_wc__db_status_not_present
+      || status == svn_wc__db_status_excluded
+      || status == svn_wc__db_status_absent)
+    return SVN_NO_ERROR;
 
   if (kind == svn_wc__db_kind_dir)
     {
-      /* Return the directory first, before starting recursion, since it
-         won't get returned as part of the recursion. */
-      SVN_ERR(walk_callback(local_abspath, walk_baton, scratch_pool));
-
       return svn_error_return(
         walker_helper(db, local_abspath, show_hidden, walk_callback, walk_baton,
                       walk_depth, cancel_func, cancel_baton, scratch_pool));