summaryrefslogtreecommitdiff
path: root/git-cvsimport.perl
diff options
context:
space:
mode:
authorMartin Langhoff <martin@catalyst.net.nz>2005-11-02 13:48:47 +1300
committerJunio C Hamano <junkio@cox.net>2005-11-01 16:57:38 -0800
commit211dcac6430cdf77fcf2a968ffaf9313b5c059b0 (patch)
tree27b0709baf49484aca7cd33d270f9e3323cc34b8 /git-cvsimport.perl
parentd44e8cf0298a794648271cbff2f74a0063a672b3 (diff)
downloadgit-211dcac6430cdf77fcf2a968ffaf9313b5c059b0.tar.gz
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>
Diffstat (limited to 'git-cvsimport.perl')
-rwxr-xr-xgit-cvsimport.perl12
1 files changed, 8 insertions, 4 deletions
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index e3cad5a1ca..0144670a57 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -29,7 +29,7 @@ use IPC::Open2;
$SIG{'PIPE'}="IGNORE";
$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() {
print STDERR <<END;
@@ -41,7 +41,7 @@ END
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;
@ARGV <= 1 or usage();
@@ -494,8 +494,12 @@ unless($pid) {
unless (defined($opt_p) && $opt_p =~ m/--no-cvs-direct/) {
push @opt, '--cvs-direct';
}
- exec("cvsps",@opt,"-u","-A",'--root',$opt_d,$cvs_tree);
- die "Could not start cvsps: $!\n";
+ if ($opt_P) {
+ exec("cat", $opt_P);
+ } else {
+ exec("cvsps",@opt,"-u","-A",'--root',$opt_d,$cvs_tree);
+ die "Could not start cvsps: $!\n";
+ }
}