Add option to cvs update before export
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Thu, 24 May 2007 15:06:55 +0000 (17:06 +0200)
committerJunio C Hamano <junkio@cox.net>
Fri, 25 May 2007 04:37:00 +0000 (21:37 -0700)
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-cvsexportcommit.txt
git-cvsexportcommit.perl
index fd7f54093fc3d0a85126a0826affb712096aa144..da5c242241c01d6d7e7a5d648ff58263cc3e01dd 100644 (file)
@@ -8,7 +8,7 @@ git-cvsexportcommit - Export a single commit to a CVS checkout
 
 SYNOPSIS
 --------
 
 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
 
 
 DESCRIPTION
@@ -58,6 +58,9 @@ OPTIONS
        Prepend the commit message with the provided prefix. 
        Useful for patch series and the like.
 
        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.
 
 -v::
        Verbose.
 
index d6ae99b8c00c278f6e4b0190dfb892b857f27103..42060ef6e165b6b39e4842138013cf264688ebd5 100755 (executable)
@@ -15,9 +15,9 @@
     die "GIT_DIR is not defined or is unreadable";
 }
 
     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();
 
 
 $opt_h && usage();
 
 
 my %cvsstat;
 if (@canstatusfiles) {
 
 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;
     my @cvsoutput;
     @cvsoutput= safe_pipe_capture(@cvs, 'status', @canstatusfiles);
     my $matchcount = 0;