83 |
|
|
84 |
if ($add_new) { |
if ($add_new) { |
85 |
system "$cvs add '$path'" || die "cvs add of $path failed: $!"; |
system "$cvs add '$path'" || die "cvs add of $path failed: $!"; |
86 |
} |
} else { |
|
else { |
|
87 |
my $msg = "subversion revision $rev commited to CVS"; |
my $msg = "subversion revision $rev commited to CVS"; |
88 |
print "$msg\n"; |
print "$msg\n"; |
89 |
system "$cvs commit -m '$msg' '$path'" |
system "$cvs commit -m '$msg' '$path'" |
145 |
log_system( "$cvs -q checkout $CVSREP", "cvs checkout failed" ); |
log_system( "$cvs -q checkout $CVSREP", "cvs checkout failed" ); |
146 |
cd_rep; |
cd_rep; |
147 |
|
|
148 |
} |
} else { |
|
else { |
|
149 |
|
|
150 |
# import into existing module directory in CVS |
# import into existing module directory in CVS |
151 |
|
|
177 |
if ( $in !~ /^\d+$/ ) { |
if ( $in !~ /^\d+$/ ) { |
178 |
print "Aborting: revision not a number\n"; |
print "Aborting: revision not a number\n"; |
179 |
exit 1; |
exit 1; |
180 |
} |
} else { |
|
else { |
|
181 |
$rev = $in; |
$rev = $in; |
182 |
commit_svnrev( $rev, 1 ); # create new |
commit_svnrev( $rev, 1 ); # create new |
183 |
} |
} |
184 |
} |
} else { |
|
else { |
|
185 |
open( SVNREV, ".svnrev" ) |
open( SVNREV, ".svnrev" ) |
186 |
|| die "can't open $TMPDIR/$CVSREP/.svnrev: $!"; |
|| die "can't open $TMPDIR/$CVSREP/.svnrev: $!"; |
187 |
$rev = <SVNREV>; |
$rev = <SVNREV>; |
239 |
warn "#### entries recurse into: $dir/$sub_dir"; |
warn "#### entries recurse into: $dir/$sub_dir"; |
240 |
push @entries, map {"$sub_dir/$_"} entries("$dir/$sub_dir"); |
push @entries, map {"$sub_dir/$_"} entries("$dir/$sub_dir"); |
241 |
push @entries, $sub_dir; |
push @entries, $sub_dir; |
242 |
} |
} elsif (m{^/([^/]+)/}) { |
|
elsif (m{^/([^/]+)/}) { |
|
243 |
push @entries, $1; |
push @entries, $1; |
244 |
} |
} elsif ( !m{^D$} ) { |
|
elsif ( !m{^D$} ) { |
|
245 |
die "can't decode entries line: $_"; |
die "can't decode entries line: $_"; |
246 |
} |
} |
247 |
} |
} |
266 |
} |
} |
267 |
close($fh); |
close($fh); |
268 |
return 0; |
return 0; |
269 |
} |
} else { |
|
else { |
|
270 |
die "can't split '$path' to dir and file!"; |
die "can't split '$path' to dir and file!"; |
271 |
} |
} |
272 |
} |
} |
290 |
do { |
do { |
291 |
if ( $tmpsvn =~ s#(/[^/]+)/*$## ) { # vim fix |
if ( $tmpsvn =~ s#(/[^/]+)/*$## ) { # vim fix |
292 |
$SVNREP = $1 . $SVNREP; |
$SVNREP = $1 . $SVNREP; |
293 |
} |
} elsif ( $e->{'paths'}->{'path'}->[0]->{'copyfrom-path'} ) { |
|
elsif ( $e->{'paths'}->{'path'}->[0]->{'copyfrom-path'} ) { |
|
294 |
print |
print |
295 |
"NOTICE: copyfrom outside synced repository ignored - skipping\n"; |
"NOTICE: copyfrom outside synced repository ignored - skipping\n"; |
296 |
next; |
next; |
297 |
} |
} else { |
|
else { |
|
298 |
print "NOTICE: can't deduce svn dir from $SVNROOT - skipping\n"; |
print "NOTICE: can't deduce svn dir from $SVNROOT - skipping\n"; |
299 |
next; |
next; |
300 |
} |
} |
353 |
|
|
354 |
if ( -d $path ) { |
if ( -d $path ) { |
355 |
add_dir( $path, $msg ); |
add_dir( $path, $msg ); |
356 |
} |
} elsif ( $path =~ m,^(.+)/[^/]+$, && !-e "$1/CVS/Root" ) { |
|
elsif ( $path =~ m,^(.+)/[^/]+$, && !-e "$1/CVS/Root" ) { |
|
357 |
my $dir = $1; |
my $dir = $1; |
358 |
in_entries($dir) || add_dir( $dir, $msg ); |
in_entries($dir) || add_dir( $dir, $msg ); |
359 |
in_entries($path) || log_system( "$cvs add '$path'", |
in_entries($path) || log_system( "$cvs add '$path'", |
360 |
"cvs add of $path failed" ); |
"cvs add of $path failed" ); |
361 |
} |
} else { |
|
else { |
|
362 |
in_entries($path) || log_system( "$cvs add '$path'", |
in_entries($path) || log_system( "$cvs add '$path'", |
363 |
"cvs add of $path failed" ); |
"cvs add of $path failed" ); |
364 |
} |
} |
367 |
if ( $action =~ /M/ ) { |
if ( $action =~ /M/ ) { |
368 |
if ( in_entries($path) ) { |
if ( in_entries($path) ) { |
369 |
print "svn2cvs: modify $path -- nop\n"; |
print "svn2cvs: modify $path -- nop\n"; |
370 |
} |
} else { |
|
else { |
|
371 |
print "WARNING: modify $path which isn't in CVS, adding...\n"; |
print "WARNING: modify $path which isn't in CVS, adding...\n"; |
372 |
add_path($path); |
add_path($path); |
373 |
} |
} |
374 |
} |
} elsif ( $action =~ /A/ ) { |
|
elsif ( $action =~ /A/ ) { |
|
375 |
add_path($path); |
add_path($path); |
376 |
} |
} elsif ( $action =~ /D/ ) { |
|
elsif ( $action =~ /D/ ) { |
|
377 |
if ( -e $path ) { |
if ( -e $path ) { |
378 |
if ( -d $path ) { |
if ( -d $path ) { |
379 |
warn "#### remove directory: $path"; |
warn "#### remove directory: $path"; |
398 |
"cvs update -dP $path failed" |
"cvs update -dP $path failed" |
399 |
); |
); |
400 |
undef $path; |
undef $path; |
401 |
} |
} else { |
|
else { |
|
402 |
warn "#### remove file: $path"; |
warn "#### remove file: $path"; |
403 |
unlink($path) || die "can't delete $path: $!"; |
unlink($path) || die "can't delete $path: $!"; |
404 |
log_system( "$cvs delete '$path'", |
log_system( "$cvs delete '$path'", |
405 |
"cvs delete of dir $path failed" ); |
"cvs delete of dir $path failed" ); |
406 |
} |
} |
407 |
} |
} else { |
|
else { |
|
408 |
print "WARNING: $path is not present, skipping...\n"; |
print "WARNING: $path is not present, skipping...\n"; |
409 |
undef $path; |
undef $path; |
410 |
} |
} |
411 |
} |
} else { |
|
else { |
|
412 |
print |
print |
413 |
"WARNING: action $action not implemented on $path. Bug or missing feature of $0\n"; |
"WARNING: action $action not implemented on $path. Bug or missing feature of $0\n"; |
414 |
} |
} |