subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pet...@apache.org
Subject svn commit: r1162197 - /subversion/trunk/contrib/client-side/svn-clean
Date Fri, 26 Aug 2011 18:26:50 GMT
Author: peters
Date: Fri Aug 26 18:26:50 2011
New Revision: 1162197

URL: http://svn.apache.org/viewvc?rev=1162197&view=rev
Log:
* contrib/client-side/svn-clean:
   Support multiple path arguments, like any good Unix tool.
   (The svn-module-not-available case already did support them,
   actually.)

Modified:
    subversion/trunk/contrib/client-side/svn-clean

Modified: subversion/trunk/contrib/client-side/svn-clean
URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/client-side/svn-clean?rev=1162197&r1=1162196&r2=1162197&view=diff
==============================================================================
--- subversion/trunk/contrib/client-side/svn-clean (original)
+++ subversion/trunk/contrib/client-side/svn-clean Fri Aug 26 18:26:50 2011
@@ -35,7 +35,7 @@ my $print        = 0;
 my $help         = 0;
 my $man          = 0;
 my $nonrecursive = 0;
-my $path         = $CWD;
+my @paths        = ($CWD);
 GetOptions(
     "exclude=s"       => \@exclude,
     "force"           => \$force,
@@ -47,7 +47,7 @@ GetOptions(
 ) or pod2usage(2);
 pod2usage(1) if $help;
 pod2usage( -exitstatus => 0, -verbose => 2 ) if $man;
-$path = Cwd::abs_path( $ARGV[0] ) if @ARGV;
+@paths = map { Cwd::abs_path($_) } @ARGV if @ARGV;
 
 # Precompile regexes.
 $_ = qr/$_/ foreach @exclude;
@@ -58,7 +58,8 @@ if ($use_svn_module) {
     my $ctx = new SVN::Client;
 
     # Call handler function with status info for each file.
-    $ctx->status( $path, undef, \&clean, !$nonrecursive, 1, 0, 1 );
+    $ctx->status( $_, undef, \&clean, !$nonrecursive, 1, 0, 1 )
+      for @paths;
 }
 else {
     warn "Warning: Not using SVN Perl modules, this might be slow.\n"
@@ -74,11 +75,11 @@ else {
     if ( $^O eq 'MSWin32' ) {
 
         # Perl on Windows currently doesn't have list pipe opens.
-        open SVN, join( ' ', @command, @ARGV ) . '|'
+        open SVN, join( ' ', @command, @paths ) . '|'
           or die "Can't call program \"svn\": $!\n";
     }
     else {
-        open SVN, "-|", @command, @ARGV
+        open SVN, "-|", @command, @paths
           or die "Can't call program \"svn\": $!\n";
     }
   LINE: while (<SVN>) {



Mime
View raw message