Adding language settings to config.php so that people can control the language output...
[viewsvn.git] / blame.php
index 863709f1fb15f3c9b54f9055c9fa53d54c3a0a25..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,37 +24,28 @@ $fetchtemplates = array(
        'blame'
 );
 
+define('SVN', '$Id$');
+
 require_once('./global.php');
 
-$navbar = $viewsvn->paths->construct_breadcrumb($viewsvn->paths->path, false);
+$navbar = ConstructNavbar();
 
 // ###################################################################
 
-$link['log'] = $viewsvn->paths->out('log.php' . $viewsvn->paths->revstr, $viewsvn->paths->path);
-
-$show['head'] = ($viewsvn->svn->common->fetch_head_rev($viewsvn->paths->path) != $viewsvn->paths->revnum AND $viewsvn->paths->revnum != 'HEAD');
-if ($show['head'])
-{
-       $link['gohead'] = $viewsvn->paths->out('blame.php' . $viewsvn->paths->fetch_rev_str(false, 'HEAD'), $viewsvn->paths->path);
-       $link['diffhead'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, 'HEAD', $viewsvn->paths->revnum), $viewsvn->paths->path);
-}
-
-$show['prev'] = (($prev = $viewsvn->svn->common->fetch_prev_rev($viewsvn->paths->path, $viewsvn->paths->revnum)) != -1 ? true : false);
-if ($show['prev'])
-{
-       $link['diffprev'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, $viewsvn->paths->revnum, $prev), $viewsvn->paths->path);
-}
-
-// ###################################################################
+$revision = new Revision($input->in['repos'], $input->in['rev'], $input->in['path']);
 
-$blame = new SVNBlame($viewsvn->paths->repos, $viewsvn->paths->relpath, $viewsvn->paths->revnum);
+$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'] = $viewsvn->paths->out('view.php' . $viewsvn->paths->fetch_rev_str(false, $entry['rev']), $viewsvn->paths->path);
-       $entry['line_clean'] = $viewsvn->svn->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') . '";');
 }