You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Noorul Islam K M <no...@collab.net> on 2010/11/04 09:44:38 UTC

Re: Canonicalize path/URL inside svn_opt__split_arg_at_peg_revision

Noorul Islam K M <no...@collab.net> writes:

> Log 
>
> [[[
>
> Since svn_opt__split_arg_at_peg_revision() is called from two major
> wrappers svn_opt__args_to_target_array() and svn_opt_parse_path(), move
> canonicalize code into svn_opt__split_arg_at_peg_revision().
>
> * subversion/libsvn_subr/opt.c
>   (svn_opt__split_arg_at_peg_revision): Canonicalize path/URL.
>   (svn_opt__args_to_target_array): No need to canonicalize path/URL as
>   the code is now in svn_opt__split_arg_at_peg_revision().
>
> Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
>
> ]]]
>

Forgot to wrap calls inside SVN_ERR(). Please ignore last
patch. Attached is the updated one.

Thanks and Regards
Noorul


Re: Canonicalize path/URL inside svn_opt__split_arg_at_peg_revision

Posted by Noorul Islam K M <no...@collab.net>.
Noorul Islam K M <no...@collab.net> writes:

> Noorul Islam K M <no...@collab.net> writes:
>
>> Log 
>>
>> [[[
>>
>> Since svn_opt__split_arg_at_peg_revision() is called from two major
>> wrappers svn_opt__args_to_target_array() and svn_opt_parse_path(), move
>> canonicalize code into svn_opt__split_arg_at_peg_revision().
>>
>> * subversion/libsvn_subr/opt.c
>>   (svn_opt__split_arg_at_peg_revision): Canonicalize path/URL.
>>   (svn_opt__args_to_target_array): No need to canonicalize path/URL as
>>   the code is now in svn_opt__split_arg_at_peg_revision().
>>
>> Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
>>
>> ]]]
>>
>
> Forgot to wrap calls inside SVN_ERR(). Please ignore last
> patch. Attached is the updated one.
>
> Thanks and Regards
> Noorul
>
> Index: subversion/libsvn_subr/opt.c
> ===================================================================
> --- subversion/libsvn_subr/opt.c	(revision 1030801)
> +++ subversion/libsvn_subr/opt.c	(working copy)
> @@ -848,18 +848,10 @@
>                                                   utf8_target, pool));
>  
>        /* URLs and wc-paths get treated differently. */
> -      if (svn_path_is_url(true_target))
> +      if (! svn_path_is_url(true_target))
>          {
> -          SVN_ERR(svn_opt__arg_canonicalize_url(&true_target, true_target,
> -                                                 pool));
> -        }
> -      else  /* not a url, so treat as a path */
> -        {
>            const char *base_name;
>  
> -          SVN_ERR(svn_opt__arg_canonicalize_path(&true_target, true_target,
> -                                                 pool));
> -
>            /* If the target has the same name as a Subversion
>               working copy administrative dir, skip it. */
>            base_name = svn_dirent_basename(true_target, pool);
> @@ -976,6 +968,14 @@
>          *peg_revision = "";
>      }
>  
> +  /* Canonicalize path/URL. */
> +  if (svn_path_is_url(*true_target))
> +    SVN_ERR(svn_opt__arg_canonicalize_url(true_target, *true_target,
> +                                          pool));
> +  else
> +    SVN_ERR(svn_opt__arg_canonicalize_path(true_target, *true_target,
> +                                           pool));
> +
>    return SVN_NO_ERROR;
>  }
>  

Please ignore this patch. Looks like it is complicated. Some of the
tests are failing because of this. 

Thanks and Regards
Noorul