cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] ccvs/contrib ChangeLog commit_prep.pl log_accum.pl


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/contrib ChangeLog commit_prep.pl log_accum.pl
Date: Sun, 14 May 2006 03:46:41 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Branch:         
Changes by:     Derek Robert Price <address@hidden>     06/05/14 03:46:41

Modified files:
        contrib        : ChangeLog commit_prep.pl log_accum.pl 

Log message:
        * commit_prep.pl: Sync comments with recent changes.
        * log_accum.pl: Ditto.
        (read_logfile): Ignore missing log files.
        (build_message_body): Indent log text.
        (main): Don't build cvsweb URLs unless requested.
        (Patch from Sylvain Beucler <address@hidden>.)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/contrib/ChangeLog.diff?tr1=1.192&tr2=1.193&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/contrib/commit_prep.pl.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/contrib/log_accum.pl.diff?tr1=1.28&tr2=1.29&r1=text&r2=text

Patches:
Index: ccvs/contrib/ChangeLog
diff -u ccvs/contrib/ChangeLog:1.192 ccvs/contrib/ChangeLog:1.193
--- ccvs/contrib/ChangeLog:1.192        Sun May 14 03:27:12 2006
+++ ccvs/contrib/ChangeLog      Sun May 14 03:46:41 2006
@@ -1,5 +1,12 @@
 2006-05-13  Derek Price  <address@hidden>
 
+       * commit_prep.pl: Sync comments with recent changes.
+       * log_accum.pl: Ditto.
+       (read_logfile): Ignore missing log files.
+       (build_message_body): Indent log text.
+       (main): Don't build cvsweb URLs unless requested.
+       (Patch from Sylvain Beucler <address@hidden>.)
+
        * log_accum.pl: Use only the last dir from CVSROOT in cvsweb URLs by
        default.
 
Index: ccvs/contrib/commit_prep.pl
diff -u ccvs/contrib/commit_prep.pl:1.8 ccvs/contrib/commit_prep.pl:1.9
--- ccvs/contrib/commit_prep.pl:1.8     Wed May 10 17:37:15 2006
+++ ccvs/contrib/commit_prep.pl Sun May 14 03:46:41 2006
@@ -27,8 +27,8 @@
 # name to use.  See $LAST_FILE below.
 #
 # Sample CVSROOT/commitinfo:
-# ALL /usr/local/bin/commit_prep -T ccvs_1 %r/%p
-# ^prog1\(/\|$\) /usr/local/bin/commit_prep -T ccvs_2 %r/%p
+# ALL /usr/local/bin/commit_prep -T ccvs_1 %p
+# ^prog1\(/\|$\) /usr/local/bin/commit_prep -T ccvs_2 %p
 #
 # Contributed by David Hampton <address@hidden>
 # Stripped to minimum by Roy Fielding
