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>
Yann Dirson committed
Jan 6, 2006 at 21:54 UTC
576cfc86fc321688aec0bc7359fb1097e5717631
1 file changed
+10
-2
git-cvsexportcommit.perl
+10
-2
@@ -103,8 +103,16 @@ undef @files; # don't need it anymore
103
104
# check that the files are clean and up to date according to cvs
105
my $dirty;
106
-foreach my $f (@afiles, @mfiles, @dfiles) {
107
- # TODO:we need to handle removed in cvs and/or new (from git)
106
+foreach my $f (@afiles) {
107
+ my $status = `cvs -q status "$f" | grep '^File: '`;
108
+
109
+ unless ($status =~ m/Status: Unknown$/) {
110
+ $dirty = 1;
111
+ warn "File $f is already known in your CVS checkout!\n";
112
+ }
113
+}
114
+foreach my $f (@mfiles, @dfiles) {
115
+ # TODO:we need to handle removed in cvs
116
my $status = `cvs -q status "$f" | grep '^File: '`;
117
118
unless ($status =~ m/Status: Up-to-date$/) {