X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-cvsexportcommit.perl;h=d5fbee7ba03b5c7064074539e8fd2c6518363b85;hb=5ea06e2014a910240408f74b9dab2128a30fd06c;hp=d49494abc22c79bea15d60a503a971dcd1e7650e;hpb=8b3fbeef395295c0d2de61265632ed30eda7bf0a;p=git.git diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index d49494ab..d5fbee7b 100755 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@ -78,7 +78,7 @@ $opt_v && print "Applying to CVS commit $commit from parent $parent\n"; # grab the commit message `git-cat-file commit $commit | sed -e '1,/^\$/d' > .msg`; -$? && die "Error extraction the commit message"; +$? && die "Error extracting the commit message"; my (@afiles, @dfiles, @mfiles); my @files = `git-diff-tree -r $parent $commit`; @@ -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$/) { @@ -188,7 +196,7 @@ my $cmd = "cvs commit -F .msg $commitfiles"; if ($dirtypatch) { print "NOTE: One or more hunks failed to apply cleanly.\n"; - print "Resolve the conflicts and then commit using:n"; + print "Resolve the conflicts and then commit using:\n"; print "\n $cmd\n\n"; exit(1); }