@matheusbsbs / matheus-bagliano / commits / e5d80641d7
Fork 0

Add option to cvs update before export

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Robin Rosenberg committed May 24, 2007 at 17:06 UTC e5d80641d7b17b6943d54c729fbbd0bc5a8fe84d
2 files changed +10 -3
Documentation/git-cvsexportcommit.txt
+4 -1
@@ -8,7 +8,7 @@ git-cvsexportcommit - Export a single commit to a CVS checkout
8
9 SYNOPSIS
10 --------
11 -'git-cvsexportcommit' [-h] [-v] [-c] [-P] [-p] [-a] [-d cvsroot] [-f] [-m msgprefix] [PARENTCOMMIT] COMMITID
11 +'git-cvsexportcommit' [-h] [-u] [-v] [-c] [-P] [-p] [-a] [-d cvsroot] [-f] [-m msgprefix] [PARENTCOMMIT] COMMITID
12
13
14 DESCRIPTION
@@ -58,6 +58,9 @@ OPTIONS
58 Prepend the commit message with the provided prefix.
59 Useful for patch series and the like.
60
61 +-u::
62 + Update affected files from cvs repository before attempting export.
63 +
64 -v::
65 Verbose.
66
git-cvsexportcommit.perl
+6 -2
@@ -15,9 +15,9 @@ unless ($ENV{GIT_DIR} && -r $ENV{GIT_DIR}){
15 die "GIT_DIR is not defined or is unreadable";
16 }
17
18 -our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d);
18 +our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u);
19
20 -getopts('hPpvcfam:d:');
20 +getopts('uhPpvcfam:d:');
21
22 $opt_h && usage();
23
@@ -178,6 +178,10 @@ foreach my $f (@files) {
178
179 my %cvsstat;
180 if (@canstatusfiles) {
181 + if ($opt_u) {
182 + my @updated = safe_pipe_capture(@cvs, 'update', @canstatusfiles);
183 + print @updated;
184 + }
185 my @cvsoutput;
186 @cvsoutput= safe_pipe_capture(@cvs, 'status', @canstatusfiles);
187 my $matchcount = 0;