summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Dirson <ydirson@altern.org>2006-01-06 20:54:41 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-01-06 22:27:47 (GMT)
commit576cfc86fc321688aec0bc7359fb1097e5717631 (patch)
tree2ba910a4f0cd2284b6888a644feefd0d25e033fd
parentc1fe2fe4fe685e0587c3949f953aab726de88994 (diff)
downloadgit-576cfc86fc321688aec0bc7359fb1097e5717631.zip
git-576cfc86fc321688aec0bc7359fb1097e5717631.tar.gz
git-576cfc86fc321688aec0bc7359fb1097e5717631.tar.bz2
Teach cvsexportcommit to add new files
"cvs add" support was already there, but the "unknown" status returned when querying a file not yet known to cvs caused the script to abort prematurely. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-cvsexportcommit.perl12
1 files changed, 10 insertions, 2 deletions
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 5a8c011..d5fbee7 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -103,8 +103,16 @@ undef @files; # don't need it anymore
# check that the files are clean and up to date according to cvs
my $dirty;
-foreach my $f (@afiles, @mfiles, @dfiles) {
- # TODO:we need to handle removed in cvs and/or new (from git)
+foreach my $f (@afiles) {
+ my $status = `cvs -q status "$f" | grep '^File: '`;
+
+ unless ($status =~ m/Status: Unknown$/) {
+ $dirty = 1;
+ warn "File $f is already known in your CVS checkout!\n";
+ }
+}
+foreach my $f (@mfiles, @dfiles) {
+ # TODO:we need to handle removed in cvs
my $status = `cvs -q status "$f" | grep '^File: '`;
unless ($status =~ m/Status: Up-to-date$/) {