--- trunk/svndump-move.pl 2007/08/03 17:57:25 48 +++ trunk/svndump-move.pl 2007/08/03 18:13:55 49 @@ -27,7 +27,6 @@ warn "created: $path ", -s $path, "bytes\n"; } - die "please copy repository on which to perfrom operation to $from\n" if ( ! -e $from ); warn "collect all paths from repository $from\n"; @@ -38,6 +37,17 @@ die "created $tl\nplease edit it to reflect new layout\n"; } +my $map; + +open(my $fhf, '<', $fl ) || die "can't open $fl: $!"; +open(my $fht, '<', $tl ) || die "can't open $tl: $!"; +while( my $lf = <$fhf> ) { + chomp($lf); + my $lt = <$fht> || die "list shorter, probably corrupt: $tl\n"; + chomp($lt); + $map->{$lf} = $lt; +} + if ( -e $to ) { #die "$to allready exists! remove it to re-create repository\n"; rm('-Rf',$to); @@ -59,7 +69,11 @@ } my $path = $rec->get_header('Node-path'); - warn "##> $path\n" if $path; + if ( $path && defined( $map->{$path} ) ) { + my $to = $map->{$path}; + warn "##> $path -> $to\n"; + $rec->set_header('Node-path', $to); + } print $fh_out $rec->as_string(); }