diff options
author | joe <joe@FreeBSD.org> | 2001-12-04 06:37:43 +0800 |
---|---|---|
committer | joe <joe@FreeBSD.org> | 2001-12-04 06:37:43 +0800 |
commit | 30784c442db1f630e9cf8fcaa0ca09bc1fae4bc0 (patch) | |
tree | 2eb49432184dace8abede488ae699084d32ce50a /CVSROOT | |
parent | d66dabe3832dd9f598c50737e7efd4826c83c54b (diff) | |
download | freebsd-ports-gnome-30784c442db1f630e9cf8fcaa0ca09bc1fae4bc0.tar.gz freebsd-ports-gnome-30784c442db1f630e9cf8fcaa0ca09bc1fae4bc0.tar.zst freebsd-ports-gnome-30784c442db1f630e9cf8fcaa0ca09bc1fae4bc0.zip |
Define $DIFF_BLOCK_TOTAL_LINES to restrict the maximum number of
lines of diff in a commit email.
Diffstat (limited to 'CVSROOT')
-rwxr-xr-x | CVSROOT/cfg.pm | 12 | ||||
-rwxr-xr-x | CVSROOT/log_accum.pl | 25 |
2 files changed, 29 insertions, 8 deletions
diff --git a/CVSROOT/cfg.pm b/CVSROOT/cfg.pm index 447fd0337ff3..3a9a62dbd69d 100755 --- a/CVSROOT/cfg.pm +++ b/CVSROOT/cfg.pm @@ -15,11 +15,11 @@ package cfg; use strict; use vars qw( $ADD_TO_LINE $AVAIL_FILE $CHECK_HEADERS $COMMITCHECK_EXTRA - @COMMIT_HOSTS $COMMITTER $DEBUG $EXCLUDE_FILE $FILE_PREFIX $IDHEADER - $LAST_FILE @LOG_FILE_MAP $MAILADDRS $MAILBANNER $MAILCMD - $MAIL_BRANCH_HDR $MAIL_ON_DIR_CREATION $MAIL_TRANSFORM $MINCVSVERSION - $MAX_DIFF_SIZE $NO_DOS_LINEBREAKS $PID $PROG_CVS $PROG_MV - %TEMPLATE_HEADERS $TMPDIR $UNEXPAND_RCSID $WARN_HEADERS + @COMMIT_HOSTS $COMMITTER $DEBUG $DIFF_BLOCK_TOTAL_LINES $EXCLUDE_FILE + $FILE_PREFIX $IDHEADER $LAST_FILE @LOG_FILE_MAP $MAILADDRS $MAILBANNER + $MAILCMD $MAIL_BRANCH_HDR $MAIL_ON_DIR_CREATION $MAIL_TRANSFORM + $MINCVSVERSION $MAX_DIFF_SIZE $NO_DOS_LINEBREAKS $PID $PROG_CVS + $PROG_MV %TEMPLATE_HEADERS $TMPDIR $UNEXPAND_RCSID $WARN_HEADERS ); my $CVSROOT = $ENV{'CVSROOT'} || die "Can't determine \$CVSROOT!"; @@ -212,6 +212,8 @@ $MAIL_TRANSFORM = ""; # commit mail for each file modified. (0 = off). $MAX_DIFF_SIZE = 0; +# Maximum size of in lines of the diff block. +$DIFF_BLOCK_TOTAL_LINES = 200; ###################### diff --git a/CVSROOT/log_accum.pl b/CVSROOT/log_accum.pl index dbe25e764afd..3c0f3963a73a 100755 --- a/CVSROOT/log_accum.pl +++ b/CVSROOT/log_accum.pl @@ -830,6 +830,7 @@ if (-e $LAST_FILE) { # # Produce the final compilation of the log messages # +my $diff_num_lines = $cfg::DIFF_BLOCK_TOTAL_LINES; for (my $i = 0; ; $i++) { last unless -e "$LOG_FILE.$i"; @@ -858,10 +859,28 @@ for (my $i = 0; ; $i++) { # &do_changes_file(@log_msg); + # # Add the diff after writing the log files. - if (-e "$DIFF_FILE.$i") { - push @log_msg, " ", map {" $_"} - read_logfile("$DIFF_FILE.$i"); + # + if (-e "$DIFF_FILE.$i" and $diff_num_lines > 0) { + my @diff_block = read_logfile("$DIFF_FILE.$i"); + + my $lines_to_use = scalar @diff_block; + $lines_to_use = $diff_num_lines + if $lines_to_use > $diff_num_lines; + + push @log_msg, " ", + map {" $_"} @diff_block[0 .. $lines_to_use - 1]; + + $diff_num_lines -= $lines_to_use; + if ($diff_num_lines <= 0) { + push @log_msg, "", + "----------------------------------------------", + "Diff block truncated. (Max lines = " . + $cfg::DIFF_BLOCK_TOTAL_LINES . ")", + "----------------------------------------------", + ""; + } } # |