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

Re: preparing a path or url for an svn api call....

From: Max Bowsher <maxb1_at_ukf.net>
Date: 2006-11-12 13:13:18 CET

Martin Hauner wrote:
> Hi,
>
> I received a bug report for subcommander that it doesn't properly
> handle urls with spaces.
>
> Grepping through the subversion code the magic trick (which is well
> hidden for someone who is working with the svn_client api ;-) seems
> to be in the loop of svn_opt_args_to_target_array2.
>
> The code is basically:
>
> if( svn_path_is_url(pathOrUrl) )
> {
> // do anything necessary to create a proper url
> path = svn_path_uri_from_iri( );
> path = svn_path_uri_autoescape( );
> path = svn_path_canonicalize( );
>
> ... some additional checks if it is a valid url
> ... error if not
> }
> else
> {
> path = svn_path_canonicalize( );
> ...
> }
>
> I also found a nearly 1:1 copy of this code in the java bindings and a
> stripped down version in mucc.
>
> It looks like that i have to prepare any path or url i pass to the
> subversion api (talking about svn_client here..) with the above code.
>
> If that is the case, I would like to move the above code into its own
> function (named svn_path_prepare?) so it is available to any subversion
> client without copy and paste.
>
> What do you think?

svn_path_from_user_input() perhaps? Yes, this is clearly a good idea to
abstract the standard logic to a reusable function.

Max.

Received on Sun Nov 12 13:13:54 2006

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