[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: |
Mon, 22 May 2006 16:56:14 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Branch:
Changes by: Derek Robert Price <address@hidden> 06/05/22 16:56:14
Modified files:
contrib : ChangeLog log_accum.pl
Log message:
* log_accum.pl (set_defaults): Clone --mail-to for empty
--separate-diffs.
(%option_spec): Make --separate-diffs accept an optional list of
strings.
(main): Pass separate-diffs emails to mail_separate_diffs.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/contrib/ChangeLog.diff?tr1=1.198&tr2=1.199&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/contrib/log_accum.pl.diff?tr1=1.34&tr2=1.35&r1=text&r2=text
Patches:
Index: ccvs/contrib/ChangeLog
diff -u ccvs/contrib/ChangeLog:1.198 ccvs/contrib/ChangeLog:1.199
--- ccvs/contrib/ChangeLog:1.198 Mon May 22 15:08:25 2006
+++ ccvs/contrib/ChangeLog Mon May 22 16:56:13 2006
@@ -1,5 +1,11 @@
2006-05-22 Derek Price <address@hidden>
+ * log_accum.pl (set_defaults): Clone --mail-to for empty
+ --separate-diffs.
+ (%option_spec): Make --separate-diffs accept an optional list of
+ strings.
+ (main): Pass separate-diffs emails to mail_separate_diffs.
+
* log_accum.pl (mail_separate_diffs): Include the last diff.
(Original patch from Sylvain Beucler <address@hidden>.)
Index: ccvs/contrib/log_accum.pl
diff -u ccvs/contrib/log_accum.pl:1.34 ccvs/contrib/log_accum.pl:1.35
--- ccvs/contrib/log_accum.pl:1.34 Mon May 22 15:08:25 2006
+++ ccvs/contrib/log_accum.pl Mon May 22 16:56:14 2006
@@ -242,6 +242,8 @@
# send-diff Send diffs in email.
# diff-arg Reference to array of diff arguments.
# empty-diffs Send diffs from new files or to removed files.
+# separate-diffs Reference to array of email destinations, if array is
+# empty, references $config->{'mail-to'}.
# file-text Text to include in temp file names.
sub set_defaults
{
@@ -283,13 +285,27 @@
$config->{'cvsroot'} =~ s#^.*/([^/]*)$#$1#;
}
$config->{'send-diff'} = 1 if !exists $config->{'send-diff'};
- $config->{'empty-diffs'} = 1 if !exists $config->{'empty-diffs'};
$config->{'diff-arg'} = ["-ub"] if !exists $config->{'diff-arg'};
+ $config->{'empty-diffs'} = 1 if !exists $config->{'empty-diffs'};
+ if (exists $config->{'separate-diffs'})
+ {
+ # If --separate-diffs is ever specified without an argument,
+ # Getopt::Long pushes an empty string onto the array, so remove
+ # any empty strings.
+ @{$config->{'separate-diffs'}} = grep /\S/,
+ @{$config->{'separate-diffs'}};
+
+ # If no email addresses were specified, use the argument(s) to
+ # --mail-to.
+ $config->{'separate-diffs'} = $config->{'mail-to'}
+ unless @{$config->{'separate-diffs'}};
+ }
$config->{'file-text'} = "cvs" if !exists $config->{'file-text'};
# Just set $debug in a global. It's easier.
$debug = $config->{'debug'};
+ # Print some debugging info about the config when requested.
if ($debug)
{
for ("debug", "tag", "url", "cvsroot", "send-diff",
@@ -297,7 +313,7 @@
{
print STDERR "config{$_} => ", $config->{$_}, "\n";
}
- for ("mail-to", "diff-arg")
+ for ("mail-to", "diff-arg", "separate-diffs")
{
print STDERR "config{$_} => ", join (":", @{$config->{$_}}), "\n";
}
@@ -360,7 +376,7 @@
"diff-arg|D=s@",
"suppress-diffs-against-empties|E!",
"empty-diffs|e!",
- "separate-diffs|S!");
+ "separate-diffs|S:s@");
# Parse a config file. Any long command line option is valid in the config
# file, one option/argument pair per line. Lines /^\s*#/, empty lines,
@@ -790,8 +806,8 @@
# --- subdir/subfile3 20 May 2006 11:35:55 -0000 1.18
# +++ subdir/subfile3 20 May 2006 11:37:01 -0000 1.19
# @@ -1 +1 @@
-# -$Id: log_accum.pl,v 1.34 2006/05/22 15:08:25 dprice Exp $
-# +$Id: log_accum.pl,v 1.34 2006/05/22 15:08:25 dprice Exp $
+# -$Id: log_accum.pl,v 1.35 2006/05/22 16:56:14 dprice Exp $
+# +$Id: log_accum.pl,v 1.35 2006/05/22 16:56:14 dprice Exp $
while (@diffs)
{
@@ -1541,8 +1557,9 @@
$mailname, $subject, @header, @$body, @body_diff;
# Mail out the separate diffs when requested.
- mail_separate_diffs $config->{'mail-to'}, $module, $branch_lines->[0],
- $username, $fullname, $mailname, address@hidden,
@$diff
+ mail_separate_diffs $config->{'separate-diffs'}, $module,
+ $branch_lines->[0], $username, $fullname,
+ $mailname, address@hidden, @$diff
if $config->{'separate-diffs'};
#if ($config->{'gnats-email'}
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, (continued)
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/11
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/12
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/12
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/12
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/13
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/14
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/14
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/15
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/17
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/22
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl,
Derek Robert Price <=
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/22
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/22
- [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl, Derek Robert Price, 2006/05/23