--- trunk/svn2cvs.pl 2007/08/16 15:27:09 27 +++ trunk/svn2cvs.pl 2007/08/20 08:37:22 30 @@ -48,7 +48,7 @@ print "## using TMPDIR $TMPDIR\n"; # cvs command with root -my $cvs="cvs -d $CVSROOT"; +my $cvs="cvs -f -d $CVSROOT"; # current revision in CVS my $rev; @@ -78,11 +78,11 @@ my $path=".svnrev"; if ($add_new) { - system "$cvs add $path" || die "cvs add of $path failed: $!"; + system "$cvs add '$path'" || die "cvs add of $path failed: $!"; } else { my $msg="subversion revision $rev commited to CVS"; print "$msg\n"; - system "$cvs commit -m '$msg' $path" || die "cvs commit of $path failed: $!"; + system "$cvs commit -m '$msg' '$path'" || die "cvs commit of $path failed: $!"; } } @@ -99,7 +99,7 @@ next if in_entries($curr_dir); next if (-e "$curr_dir/CVS"); - log_system("$cvs add $curr_dir", "cvs add of $curr_dir failed"); + log_system("$cvs add '$curr_dir'", "cvs add of $curr_dir failed"); } } @@ -294,21 +294,26 @@ $msg =~ s/'/'\\''/g; # quote " if ($action =~ /M/) { - print "svn2cvs: modify $path -- nop\n"; + if ( in_entries( $path ) ) { + print "svn2cvs: modify $path -- nop\n"; + } else { + print "WARNING: modify $path which isn't in CVS, adding...\n"; + log_system("$cvs add '$path'", "cvs add of $path failed"); + } } elsif ($action =~ /A/) { if (-d $path) { add_dir($path, $msg); } elsif ($path =~ m,^(.+)/[^/]+$, && ! -e "$1/CVS/Root") { my $dir = $1; in_entries($dir) || add_dir($dir, $msg); - in_entries($path) || log_system("$cvs add $path", "cvs add of $path failed"); + in_entries($path) || log_system("$cvs add '$path'", "cvs add of $path failed"); } else { - in_entries($path) || log_system("$cvs add $path", "cvs add of $path failed"); + in_entries($path) || log_system("$cvs add '$path'", "cvs add of $path failed"); } } elsif ($action =~ /D/) { if (-e $path) { unlink $path || die "can't delete $path: $!"; - log_system("$cvs delete $path", "cvs delete of $path failed"); + log_system("$cvs delete '$path'", "cvs delete of $path failed"); } else { print "WARNING: $path is not present, skipping...\n"; undef $path; @@ -326,7 +331,7 @@ $msg =~ s/'/'\\''/g; # quote " # now commit changes - log_system("$cvs commit -m '$msg' ".join(" ",@commit), "cvs commit of ".join(",",@commit)." failed"); + log_system("$cvs commit -m '$msg' '".join("' '",@commit)."'", "cvs commit of ".join(",",@commit)." failed"); commit_svnrev($rev); }