[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl
From: |
Derek Robert Price |
Subject: |
[Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl |
Date: |
Thu, 03 Aug 2006 17:42:22 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Changes by: Derek Robert Price <dprice> 06/08/03 17:42:22
Modified files:
contrib : ChangeLog log_accum.pl
Log message:
* log_accum.pl: Use proper Perl constants.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/contrib/ChangeLog?cvsroot=cvs&r1=1.213&r2=1.214
http://cvs.savannah.gnu.org/viewcvs/ccvs/contrib/log_accum.pl?cvsroot=cvs&r1=1.49&r2=1.50
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/contrib/ChangeLog,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -b -r1.213 -r1.214
--- ChangeLog 3 Aug 2006 17:31:44 -0000 1.213
+++ ChangeLog 3 Aug 2006 17:42:22 -0000 1.214
@@ -1,5 +1,7 @@
2006-08-03 Derek Price <address@hidden>
+ * log_accum.pl: Use proper Perl constants.
+
* log_accum.pl (get_topdir): Don't assume the directory list will be
ordered by increasing path length.
Index: log_accum.pl
===================================================================
RCS file: /cvsroot/cvs/ccvs/contrib/log_accum.pl,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- log_accum.pl 3 Aug 2006 17:31:44 -0000 1.49
+++ log_accum.pl 3 Aug 2006 17:42:22 -0000 1.50
@@ -82,14 +82,16 @@
############################################################
#
-# Constants - DO NOT CHANGE THESE.
+# Constants
#
############################################################
-my $STATE_NONE = 0;
-my $STATE_CHANGED = 1;
-my $STATE_ADDED = 2;
-my $STATE_REMOVED = 3;
-my $STATE_LOG = 4;
+use constant {
+ STATE_NONE => 0,
+ STATE_CHANGED => 1,
+ STATE_ADDED => 2,
+ STATE_REMOVED => 3,
+ STATE_LOG => 4
+};
@@ -485,7 +487,7 @@
sub process_stdin
{
my ($module, @files) = @_;
- my $state = $STATE_NONE;
+ my $state = STATE_NONE;
my (@branch_lines, @changed_files, @added_files,
@removed_files, @log_lines);
@@ -501,12 +503,12 @@
push @branch_lines, $2;
next;
}
- if (/^Modified Files/) { $state = $STATE_CHANGED; next; }
- if (/^Added Files/) { $state = $STATE_ADDED; next; }
- if (/^Removed Files/) { $state = $STATE_REMOVED; next; }
- if (/^Log Message/) { $state = $STATE_LOG; last; }
+ if (/^Modified Files/) { $state = STATE_CHANGED; next; }
+ if (/^Added Files/) { $state = STATE_ADDED; next; }
+ if (/^Removed Files/) { $state = STATE_REMOVED; next; }
+ if (/^Log Message/) { $state = STATE_LOG; last; }
- next if $state == $STATE_NONE || $state == $STATE_LOG;
+ next if $state == STATE_NONE || $state == STATE_LOG;
next if /^\s*$/; # ignore empty lines
# Sort the file list. This algorithm is a little cumbersome, but it
@@ -536,9 +538,9 @@
die "unrecognized file(s): `$_'" unless /^\s*$/;
# Store.
- push @changed_files, @matched and next if $state == $STATE_CHANGED;
- push @added_files, @matched and next if $state == $STATE_ADDED;
- push @removed_files, @matched and next if $state == $STATE_REMOVED;
+ push @changed_files, @matched and next if $state == STATE_CHANGED;
+ push @added_files, @matched and next if $state == STATE_ADDED;
+ push @removed_files, @matched and next if $state == STATE_REMOVED;
# Assertion.
die "unknown file state $state";
@@ -551,7 +553,7 @@
{
while (<STDIN>)
{
- next unless $state == $STATE_LOG; # eat all STDIN
+ next unless $state == STATE_LOG; # eat all STDIN
chomp;
push @log_lines, $_;
[Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/08/03
[Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/08/03
[Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/08/04