Adding language settings to config.php so that people can control the language output...
[viewsvn.git] / blame.php
index bcb1b438d540d864561f9557b8297e1f3fd2f9e4..17f8f9a8ae85a5983dbd90c03be4f39dfad16f36 100644 (file)
--- a/blame.php
+++ b/blame.php
@@ -2,7 +2,7 @@
 /*=====================================================================*\
 || ###################################################################
 || # ViewSVN [#]version[#]
-|| # Copyright ©2002-[#]year[#] Iris Studios, Inc.
+|| # Copyright ©2002-[#]year[#] Blue Static
 || #
 || # This program is free software; you can redistribute it and/or modify
 || # it under the terms of the GNU General Public License as published by
@@ -24,39 +24,28 @@ $fetchtemplates = array(
        'blame'
 );
 
+define('SVN', '$Id$');
+
 require_once('./global.php');
 
-$navbar = $controller->construct_breadcrumb();
+$navbar = ConstructNavbar();
 
 // ###################################################################
 
-$latest = $controller->cachev->fetch_node();
-
-$link['log'] = $controller->href_compound('log.php');
-
-$show['head'] = ($latest['revision'] != $controller->revctx);
-if ($show['head'])
-{
-       $link['gohead'] = $controller->href_compound('blame.php', null, Paths::fetch_rev_str(false, 'HEAD'));
-       $link['diffhead'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, 'HEAD', $contoller->revctx));
-}
-
-$show['prev'] = ($prev = $controller->cachev->fetch_prev_revision($controller->revctx));
-if ($show['prev'])
-{
-       $link['diffprev'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, $controller->revctx, $prev));
-}
-
-// ###################################################################
+$revision = new Revision($input->in['repos'], $input->in['rev'], $input->in['path']);
 
-$blame = new SVNBlame($controller);
+$blame = BSXml::Parse($lib->run('blame --xml -r' . $revision->revision . ' ' . $lib->arg($repos->fetchPath($input->in['repos']) . $input->in['path']) . '@' . $revision->revision, true));
+$blame = $blame['blame']['target']['entry'];
+BSXml::UnifyNode($blame);
 
-$lines = '';
+$catdata = $lib->run('cat -r' . $revision->revision . ' ' . $lib->arg($repos->fetchPath($input->in['repos']) . $input->in['path']) . '@' . $revision->revision);
 
-foreach ($blame->fetch() AS $entry)
+foreach ($catdata AS $num => $line)
 {
-       $entry['view_link'] = $controller->href_compound('view.php', null, Paths::fetch_rev_str(false, $entry['rev']));
-       $entry['line_clean'] = SVNCommon::format($entry['line']);
+       $revision = $blame[$num]['commit']['revision'];
+       $author = $blame[$num]['commit']['author']['value'];
+       $view = ConstructLink('view', $input->in['repos'], $input->in['path'], $revision);
+       $line = FormatCode($line);
        eval('$lines .= "' . $template->fetch('blame_line') . '";');
 }