cvs-cvs
[Top][All Lists]
Advanced

[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: Tue, 23 May 2006 15:47:52 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Branch:         
Changes by:     Derek Robert Price <address@hidden>     06/05/23 15:47:52

Modified files:
        contrib        : ChangeLog log_accum.pl 

Log message:
        * log_accum.pl: Remove old FIXME.  Improve commenting.
        (append_to_file): Rename to...
        (append_files_to_file): ...this.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/contrib/ChangeLog.diff?tr1=1.201&tr2=1.202&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/contrib/log_accum.pl.diff?tr1=1.37&tr2=1.38&r1=text&r2=text

Patches:
Index: ccvs/contrib/ChangeLog
diff -u ccvs/contrib/ChangeLog:1.201 ccvs/contrib/ChangeLog:1.202
--- ccvs/contrib/ChangeLog:1.201        Mon May 22 17:26:44 2006
+++ ccvs/contrib/ChangeLog      Tue May 23 15:47:52 2006
@@ -1,3 +1,9 @@
+2006-05-23  Derek Price  <address@hidden>
+
+       * log_accum.pl: Remove old FIXME.  Improve commenting.
+       (append_to_file): Rename to...
+       (append_files_to_file): ...this.
+
 2006-05-22  Derek Price  <address@hidden>
 
        * log_accum.pl (mail_separate_diffs): Don't use RCS Id key in example.
Index: ccvs/contrib/log_accum.pl
diff -u ccvs/contrib/log_accum.pl:1.37 ccvs/contrib/log_accum.pl:1.38
--- ccvs/contrib/log_accum.pl:1.37      Mon May 22 17:26:44 2006
+++ ccvs/contrib/log_accum.pl   Tue May 23 15:47:52 2006
@@ -61,6 +61,11 @@
 # - do not perform a diff if a file is added or removed
 # Derek Price (2006-05-08):
 # - Perform the diff if added or removed unless -E is specified.
+# - Accept and process config files.
+# - Send one diff per file when requested.
+# - Tidy and perform some performance optimization.
+# - Format output.
+# - Use short cvsweb URLs.
 
 use strict;
 
@@ -124,109 +129,6 @@
 #
 ############################################################
 
-# FIXME: Temporarily disabled.
-#
-# do an 'cvs -Qn status' on each file in the arguments, and extract info.
-#
-#sub change_summary {
-#    my ($out, $toplevel, $module, $oldrev, $newrev, @filenames) = @_;
-#    my ($file, $rcsfile, $line, $vhost);
-#
-#    while (@filenames) {
-#        $file = shift @filenames;
-#
-#        if ("$file" eq "") {
-#            next;
-#        }
-#
-#        my $delta = "";
-#        $rcsfile = "$module/$file";
-#
-#        if ($oldrev->{$file}) {
-#            open(RCS, "-|") || exec "$CVSBIN/cvs", '-Qn', 'log',
-#                                  "-r" . $newrev->{$file},
-#                                  "--", $file;
-#            while (<RCS>) {
-#                if (/^date:.*lines:([^;]+);.*/) {
-#                    $delta = $1;
-#                    last;
-#                }
-#            }
-#            close(RCS);
-#        }
-#
-#        my $diff = "\n\n";
-#
-#      if ($SEND_URL eq "true")
-#        {
-#          # FIXME: Store this in a separate list.
-#
-#          $diff = "$CVSWEB_SCHEME://$CVSWEB_DOMAIN";
-#          $diff .= ":$CVSWEB_PORT" unless $CVSWEB_PORT eq "80";
-#          $diff .= "/$CVSWEB_URI/$toplevel/$module/$file";
-#        }
-#
-#        #
-#        # If this is a binary file, don't try to report a diff; not only is
-#        # it meaningless, but it also screws up some mailers.  We rely on
-#        # Perl's 'is this binary' algorithm; it's pretty good.  But not
-#        # perfect.
-#        #
-#        if ($file =~ /\.(?:pdf|gif|jpg|mpg)$/i or -B $file) {
-#          if ($SEND_URL eq "true")
-#        {
-#            $diff .= "&pathrev=" . $newrev->{$file};
-#          $diff .= "&content-type=application/octet-stream\n\n";
-#          }
-#        $diff .= "\t[Binary file]\n\n" if $SEND_DIFF eq "true";
-#        }
-#        else {
-#            #
-#            # Get the differences between this and the previous revision,
-#            # being aware that new files always have revision '1.1' and
-#            # new branches always end in '.n.1'.
-#            #
-#            if ($SEND_URL eq "true") {
-#              if (!$oldrev->{$file} || !$newrev->{$file}) {
-#                $diff .= "&rev=" . $oldrev->{$file};
-#              $diff .= "&content-type=text/x-cvsweb-markup\n\n";
-#              } else {
-#                $diff .= "&r1=" . $oldrev->{$file};
-#              $diff .= "&r2=" . $newrev->{$file}. "\n\n";
-#              }
-#          }
-#
-#            if ($SEND_DIFF eq "true"
-#              and ($SUPPRESS_DIFFS_AGAINST_EMPTIES eq "false"
-#                   or ($oldrev->{$file} and $newrev->{$file}))) {
-#            # Depends on user options, so let's remove that:
-#              #$diff .= "(In the diff below, changes in quantity "
-#              #      . "of whitespace are not shown.)\n\n";
-#              open(DIFF, "-|")
-#                || exec "$CVSBIN/cvs", '-Qn', 'diff', '-N', @diffargs,
-#                "-r" . $oldrev->{$file}, "-r" . $newrev->{$file}, '--', $file;
-#
-#              while (<DIFF>) {
-#                $diff .= $_;
-#              }
-#              close(DIFF);
-#
-#              $diff .= "\n\n";
-#           }
-#        }
-#
-#        append_line $out, sprintf "%-9s%-12s%s%s",
-#                                $newrev->{$file} ? $newrev->{$file} : "dead",
-#                                $delta, $rcsfile, $diff;
-#    }
-#}
-
-
-
-#######              ######
-#######   REVIEWED   ######
-#######              ######
-
 
 
 # Set the default configuration values.  This should be called after
@@ -1012,6 +914,7 @@
 
 
 
+# Blindly read the lines of a file into an array, removing any trailing EOLs.
 sub read_logfile
 {
     my ($filename) = @_;
@@ -1046,7 +949,16 @@
 
 
 
-sub append_to_file
+# Append a line to a file, like:
+#
+#    $dir/ $file[0] $file[1] $file[2]...
+#
+# It is assumed that there is no trailing / on $dir, initially.  Otherwise,
+# $dir is normalized before being written (./ indirections are removed and
+# consecutive /s are condensed).
+#
+# Noop if @files is empty.
+sub append_files_to_file
 {
     my ($filename, $dir, @files) = @_;
 
@@ -1196,6 +1108,8 @@
 
 
 
+# Blindly dump @lines into a file.  Noop if @lines is empty.  Otherwise,
+# creates the file, overwriting existing files.
 sub write_file
 {
     my ($filename, @lines) = @_;
@@ -1209,6 +1123,8 @@
 
 
 
+# Blindly append @lines into a file.  Noop if @lines is empty.  Otherwise,
+# appends to existing files, creating the file when needed.
 sub append_file
 {
     my ($filename, @lines) = @_;
@@ -1222,6 +1138,10 @@
 
 
 
+# Build a message body describing changes to files.  Returns an appropriate
+# subject, the message body, a reference to the log message, which is also
+# already in the message body, and the diff, which will not already be in the
+# message body.
 sub build_message_body
 {
     my ($config, $toplevel, $module, $branch, $changed_file, $added_file,
@@ -1288,6 +1208,8 @@
 
 
 
+# Blindly read the first line from a file, returning it without any trailing
+# EOL.
 sub read_line
 {
     my ($filename) = @_;
@@ -1443,10 +1365,10 @@
     # Spit out the information gathered in this pass.
     #
     write_file "$LOG_BASE.$i", @$log_lines if !-e "$LOG_BASE.$i" or 
address@hidden;
-    append_to_file "$BRANCH_BASE.$i",  $module, @$branch_lines;
-    append_to_file "$CHANGED_BASE.$i", $module, @$changed_files;
-    append_to_file "$ADDED_BASE.$i",   $module, @$added_files;
-    append_to_file "$REMOVED_BASE.$i", $module, @$removed_files;
+    append_files_to_file "$BRANCH_BASE.$i",  $module, @$branch_lines;
+    append_files_to_file "$CHANGED_BASE.$i", $module, @$changed_files;
+    append_files_to_file "$ADDED_BASE.$i",   $module, @$added_files;
+    append_files_to_file "$REMOVED_BASE.$i", $module, @$removed_files;
 
     if ($config->{'url'} || $config->{'send-diff'})
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]