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

Re: [PATCH] svncopy.pl fails with spaces in file paths.

From: Michael W Thelen <mike_at_pietdepsi.com>
Date: 2005-07-27 08:07:09 CEST

Martin Tomes wrote:
> [[[
> svncopy.pl fails to change the svn:externals property when there is a
> space in the file path.
>
> * contrib/client-side/svncopy.pl.in
> (UpdateExternalsOnDir) Quote file path parameters to call of SVNCall.
> ]]]
>
>
> ------------------------------------------------------------------------
>
> Index: svncopy.pl.in
> ===================================================================
> --- svncopy.pl.in (revision 15362)
> +++ svncopy.pl.in (working copy)
> @@ -502,7 +502,8 @@
> my ($handle, $tmpfile) = tempfile( DIR => $temp_dir );
> print $handle join( "\n", @new_externals );
> close($handle);
> - SVNCall( "propset", "--file", $tmpfile, "svn:externals", $work_dir );
> + SVNCall( "propset", "--file", '"' . $tmpfile . '"', "svn:externals",
> + '"' . $work_dir . '"' );
> }
> }

I have not used svncopy.pl, but it looks like anything that calls
SVNCall with a pathname may fail for the same reason. Would it be
better to guard the parameters inside the SVNCall subroutine itself,
with something like this?

==================================================================
--- contrib/client-side/svncopy.pl.in (revision 21885)
+++ contrib/client-side/svncopy.pl.in (local)
@@ -686,7 +686,7 @@
  {
    my ( $command, @options ) = @_;

- my @commandline = ( $svn, $command, @svn_options, @options );
+ my @commandline = ( $svn, $command, @svn_options, map {"\"$_\""}
@options );

    info( " > ", join( " ", @commandline ), "\n" );

-- 
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes.       -- Douglas Adams
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jul 27 08:08:33 2005

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.