[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r38830 - in trunk/subversion: include/private libsvn_client libsvn_wc

From: Greg Stein <gstein_at_gmail.com>
Date: Sun, 23 Aug 2009 18:38:58 +0000

On Tue, Aug 18, 2009 at 23:08, Paul T. Burba<pburba_at_collab.net> wrote:
>...
> +++ trunk/subversion/libsvn_client/switch.c     Tue Aug 18 16:08:45 2009        (r38830)
> @@ -196,20 +196,18 @@ svn_client__switch_internal(svn_revnum_t
>   /* 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));

Target is relative to the access baton's directory.

> -
> -      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));
> -        }
> +      SVN_ERR(svn_dirent_get_absolute(&target_abspath, target, pool));

Thus: this is not going to work correctly.

I'd suggest:

  target_abspath = svn_dirent_join(svn_wc__adm_access_abspath(...), target, ...)

> +      SVN_ERR(svn_wc__node_get_kind(&target_kind, ctx->wc_ctx,
> +                                    target_abspath, TRUE, 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));
>     }

>...

Cheers,
-g

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2386551
Received on 2009-08-23 20:39:23 CEST

This is an archived mail posted to the Subversion Dev mailing list.