@matheusbsbs / matheus-bagliano / commits / 211dcac643
Fork 0

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>

Martin Langhoff committed Nov 2, 2005 at 13:48 UTC 211dcac6430cdf77fcf2a968ffaf9313b5c059b0
2 files changed +12 -4
Documentation/git-cvsimport.txt
+4
@@ -60,6 +60,10 @@ the old cvs2git tool.
60 +
61 If you need to pass multiple options, separate them with a comma.
62
63 +-P:: <cvsps-output-file>
64 + Instead of calling cvsps, read the provided cvsps output file. Useful
65 + for debugging or when cvsps is being handled outside cvsimport.
66 +
67 -m::
68 Attempt to detect merges based on the commit message. This option
69 will enable default regexes that try to capture the name source
git-cvsimport.perl
+8 -4
@@ -29,7 +29,7 @@ use IPC::Open2;
29 $SIG{'PIPE'}="IGNORE";
30 $ENV{'TZ'}="UTC";
31
32 -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);
32 +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);
33
34 sub usage() {
35 print STDERR <<END;
@@ -41,7 +41,7 @@ END
41 exit(1);
42 }
43
44 -getopts("hivmkuo:d:p:C:z:s:M:") or usage();
44 +getopts("hivmkuo:d:p:C:z:s:M:P:") or usage();
45 usage if $opt_h;
46
47 @ARGV <= 1 or usage();
@@ -494,8 +494,12 @@ unless($pid) {
494 unless (defined($opt_p) && $opt_p =~ m/--no-cvs-direct/) {
495 push @opt, '--cvs-direct';
496 }
497 - exec("cvsps",@opt,"-u","-A",'--root',$opt_d,$cvs_tree);
498 - die "Could not start cvsps: $!\n";
497 + if ($opt_P) {
498 + exec("cat", $opt_P);
499 + } else {
500 + exec("cvsps",@opt,"-u","-A",'--root',$opt_d,$cvs_tree);
501 + die "Could not start cvsps: $!\n";
502 + }
503 }
504
505