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

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

From: Martin Hauner <martin.hauner_at_gmx.net>
Date: 2006-11-12 10:48:58 CET

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?

-- 
Martin
Subcommander 1.2.1 - http://subcommander.tigris.org
a cross platform Win32/Unix/MacOSX subversion GUI client & diff/merge tool.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Nov 12 10:49:44 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.