[Codestriker-commits] CVS update: codestriker/lib/Codestriker/TopicListeners Email.pm
Brought to you by:
sits
|
From: <si...@us...> - 2008-08-04 11:22:58
|
User: sits
Date: 08/08/04 04:22:57
Modified: . CHANGELOG
lib/Codestriker/Action ViewTopic.pm
template/en/default viewtopic.html.tmpl
lib/Codestriker/TopicListeners Email.pm
Log:
* Show total added/removed line count after table of contents on view
topic screen. Also show same line counts on create topic email.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.251
retrieving revision 1.252
diff -u -r1.251 -r1.252
--- CHANGELOG 4 Aug 2008 10:33:34 -0000 1.251
+++ CHANGELOG 4 Aug 2008 11:22:55 -0000 1.252
@@ -36,7 +36,10 @@
* Fixed the parsing of Subversion diffs which contained modifications
within property sets. Also fixed case where file in diff is empty.
- Reported by cle...@us....
+ Reported by cle...@us....
+
+* Show total added/removed line count after table of contents on view
+ topic screen. Also show same line counts on create topic email.
Version 1.9.5
Index: ViewTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopic.pm,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- ViewTopic.pm 24 Jun 2008 02:56:15 -0000 1.63
+++ ViewTopic.pm 4 Aug 2008 11:22:55 -0000 1.64
@@ -188,11 +188,17 @@
# Setup the filetable template variable for displaying the table of
# contents.
my @filetable = ();
+ my $total_old_changes = 0;
+ my $total_new_changes = 0;
for (my $i = 0; $i <= $#filenames; $i++) {
my $filerow = {};
my $filename = $filenames[$i];
$filerow->{filename} = $filename;
$filerow->{numchanges} = $numchanges[$i];
+ if (defined $numchanges[$i] && $numchanges[$i] =~ /^\+(\d+),\-(\d+)$/o) {
+ $total_old_changes += $2;
+ $total_new_changes += $1;
+ }
$filerow->{href_filename_url} =
$url_builder->view_url($topicid, -1, $mode, $i) .
"#" . $filename;
@@ -212,6 +218,8 @@
push @filetable, $filerow;
}
$vars->{'filetable'} = \@filetable;
+ $vars->{'total_old_changes'} = $total_old_changes;
+ $vars->{'total_new_changes'} = $total_new_changes;
# Determine which deltas are to be retrieved.
my @deltas = ();
Index: viewtopic.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopic.html.tmpl,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- viewtopic.html.tmpl 27 Jun 2008 00:19:10 -0000 1.52
+++ viewtopic.html.tmpl 4 Aug 2008 11:22:56 -0000 1.53
@@ -78,6 +78,9 @@
</td>
</tr>
[% END %]
+ <tr>
+ <td class="pf" colspan="3" align="right"><font size="-1">{+[% total_new_changes %],-[% total_old_changes %]}</font></td>
+ </tr>
</table>
</table>
Index: Email.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/Email.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- Email.pm 14 Mar 2008 01:30:53 -0000 1.26
+++ Email.pm 4 Aug 2008 11:22:56 -0000 1.27
@@ -47,12 +47,13 @@
my $bcc = $topic->{author};
# Send out the list of files changes when creating a new topic.
- my (@filenames, @revisions, @offsets, @binary);
+ my (@filenames, @revisions, @offsets, @binary, @numchanges);
$topic->get_filestable(
\@filenames,
\@revisions,
\@offsets,
- \@binary);
+ \@binary,
+ \@numchanges);
# Determine if any topics are obsoleted by this topic.
my $query = new CGI;
@@ -74,8 +75,22 @@
"$topic->{description}\n\n" .
$obsolete_text .
"$EMAIL_HR\n\n" .
- "The topic was created with the following files:\n\n" .
- join("\n",@filenames);
+ "The topic was created with the following files:\n\n";
+
+ my $total_old_changes = 0;
+ my $total_new_changes = 0;
+ for (my $i = 0; $i <= $#filenames; $i++) {
+ $notes .= $filenames[$i];
+ if (defined $numchanges[$i]) {
+ $notes .= " {" . $numchanges[$i] . "}";
+ if ($numchanges[$i] =~ /^\+(\d+),\-(\d+)$/o) {
+ $total_old_changes += $2;
+ $total_new_changes += $1;
+ }
+ }
+ $notes .= "\n";
+ }
+ $notes .= "\nTotal line count: {+" . $total_new_changes . ",-" . $total_old_changes . "}\n";
return $self->_send_topic_email($topic, 1, "Created", 1, $from, $to, $cc,
$bcc, $notes);
|