git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add option to cvs update before export
@ 2007-05-24 15:06 Robin Rosenberg
  2007-05-25  2:34 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Robin Rosenberg @ 2007-05-24 15:06 UTC (permalink / raw)
  To: junkio; +Cc: git

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---

 Documentation/git-cvsexportcommit.txt |    5 ++++-
 git-cvsexportcommit.perl              |    8 ++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt
index fd7f540..da5c242 100644
--- a/Documentation/git-cvsexportcommit.txt
+++ b/Documentation/git-cvsexportcommit.txt
@@ -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
@@ -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.
 
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index d6ae99b..42060ef 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -15,9 +15,9 @@ unless ($ENV{GIT_DIR} && -r $ENV{GIT_DIR}){
     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();
 
@@ -178,6 +178,10 @@ foreach my $f (@files) {
 
 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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add option to cvs update before export
  2007-05-24 15:06 [PATCH] Add option to cvs update before export Robin Rosenberg
@ 2007-05-25  2:34 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2007-05-25  2:34 UTC (permalink / raw)
  To: Robin Rosenberg; +Cc: git

Looks good; will queue for 'next'.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-25  2:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-24 15:06 [PATCH] Add option to cvs update before export Robin Rosenberg
2007-05-25  2:34 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).