[Codestriker-commits] CVS update: codestriker/lib/Codestriker/TopicListeners Email.pm
Brought to you by:
sits
|
From: <si...@us...> - 2008-09-27 04:27:38
|
User: sits
Date: 08/09/26 21:27:28
Modified: lib/Codestriker/TopicListeners Email.pm
Log:
Only show context line in emails if the context is actually available.
Index: Email.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/Email.pm,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- Email.pm 6 Sep 2008 00:31:50 -0000 1.36
+++ Email.pm 27 Sep 2008 04:27:27 -0000 1.37
@@ -395,10 +395,6 @@
if ($comment->{fileline} != -1) {
$body .= " line $comment->{fileline}.\n\n";
- # Only show the context for a comment made against a specific line.
- $body .= "Context:\n$EMAIL_HR\n\n";
- my $email_context = $Codestriker::EMAIL_CONTEXT;
-
# Retrieve the diff hunk for this file and line number.
my $delta =
Codestriker::Model::Delta->get_delta($comment->{topicid},
@@ -407,6 +403,11 @@
$comment->{filenew});
if (defined $delta) {
+ # Only show the context for a comment made against a specific line
+ # in the original review text.
+ $body .= "Context:\n$EMAIL_HR\n\n";
+ my $email_context = $Codestriker::EMAIL_CONTEXT;
+
my @text = ();
my $offset = $delta->retrieve_context($comment->{fileline}, $comment->{filenew},
$email_context, \@text);
|