Reputation: 6486
Subversion checkouts produce a large number of files under the '.svn' trees. Is there any way to filter out '.svn' files during the checkout process?
Thanks,
Sen
Upvotes: 2
Views: 434
Reputation: 7604
I know this is a late post, but if you don't want the .svn files stored in your directory because you want to zip it up or hand it off to someone else void of those files, please use this perl script to remove the .svn files. Note by using this you would not be able to use svn commit to commit back to the repository since you delete the .svn files.
#!/usr/bin/perl
use File::Path;
use strict;
# Only run program on valid input MAX/MIN_INPUT = 1
if ( @ARGV == 1 ) {
my $file = $ARGV[0];
#Do some regular expression verrification
&dot_svn_del_func ( $ARGV[0] );
} else {
die "ERROR: to many arguments passed";
}
sub dot_svn_del_func {
my $path = shift;
opendir (DIR, $path) or die "Unable to open $path: $!";
my @files = grep { !/^\.{1,2}$/ } readdir (DIR);
closedir (DIR);
@files = map { $path . '/' . $_ } @files;
for (@files) {
if (-d $_) {
my $svn_found = 0;
my $path = $_;
my @path_components = split(/\//,$path);
my $path_count = 0;
foreach my $new_path (@path_components) {
if ( $new_path eq ".svn" ) {
rmtree($_,1,1);
$svn_found = 1;
}
$path_count++;
}
if ( $svn_found == 0 ) {
#print "Making recursive calls from ".$_."\n";
&dot_svn_del_func ( $_ );
}
}
}
}
Upvotes: 2
Reputation: 66739
See svn export
. It should help.
The first form exports a clean directory tree from the repository specified by URL, at revision REV if it is given, otherwise at HEAD, into PATH. If PATH is omitted, the last component of the URL is used for the local directory name.
As yodaj007 says, this will extract all the files from a revision and the directory will not be a revision controlled one. To obtain revision controlled directory, you use the usual svn co
.
Upvotes: 7