You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@gmail.com> on 2009/08/23 18:38:58 UTC

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

On Tue, Aug 18, 2009 at 23:08, Paul T. Burba<pb...@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


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

Posted by Paul Burba <pt...@gmail.com>.
On Sun, Aug 23, 2009 at 2:38 PM, Greg Stein<gs...@gmail.com> wrote:
> On Tue, Aug 18, 2009 at 23:08, Paul T. Burba<pb...@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

Hi Greg,

Thanks for catching this.  I fixed it in r38921, but in a slightly
different way than you suggest: We can simply pass the PATH argument
to svn_client__update_internal().

Paul

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2386753