Skip to content

Commit e5d8064

Browse files
robinrosenbergJunio C Hamano
authored andcommitted
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>
1 parent 18bece4 commit e5d8064

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Documentation/git-cvsexportcommit.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ git-cvsexportcommit - Export a single commit to a CVS checkout
88

99
SYNOPSIS
1010
--------
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
1212

1313

1414
DESCRIPTION
@@ -58,6 +58,9 @@ OPTIONS
5858
Prepend the commit message with the provided prefix.
5959
Useful for patch series and the like.
6060

61+
-u::
62+
Update affected files from cvs repository before attempting export.
63+
6164
-v::
6265
Verbose.
6366

git-cvsexportcommit.perl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
die "GIT_DIR is not defined or is unreadable";
1616
}
1717

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);
1919

20-
getopts('hPpvcfam:d:');
20+
getopts('uhPpvcfam:d:');
2121

2222
$opt_h && usage();
2323

@@ -178,6 +178,10 @@
178178

179179
my %cvsstat;
180180
if (@canstatusfiles) {
181+
if ($opt_u) {
182+
my @updated = safe_pipe_capture(@cvs, 'update', @canstatusfiles);
183+
print @updated;
184+
}
181185
my @cvsoutput;
182186
@cvsoutput= safe_pipe_capture(@cvs, 'status', @canstatusfiles);
183187
my $matchcount = 0;

0 commit comments

Comments
 (0)