--- trunk/svn2cvs.pl 2006/01/03 00:03:22 23 +++ trunk/svn2cvs.pl 2007/08/16 15:27:09 27 @@ -17,6 +17,9 @@ use Data::Dumper; use XML::Simple; +# do we want to sync just part of repository? +my $partial_import = 1; + if (@ARGV < 2) { print "usage: $0 SVN_URL CVSROOT CVSREPOSITORY\n"; exit 1; @@ -253,6 +256,9 @@ do { if ($tmpsvn =~ s#(/[^/]+)/*$##) { $SVNREP = $1 . $SVNREP; + } elsif ($e->{'paths'}->{'path'}->[0]->{'copyfrom-path'}) { + print "NOTICE: copyfrom outside synced repository ignored - skipping\n"; + next; } else { print "NOTICE: can't deduce svn dir from $SVNROOT - skipping\n"; next; @@ -273,7 +279,11 @@ # prepare path and message my $file = $path; - $path =~ s#^\Q$SVNREP\E/*## || die "BUG: can't strip SVNREP '$SVNREP' from path"; + if ( $path !~ s#^\Q$SVNREP\E/*## ) { + print "NOTICE: skipping '$path' which isn't under repository root '$SVNREP'\n"; + die unless $partial_import; + next; + } if (! $path) { print "NOTICE: skipped this operation. Probably trunk creation\n";