X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-cvsexportcommit.perl;h=a33fa8d4c86da54a4d741cf921d1cf7b2138d186;hb=be6042cfa59358b733b6f9ba05bcbc317998d9fe;hp=d6ae99b8c00c278f6e4b0190dfb892b857f27103;hpb=a0f5b7f0170629107a4aa37a6485cf1263d2b802;p=git.git diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index d6ae99b8c..a33fa8d4c 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; @@ -193,7 +197,7 @@ if (@canstatusfiles) { # ... validate new files, foreach my $f (@afiles) { if (defined ($cvsstat{$f}) and $cvsstat{$f} ne "Unknown") { - $dirty = 1; + $dirty = 1; warn "File $f is already known in your CVS checkout -- perhaps it has been added by another user. Or this may indicate that it exists on a different branch. If this is the case, use -f to force the merge.\n"; warn "Status was: $cvsstat{$f}\n"; } @@ -277,6 +281,11 @@ if ($opt_c) { # clean up unlink(".cvsexportcommit.diff"); +# CVS version 1.11.x and 1.12.x sleeps the wrong way to ensure the timestamp +# used by CVS and the one set by subsequence file modifications are different. +# If they are not different CVS will not detect changes. +sleep(1); + sub usage { print STDERR <