cvsimport: introduce -P <cvsps-output-file> option

-P:: <cvsps-output-file>
       Instead of calling cvsps, read the provided cvsps output file. Useful
       for debugging or when cvsps is being handled outside cvsimport.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Martin Langhoff 2005-11-02 13:48:47 +13:00 committed by Junio C Hamano
parent d44e8cf029
commit 211dcac643
2 changed files with 12 additions and 4 deletions

View File

@ -60,6 +60,10 @@ the old cvs2git tool.
+ +
If you need to pass multiple options, separate them with a comma. If you need to pass multiple options, separate them with a comma.


-P:: <cvsps-output-file>
Instead of calling cvsps, read the provided cvsps output file. Useful
for debugging or when cvsps is being handled outside cvsimport.

-m:: -m::
Attempt to detect merges based on the commit message. This option Attempt to detect merges based on the commit message. This option
will enable default regexes that try to capture the name source will enable default regexes that try to capture the name source

View File

@ -29,7 +29,7 @@ use IPC::Open2;
$SIG{'PIPE'}="IGNORE"; $SIG{'PIPE'}="IGNORE";
$ENV{'TZ'}="UTC"; $ENV{'TZ'}="UTC";


our($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_s,$opt_m,$opt_M); our($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_P, $opt_s,$opt_m,$opt_M);


sub usage() { sub usage() {
print STDERR <<END; print STDERR <<END;
@ -41,7 +41,7 @@ END
exit(1); exit(1);
} }


getopts("hivmkuo:d:p:C:z:s:M:") or usage(); getopts("hivmkuo:d:p:C:z:s:M:P:") or usage();
usage if $opt_h; usage if $opt_h;


@ARGV <= 1 or usage(); @ARGV <= 1 or usage();
@ -494,8 +494,12 @@ unless($pid) {
unless (defined($opt_p) && $opt_p =~ m/--no-cvs-direct/) { unless (defined($opt_p) && $opt_p =~ m/--no-cvs-direct/) {
push @opt, '--cvs-direct'; push @opt, '--cvs-direct';
} }
if ($opt_P) {
exec("cat", $opt_P);
} else {
exec("cvsps",@opt,"-u","-A",'--root',$opt_d,$cvs_tree); exec("cvsps",@opt,"-u","-A",'--root',$opt_d,$cvs_tree);
die "Could not start cvsps: $!\n"; die "Could not start cvsps: $!\n";
}
} }