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

Re: [PATCH] Fix in Client Side Contrib Tool: svn-clean

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Sat, 26 Jan 2008 21:06:37 +0000

Jaap DeHaan wrote:
> This patch fixes two small issues in one svn contribution: svn-clean perl
> script.
> 1- A problem with array initialization
> 2- A bigger issue concerning the processing of files and directories with
> whitespaces in their names.
> Hope you like it :-)
>
> [[[
> * contrib/client-side/svn-clean:
> - J. de Haan: Fixed array initialization
> - J. de Haan: Fixed bug on processing files and directories with
> whitespaces in name
> ]]]

Jaap,

Thanks for the patch.

> ------------ BEGIN
> Index: svn-clean
> ===================================================================
> --- svn-clean (revision 28581)
> +++ svn-clean (working copy)
> @@ -28,7 +28,7 @@
>
> my $CWD = getcwd;
>
> -my @exclude = "";
> +my @exclude = ();

That's fine and I have committed it in r29056. I believe it was not causing any
malfunction, and have said so in the commit message. Tell me if I am wrong.

> my $force = 0;
> my $quiet = 0;
> my $print = 0;
> @@ -83,7 +83,9 @@
> }
> LINE: while (<SVN>) {
> if (/^([\?ID])/) {
> - my $file = (split)[-1];
> + chomp;
> + my $file = $_;
> + $file =~ s!\?\s*!!;

I think there is a small problem with this part.

The line accepted by "if (/^([\?ID])/)" can be in one of these three forms:
[[[
? file1
I file2
D 1335 115 julianfoad file3
]]]

Your substitution "$file =~ s!\?\s*!!;" only does the right thing with a line
starting with "?". You could easily extend it to do the same for a line
starting with "I", but I don't know how to make it work correctly with the line
starting with "D", because the exact number of fields and characters vary on
different lines and in different versions of Subversion.

Maybe you could modify the program so that it does not need to extract the file
name from a line starting with "D"? I do not know if this is possible.

A better way would be to use "svn status --xml" but that would be a much bigger
change.

Regards,
- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-01-26 22:06:54 CET

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