--- upstream2/log_accum2 2006-05-13 18:45:02.972893895 -0400 +++ ./log_accum2 2006-05-13 18:48:04.099842536 -0400 @@ -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 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 # Roy Fielding removed useless code and added log/mail of new files @@ -441,7 +443,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 @@ -758,8 +760,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", @@ -791,7 +792,7 @@ foreach (@files) { - s/^.*\s.*$/`$&'/; + s/^.*\s.*$/`$&'/; #` (help Emacs syntax highlighting) $lines[++$#lines] = sprintf $format, " ", " " if length ($lines[$#lines]) + length ($_) > 65; $lines[$#lines] .= $_ . " "; @@ -912,7 +913,7 @@ my ($filename) = @_; my @text; - open FILE, "<$filename" or die "Cannot open log file $filename: $!"; + open FILE, "<$filename" or return (); while () { chomp; @@ -974,6 +975,7 @@ my ($url, $cvsroot, $branch, $oldrev, $newrev, $module, @list) = @_; my @urls; + my $args = "?cvsroot=" . urlencode $cvsroot; $args .= "&only_with_tag=$branch" if $branch; @@ -985,6 +987,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 @@ -1024,7 +1027,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; @@ -1241,14 +1244,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. #