2010/12/07

Simple dimple twee (though verbose and pedantic) wrapper to cvs2svn to process a set of paths generated by running this:
find ./cvsmaster/modulepredicate* -maxdepth 1 -mindepth 1 -type d >> cvs2svnworkitems.txt


#!/usr/bin/perl
use warnings;
use strict;
sub svnop($);
my $inputfile = "cvs2svnworkitems.txt";
open (my $ifh , '<', "$inputfile") && print "opened $inputfile"; while (<$ifh>){
chomp $_;
print "processing work item line:".$_."\n";
svnop($_);
}
close $ifh && print "close $inputfile";

sub svnop($) {
my $inputtarget = shift;
print "running svnop($inputtarget)\n";

my $svntargetdir = "svnmigrate/";
my $cvsmodulename = $_;
print "pre substitution: \$cvsmodulename=[$cvsmodulename]\n" ;
$cvsmodulename =~ s/cvsmaster\///;
print "post substitution \$cvsmodulename=[$cvsmodulename]\n" ;
print "operating on cvs module $cvsmodulename\n";
my $svncommand = "cvs2svn --verbose --svnrepos=$svntargetdir.$cvsmodulename $_";
print "running $svncommand=[$svncommand]\n";
my $rc = `$svncommand`;
print "run complete, \$rc = $rc\n";
}


__END__
cvs2svnworkitems.txt

No comments: