Adding links in browse.php and view.php to view the changes and go to the head revisi...
[viewsvn.git] / view.php
index 4475bc8235ce38da907e80313ab9640722862cad..e0635c555ad201f6db24fba08ed45834c679a52a 100644 (file)
--- a/view.php
+++ b/view.php
@@ -32,7 +32,22 @@ $navbar = ConstructNavbar();
 
 // ###################################################################
 
-$revision = new Revision($input->in['repos'], $input->in['rev'], $input->in['path']);
+$revision = $headRev = new Revision($input->in['repos'], $input->in['rev'], $input->in['path']);
+if ($input->in['rev'])
+{
+       $headRev = new Revision($input->in['repos'], 0, $input->in['path']);
+       if ($headRev->revision != $revision->revision)
+       {
+               $show['head'] = true;
+               $link['gohead'] = ConstructLink('browse', $input->in['repos'], $input->in['path'], 0);
+       }
+}
+
+if ($revision->revision - 1 > 0)
+{
+       $show['diff'] = true;
+       $link['diff'] = ConstructLink('diff', $input->in['repos'], $input->in['path'], $revision->revision);
+}
 
 // ###################################################################