Lots of inter-page link work; revision stuff is now handled through the path manager
[viewsvn.git] / blame.php
1 <?php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # ViewSVN [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
12
13 require_once('./global.php');
14
15 $path = $viewsvn->paths->parse();
16 $repos = $viewsvn->paths->fetch_repos($path);
17 $relpath = $viewsvn->paths->fetch_path($path);
18
19 echo $viewsvn->paths->construct_breadcrumb($path, false);
20
21 echo '<br />';
22
23 echo '<a href="/viewsvn/' . $viewsvn->paths->out('log.php' . $viewsvn->paths->fetch_rev_str(), $path) . '">View Log</a>';
24
25 if ($viewsvn->svn->common->fetch_head_rev($path) != $viewsvn->paths->fetch_rev_num() AND $viewsvn->paths->fetch_rev_num() != 'HEAD')
26 {
27 echo ' - <a href="/viewsvn/' . $viewsvn->paths->out('blame.php' . $viewsvn->paths->fetch_rev_str(false, 'HEAD'), $path) . '">Go to HEAD</a>';
28 echo ' - <a href="/viewsvn/' . $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, 'HEAD', $viewsvn->paths->fetch_rev_num()), $path) . '">Diff to HEAD</a>';
29 }
30
31 $prev = $viewsvn->svn->common->fetch_prev_rev($path, $viewsvn->paths->fetch_rev_num());
32 if ($prev != -1)
33 {
34 echo ' - <a href="/viewsvn/' . $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, $viewsvn->paths->fetch_rev_num(), $prev), $path) . '">Diff to PREV</a>';
35 }
36
37 $blame = new SVNBlame($repos, $relpath, $viewsvn->paths->fetch_rev_num());
38
39 echo '<table cellspacing="1" cellpadding="1" style="background-color: #EFEFEF; font: 11px monospace" width="100%">';
40
41 foreach ($blame->fetch() AS $entry)
42 {
43 echo '
44 <tr style="background-color: white">
45 <td>' . $entry['rev'] . '</td>
46 <td>' . $entry['author'] . '</td>
47 <td>' . str_replace(array(' ', "\t"), array('&nbsp;', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'), htmlspecialchars($entry['line'])) . '</td>
48 </tr>';
49 }
50
51 echo '
52 </table>';
53
54 /*=====================================================================*\
55 || ###################################################################
56 || # $HeadURL$
57 || # $Id$
58 || ###################################################################
59 \*=====================================================================*/
60 ?>