Skip to content

Commit

Permalink
Add option to cvs update before export
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Rosenberg <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
robinrosenberg authored and Junio C Hamano committed May 25, 2007
1 parent 18bece4 commit e5d8064
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Documentation/git-cvsexportcommit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ git-cvsexportcommit - Export a single commit to a CVS checkout

SYNOPSIS
--------
'git-cvsexportcommit' [-h] [-v] [-c] [-P] [-p] [-a] [-d cvsroot] [-f] [-m msgprefix] [PARENTCOMMIT] COMMITID
'git-cvsexportcommit' [-h] [-u] [-v] [-c] [-P] [-p] [-a] [-d cvsroot] [-f] [-m msgprefix] [PARENTCOMMIT] COMMITID


DESCRIPTION
Expand Down Expand Up @@ -58,6 +58,9 @@ OPTIONS
Prepend the commit message with the provided prefix.
Useful for patch series and the like.

-u::
Update affected files from cvs repository before attempting export.

-v::
Verbose.

Expand Down
8 changes: 6 additions & 2 deletions git-cvsexportcommit.perl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
die "GIT_DIR is not defined or is unreadable";
}

our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d);
our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u);

getopts('hPpvcfam:d:');
getopts('uhPpvcfam:d:');

$opt_h && usage();

Expand Down Expand Up @@ -178,6 +178,10 @@

my %cvsstat;
if (@canstatusfiles) {
if ($opt_u) {
my @updated = safe_pipe_capture(@cvs, 'update', @canstatusfiles);
print @updated;
}
my @cvsoutput;
@cvsoutput= safe_pipe_capture(@cvs, 'status', @canstatusfiles);
my $matchcount = 0;
Expand Down

0 comments on commit e5d8064

Please sign in to comment.