From: Yann Dirson Date: Fri, 6 Jan 2006 20:54:41 +0000 (+0100) Subject: Teach cvsexportcommit to add new files X-Git-Tag: v1.0.8^2~10 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=576cfc86fc321688aec0bc7359fb1097e5717631;p=git.git 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 --- diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index 5a8c01180..d5fbee7ba 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$/) {