Skip to content

Commit

Permalink
cvsimport: introduce -P <cvsps-output-file> option
Browse files Browse the repository at this point in the history
-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>
  • Loading branch information
Martin Langhoff authored and Junio C Hamano committed Nov 2, 2005
1 parent d44e8cf commit 211dcac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Documentation/git-cvsimport.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ the old cvs2git tool.
+
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::
Attempt to detect merges based on the commit message. This option
will enable default regexes that try to capture the name source
Expand Down
12 changes: 8 additions & 4 deletions git-cvsimport.perl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
$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;
Expand All @@ -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();
Expand Down Expand Up @@ -494,8 +494,12 @@ ($$)
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";
}
}


Expand Down

0 comments on commit 211dcac

Please sign in to comment.