Fix variable and blame bugs.
Dan Brook [Mon, 2 Aug 2010 09:17:06 +0000 (10:17 +0100)]
- Fix misnamed variable which was giving a syntax error in
Gitalist::Controller::Fragment::Ref.
- Fix blame view to display syntax highlighted blobs correctly instead of
outputting raw HTML.

Changes
lib/Gitalist.pm
lib/Gitalist/Controller/Fragment/Ref.pm
root/fragment/ref/blame.tt2

diff --git a/Changes b/Changes
index 9cbb854..f124f57 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,10 +1,16 @@
 This file documents the revision history for Perl extension Gitalist.
 
-0.002003 2010-07-04
+0.002004 2010-08-02
+    - Fix misnamed variable which was giving a syntax error in
+      Gitalist::Controller::Fragment::Ref.
+    - Fix blame view to display syntax highlighted blobs correctly
+      instead of outputting raw HTML.
+
+0.002003 2010-08-02
     - Fix for distribution not including script/env causing Makefile.PL
       and scripts to die.
 
-0.002002 2010-07-04
+0.002002 2010-08-01
     - Fix dist packaging issues.
 
 0.002001 2010-07-03
index a5a4313..d8c8a37 100644 (file)
@@ -14,7 +14,7 @@ use Catalyst qw/
                 SubRequest
 /;
 
-our $VERSION = '0.002003';
+our $VERSION = '0.002004';
 $VERSION = eval $VERSION;
 
 __PACKAGE__->config(
index 50788f7..718d195 100644 (file)
@@ -29,7 +29,7 @@ sub _diff {
       diff      => $patch,
       # XXX Hack hack hack, see View::SyntaxHighlight
       blobs     => [map $_->{diff}, @$patch],
-      %filename,
+      %diff_args,
     );
 }
 
index af465d4..7a62b05 100755 (executable)
@@ -1,3 +1,4 @@
+[%- IF mangled; INCLUDE inc/syntax_highlight_css.tt2; END -%]
 [% blame_lines = blob.split("\n") %]
  [% FOR info IN blame %]
  <tr class=''>
@@ -15,7 +16,9 @@
      <td nowrap class='commit-info'></td>
      [%- END -%]
    <td nowrap class='lineno' id='l[% info.meta.lineno %]' style='border-right: solid 3px #[% linecolour %]; border-left: solid 3px #[% linecolour %];'><tt><a href='[% c.uri_for_action('/ref/blame', [Repository.name, info.commit.sha1], filename.to_path ) %]#l[% info.meta.orig_lineno %]'>[% info.meta.lineno %]</a></tt></td>
-   <td nowrap class='data'><pre>[% blame_lines.${loop.index} | html %]</pre></td>
+   <td nowrap class='data'><pre>[%-
+     IF mangled; blame_lines.${loop.index}; ELSE; blame_lines.${loop.index} | html; END
+   -%]</pre></td>
    [% lastsha1 = info.commit.sha1 %]
  </tr>
  [% END %]