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

RE: Bug in svncopy.pl with svn+ssh://-URLs

From: Gale, David <David.Gale_at_Hypertherm.com>
Date: 2005-12-06 16:54:02 CET

Ganssauge, Gottfried wrote:
> svncopy.pl does not properly handle svn+ssh URLs.
> This depends on the fact that + is a meta character within Perl's
> regular expressions. The following patch quotes the variable used in
> order to prevent interpretation as an RE.
>
> Cheers,
>
> Gottfried
>
> --- /home/ganssaug/bin/svncopy.pl 2005-12-02 18:12:56.698204000
> +0100 +++ /VCS/local/bin/svncopy 2005-12-06 11:04:38.340124000
> +0100 @@ -1,4 +1,4 @@
> -#!/usr/bin/perl
> +#!/VCS/local/bin/perl
> #
> # svncopy.pl -- Utility script for copying with branching/tagging.
> #
> @@ -55,7 +55,7 @@
> #
>
> # Specify the location of the svn command.
> -my $svn = '/usr/bin/svn';
> +my $svn = '/VCS/local/bin/svn';
>
> # Input parameters
> my $testscript = 0;
> @@ -464,7 +464,7 @@
> {
> my $dest_dir = DestinationSubdir( $source,
> $destination ); #info( "Checking against
> '$source'\n" ); - if ( $ext_val =~
> s|^$source|$dest_dir| ) + if ( $ext_val =~
> s|^\Q$source|$dest_dir| ) {
> $external = "$ext_dir$spacing$ext_val";
> info( " - updated '$old_external' to
> '$external'\n" );

FYI: The patch, as posted, includes your personal location for svn and
perl. This probably isn't what you'd intended.

The actual code change is just to the substitution of $destdir for
$source in $ext_val, which is one line:

@@ -464,7 +464,7 @@
                 {
                   my $dest_dir = DestinationSubdir( $source,
$destination );
                   #info( "Checking against '$source'\n" );
- if ( $ext_val =~ s|^$source|$dest_dir| )
+ if ( $ext_val =~ s|^\Q$source|$dest_dir| )
                     {
                       $external = "$ext_dir$spacing$ext_val";
                       info( " - updated '$old_external' to
'$external'\n" );

-David

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Dec 6 17:09:37 2005

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

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