# Global variables
my (@files) = ();
my (@ebuilds) = ();
+my (@conflicts) = ();
my (@unknown) = ();
my ($input, $editor, $entry, $user, $date, $text, $version, $year);
my (@new_versions) = ();
open C, 'cvs -fn up 2>&1 |' or die "Can't run cvs -fn up: $!\n";
while (<C>) {
/ChangeLog/ and next;
- /^\? (\S+)/ and push @unknown, $1;
- /^([ARMC]) (\S+)/ or next;
+ /^\? (\S+)/ and do { push @unknown, $1; next; };
+ /^C (\S+)/ and do { push @conflicts, $1; next; };
+ /^([ARM]) (\S+)/ or next;
push @files, $2;
- ($actions{$2} = $1) =~ tr/ARMC/+-/d;
+ ($actions{$2} = $1) =~ tr/ARM/+-/d;
}
-if (grep !/files.digest|Manifest/, @unknown) {
+if (@conflicts) {
+ print STDERR <<EOT;
+Cvs reports the following conflicts. Please resolve them before
+running echangelog.
+EOT
+ print STDERR map "C $_\n", @conflicts;
+ exit 1;
+}
+@unknown = grep !/files.digest|Manifest/, @unknown;
+if (@unknown) {
print STDERR <<EOT;
Cvs reports the following unknown files. Please use "cvs add" before
running echangelog, or remove the files in question.
EOT
- print STDERR "? ", join("\n? ", @unknown), "\n";
+ print STDERR map "? $_\n", @unknown;
exit 1;
}
print STDERR "** be run after all affected files have been added and/or\n";
print STDERR "** modified. Did you forget to cvs add?\n";
print STDERR "**\n";
+ @files = qw/ChangeLog/; # per request from Donnie Berkholz
}
# Get the input from the cmdline, editor or stdin