Index: subversion/include/private/svn_wc_private.h =================================================================== --- subversion/include/private/svn_wc_private.h (revision 38776) +++ subversion/include/private/svn_wc_private.h (working copy) @@ -338,6 +338,19 @@ apr_pool_t *scratch_pool); +/** + * Set @a kind to the @c svn_node_kind_t of @a abspath. Use @a wc_ctx + * to access the working copy, and @a scratch_pool for all temporary + * allocations. + * + * @since New in 1.7. + */ +svn_error_t * +svn_wc__node_get_kind(svn_node_kind_t *kind, + svn_wc_context_t *wc_ctx, + const char *abspath, + apr_pool_t *scratch_pool); + #ifdef __cplusplus } #endif /* __cplusplus */ Index: subversion/libsvn_client/export.c =================================================================== --- subversion/libsvn_client/export.c (revision 38776) +++ subversion/libsvn_client/export.c (working copy) @@ -334,7 +334,7 @@ { const char *child_abspath = APR_ARRAY_IDX(children, j, const char *); const char *child_basename; - const svn_wc_entry_t *child_entry; + svn_node_kind_t child_kind; svn_pool_clear(iterpool); child_basename = svn_dirent_basename(child_abspath, iterpool); @@ -345,21 +345,10 @@ /* ### We could also invoke ctx->notify_func somewhere in ### here... Is it called for, though? Not sure. */ - err = svn_wc__get_entry_versioned(&child_entry, ctx->wc_ctx, - child_abspath, svn_node_unknown, - FALSE, FALSE, iterpool, - iterpool); - if (err && err->apr_err == SVN_ERR_ENTRY_NOT_FOUND) - { - /* We don't want "hidden" entries, so just clear the error and - continue on our merry way. */ - svn_error_clear(err); - continue; - } - else if (err) - return svn_error_return(err); + SVN_ERR(svn_wc__node_get_kind(&child_kind, ctx->wc_ctx, + child_abspath, iterpool)); - if (child_entry->kind == svn_node_dir) + if (child_kind == svn_node_dir) { if (depth == svn_depth_infinity) { @@ -374,7 +363,7 @@ native_eol, ctx, iterpool)); } } - else if (child_entry->kind == svn_node_file) + else if (child_kind == svn_node_file) { const char *new_from_abspath; const char *new_to_abspath; Index: subversion/libsvn_client/merge.c =================================================================== --- subversion/libsvn_client/merge.c (revision 38776) +++ subversion/libsvn_client/merge.c (working copy) @@ -4017,29 +4017,37 @@ /* Helper for record_mergeinfo_for_dir_merge(). Adjust, in place, the inheritability of the ranges in RANGELIST to - describe a merge of RANGELIST into WC_WCPATH at depth DEPTH. ENTRY - is the entry for WC_PATH. + describe a merge of RANGELIST into WC_WCPATH at depth DEPTH. WC_PATH_IS_MERGE_TARGET is true if WC_PATH is the target of the merge, otherwise WC_PATH is a subtree. WC_PATH_HAS_MISSING_CHILD is true if WC_PATH is missing an immediate child because the child is switched or absent from the WC, or due to a sparse - checkout -- see get_mergeinfo_paths(). */ + checkout -- see get_mergeinfo_paths(). + + Perform any temporary allocations in SCRATCH_POOL. */ static svn_error_t * calculate_merge_inheritance(apr_array_header_t *rangelist, const char *wc_path, - const svn_wc_entry_t *entry, svn_boolean_t wc_path_is_merge_target, svn_boolean_t wc_path_has_missing_child, - svn_depth_t depth) + svn_depth_t depth, + svn_wc_context_t *wc_ctx, + apr_pool_t * scratch_pool) { - if (entry->kind == svn_node_file) + const char * wc_abspath; + svn_node_kind_t path_kind; + + SVN_ERR(svn_dirent_get_absolute(&wc_abspath, wc_path, scratch_pool)); + SVN_ERR(svn_wc__node_get_kind(&path_kind, wc_ctx, wc_abspath, + scratch_pool)); + if (path_kind == svn_node_file) { /* Files *never* have non-inheritable mergeinfo. */ svn_rangelist__set_inheritance(rangelist, TRUE); } - else if (entry->kind == svn_node_dir) + else if (path_kind == svn_node_dir) { if (wc_path_is_merge_target) { @@ -5441,12 +5449,11 @@ is svn_depth_files. */ if (depth == svn_depth_files) { - const svn_wc_entry_t *child_entry; - SVN_ERR(svn_wc__get_entry_versioned( - &child_entry, merge_cmd_baton->ctx->wc_ctx, - child_abspath, svn_node_unknown, - FALSE, FALSE, iterpool, iterpool)); - if (child_entry->kind != svn_node_file) + svn_node_kind_t child_kind; + SVN_ERR(svn_wc__node_get_kind( + &child_kind, merge_cmd_baton->ctx->wc_ctx, + child_abspath, iterpool)); + if (child_kind != svn_node_file) continue; } /* else DEPTH is infinity or immediates so we want both @@ -6801,9 +6808,11 @@ SVN_ERR(calculate_merge_inheritance(child_merge_rangelist, child->path, - child_entry, i == 0, + i == 0, child->missing_child, - depth)); + depth, + merge_b->ctx->wc_ctx, + iterpool)); /* If CHILD has indirect mergeinfo set it before recording the first merge range. */ Index: subversion/libsvn_client/switch.c =================================================================== --- subversion/libsvn_client/switch.c (revision 38776) +++ subversion/libsvn_client/switch.c (working copy) @@ -196,20 +196,18 @@ /* We may need to crop the tree if the depth is sticky */ if (depth_is_sticky && depth < svn_depth_infinity) { - const svn_wc_entry_t *target_entry; + const char *target_abspath; + svn_node_kind_t target_kind; - SVN_ERR(svn_wc_entry( - &target_entry, - svn_dirent_join(svn_wc_adm_access_path(adm_access), target, pool), - adm_access, TRUE, pool)); + SVN_ERR(svn_dirent_get_absolute(&target_abspath, target, pool)); + SVN_ERR(svn_wc__node_get_kind(&target_kind, ctx->wc_ctx, + target_abspath, pool)); - if (target_entry && target_entry->kind == svn_node_dir) - { - SVN_ERR(svn_wc_crop_tree(adm_access, target, depth, - ctx->notify_func2, ctx->notify_baton2, - ctx->cancel_func, ctx->cancel_baton, - pool)); - } + if (target_kind == svn_node_dir) + SVN_ERR(svn_wc_crop_tree(adm_access, target, depth, + ctx->notify_func2, ctx->notify_baton2, + ctx->cancel_func, ctx->cancel_baton, + pool)); } SVN_ERR(svn_ra_reparent(ra_session, URL, pool)); Index: subversion/libsvn_client/update.c =================================================================== --- subversion/libsvn_client/update.c (revision 38776) +++ subversion/libsvn_client/update.c (working copy) @@ -188,12 +188,15 @@ /* We may need to crop the tree if the depth is sticky */ if (depth_is_sticky && depth < svn_depth_infinity) { - const svn_wc_entry_t *target_entry; - SVN_ERR(svn_wc_entry(&target_entry, - svn_dirent_join(anchor, target, pool), - adm_access, TRUE, pool)); + const char *target_abspath; + svn_node_kind_t target_kind; - if (target_entry && target_entry->kind == svn_node_dir) + SVN_ERR(svn_dirent_get_absolute(&target_abspath, + svn_dirent_join(anchor, target, pool), + pool)); + SVN_ERR(svn_wc__node_get_kind(&target_kind, ctx->wc_ctx, + target_abspath, pool)); + if (target_kind == svn_node_dir) { SVN_ERR(svn_wc_crop_tree(adm_access, target, depth, ctx->notify_func2, ctx->notify_baton2, Index: subversion/libsvn_wc/node.c =================================================================== --- subversion/libsvn_wc/node.c (revision 38776) +++ subversion/libsvn_wc/node.c (working copy) @@ -113,3 +113,41 @@ return err; } +svn_error_t * +svn_wc__node_get_kind(svn_node_kind_t *kind, + svn_wc_context_t *wc_ctx, + const char *abspath, + apr_pool_t *scratch_pool) +{ + { + svn_wc__db_kind_t db_kind; + + SVN_ERR(svn_wc__db_check_node(&db_kind, wc_ctx->db, abspath, + scratch_pool)); + switch (db_kind) + { + case svn_wc__db_kind_file: + *kind = svn_node_file; + break; + case svn_wc__db_kind_dir: + *kind = svn_node_dir; + break; + default: + *kind = svn_node_unknown; + } + } + + /* If we found a svn_node_file or svn_node_dir, but it is hidden, + then consider *KIND to be svn_node_none. */ + if (*kind == svn_node_file || *kind == svn_node_dir) + { + svn_boolean_t hidden; + + SVN_ERR(svn_wc__db_node_hidden(&hidden, wc_ctx->db, abspath, + scratch_pool)); + if (hidden) + *kind = svn_node_none; + } + + return SVN_NO_ERROR; +}