@@ -76,11 +76,12 @@
     }
     else
     {
-       # The non-option argument is the complete path to the current
-       # commit directory.  It is written in a file and read by log_accum
-       # after being character-escaped.  No security issues here.  We still
-       # check for '..' and ensure this is a full path.
-       if ($arg !~ m#(^|/)\.\.(/|\$)# && $arg =~ m#^([^/].*)$#)
+       # The non-option argument is a relative path to the current
+       # commit directory.  It is written in a file and read by
+       # log_accum after being character-escaped.  No security issues
+       # here. We still check for '..' and ensure this is not a full
+       # path.
+       if ($arg !~ m#(^|/)\.\.(/|\$)# and $arg =~ m#^([^/].*)$#)
        {
            $full_directory_path = $1;
        }
Index: ccvs/contrib/log_accum.pl
diff -u ccvs/contrib/log_accum.pl:1.28 ccvs/contrib/log_accum.pl:1.29
--- ccvs/contrib/log_accum.pl:1.28      Sun May 14 03:27:12 2006
+++ ccvs/contrib/log_accum.pl   Sun May 14 03:46:41 2006
@@ -23,7 +23,7 @@
 #
 # IMPORTANT: what the above means is, this script interacts with
 # commit_prep, in that they have to agree on the tmpfile name to use.
-# See $LAST_FILE below. 
+# See option -T / --file-prefix below. 
 #
 # How this works: CVS triggers this script once for each directory
 # involved in the commit -- in other words, a single commit can invoke
@@ -38,7 +38,9 @@
 # combines that with what it found out on this pass, and sends a
 # commit message to the appropriate mailing list.
 #
-# (Ask Karl Fogel <address@hidden> if questions.)
+# You usually call log_accum from CVSROOT/loginfo, for example:
+# ALL /usr/local/bin/log_accum -T ccvs_1 --config /etc/log_accum.config 
--mail-to address@hidden --send-diff %p %{sVv}
+# ^prog1\(/\|$\) /usr/local/bin/log_accum -T ccvs_2 --config 
/etc/log_accum.config -m address@hidden %p %{sVv}
 #
 # Contributed by David Hampton <address@hidden>
 # Roy Fielding removed useless code and added log/mail of new files
@@ -445,7 +447,7 @@
 # Diff support:
 # * -d
 #   --diff
-#   --send-diff        - (defult) Send diffs in emails.
+#   --send-diff        - (default) Send diffs in emails.
 # * -D DIFF_ARG
 #   --diff-arg DIFF_ARG
 #              - Pass DIFF_ARG to `cvs diff' when generating diffs.  Defaults
@@ -762,8 +764,7 @@
 
     print STDERR "get_temp_files: $tmpdir, $temp_name, $id\n" if $debug;
 
-    # Created by commit_prep!
-    return "$tmpdir/#$temp_name.$id.lastdir",
+    return "$tmpdir/#$temp_name.$id.lastdir", # Created by commit_prep!
           "$tmpdir/#$temp_name.$id.log",
           "$tmpdir/#$temp_name.$id.branch",
           "$tmpdir/#$temp_name.$id.added",
@@ -795,7 +796,7 @@
 
     foreach (@files)
     {
-       s/^.*\s.*$/`$&'/;
+       s/^.*\s.*$/`$&'/; #` (help Emacs syntax highlighting)
        $lines[++$#lines] = sprintf $format, " ", " "
            if length ($lines[$#lines]) + length ($_) > 65;
        $lines[$#lines] .= $_ . " ";
@@ -916,7 +917,7 @@
     my ($filename) = @_;
     my @text;
 
-    open FILE, "<$filename" or die "Cannot open log file $filename: $!";
+    open FILE, "<$filename" or return ();
     while (<FILE>)
     {
         chomp;
@@ -989,6 +990,7 @@
     {
        my $out = "$baseurl/" . urlencode ($_);
 
+       # FIXME: if file is -kb, consider binary
         if ($_ =~ /\.(?:pdf|gif|jpg|mpg)$/i or -B $_ || !$oldrev->{$_})
        {
            # if binary or new, link directly
@@ -1028,7 +1030,7 @@
 
     @log_text = read_logfile $log_file;
     push @body, "Log message:";
-    push @body, @log_text;
+    push @body, map { "\t$_" } @log_text;
     push @body, "";
 
     $subject = compile_subject $branch, @subject_files;
@@ -1245,14 +1247,17 @@
     append_to_file "$ADDED_BASE.$i",   $module, @$added_files;
     append_to_file "$CHANGED_BASE.$i", $module, @$changed_files;
     append_to_file "$REMOVED_BASE.$i", $module, @$removed_files;
-    append_file "$URL_BASE.$i", build_cvsweb_urls $config->{'url'},
-                                                 $config->{'cvsroot'},
-                                                 $branch_lines->[0],
-                                                 $oldrev, $newrev, $module,
-                                                 @$added_files,
-                                                 @$changed_files,
-                                                 @$removed_files;
-
+    if ($config->{'url'})
+    {
+       append_file "$URL_BASE.$i", build_cvsweb_urls ($config->{'url'},
+                                                      $config->{'cvsroot'},
+                                                      $branch_lines->[0],
+                                                      $oldrev, $newrev, 
$module,
+                                                      @$added_files,
+                                                      @$changed_files,
+                                                      @$removed_files);
+    }
+       
     #
     # Check whether this is the last directory.  If not, quit.
     #




reply via email to

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