summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--trunk/src/echangelog/ChangeLog5
-rw-r--r--trunk/src/echangelog/echangelog22
2 files changed, 22 insertions, 5 deletions
diff --git a/trunk/src/echangelog/ChangeLog b/trunk/src/echangelog/ChangeLog
index 698167e..d5215eb 100644
--- a/trunk/src/echangelog/ChangeLog
+++ b/trunk/src/echangelog/ChangeLog
@@ -1,3 +1,8 @@
+26 Apr 2005 Aron Griffis <agriffis@gentoo.org>
+ * detect conflicts explicitly
+ * report ChangeLog in the list of files if it's the only file that is
+ changing #90326
+
23 Mar 2005 Aron Griffis <agriffis@gentoo.org>
* handle package moves without adding new version lines
diff --git a/trunk/src/echangelog/echangelog b/trunk/src/echangelog/echangelog
index 0aed254..f8c795a 100644
--- a/trunk/src/echangelog/echangelog
+++ b/trunk/src/echangelog/echangelog
@@ -21,6 +21,7 @@ $Text::Wrap::unexpand = 0;
# Global variables
my (@files) = ();
my (@ebuilds) = ();
+my (@conflicts) = ();
my (@unknown) = ();
my ($input, $editor, $entry, $user, $date, $text, $version, $year);
my (@new_versions) = ();
@@ -54,17 +55,27 @@ if (-f 'ChangeLog') {
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;
}
@@ -209,6 +220,7 @@ unless (@files) {
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