Author: gozer
Date: Mon Dec 13 14:58:42 2004
New Revision: 111758

URL: http://svn.apache.org/viewcvs?view=rev&rev=111758
Log:
Turns out that svn ls -R is a pretty heavy operation _and_ required
networking to the svn server. Not a very good idea just to build a
MANIFEST.

Changing to a more manual, but much faster and local way of building
MANIFEST. Closer to how we used to do it for CVS.


Modified:
   perl/modperl/trunk/lib/ModPerl/Manifest.pm

Modified: perl/modperl/trunk/lib/ModPerl/Manifest.pm
Url: 
http://svn.apache.org/viewcvs/perl/modperl/trunk/lib/ModPerl/Manifest.pm?view=diff&rev=111758&p1=perl/modperl/trunk/lib/ModPerl/Manifest.pm&r1=111757&p2=perl/modperl/trunk/lib/ModPerl/Manifest.pm&r2=111758
==============================================================================
--- perl/modperl/trunk/lib/ModPerl/Manifest.pm  (original)
+++ perl/modperl/trunk/lib/ModPerl/Manifest.pm  Mon Dec 13 14:58:42 2004
@@ -41,13 +41,28 @@
 
 sub get_svn_files {
     my @files;
-    foreach my $repos ('', @repos) {
-        foreach my $ent (`svn ls -R $repos`) {
-            chomp($ent);
-            $ent = File::Spec->catfile($repos, $ent) if $repos;
-            push @files, $ent if -f $ent;
+
+    my $cwd = Cwd::cwd();
+
+    finddepth({ follow => 1, wanted => sub {
+        return unless $_ eq 'entries';
+        return unless $File::Find::dir =~ /\.svn$/;
+
+        my $dir = dirname $File::Find::dir;
+        $dir =~ s,^$cwd/?,,;
+
+        open my $fh, $_ or die "open $_: $!";
+        while (my $line = <$fh>) {
+             if ($line =~ /name\s*=\s*"([^"]*)"/) {
+                my $file = $1;
+                next if !$file or -d "../$file" or $file =~ /^\./;
+                push @files, $dir ? "$dir/$file" : $file;
+             }
         }
-    }
+
+    close $fh;
+    }}, $cwd);
+    
     return @files;
 }
 

Reply via email to