- silence cat call in svnlib::common::isdir
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 28 Aug 2005 23:07:21 +0000 (23:07 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 28 Aug 2005 23:07:21 +0000 (23:07 +0000)
- revision numbers now view file on diff.php

diff.php
includes/svnlib.php

index b5a18e4c74db69dc02be169191f633804f97d6c8..0376bbfb9553911e139322add9cb9ceb174bcaef 100644 (file)
--- a/diff.php
+++ b/diff.php
@@ -30,14 +30,7 @@ if (empty($viewsvn->in['low']))
 
 $diff = new SVNDiff($repos, $relpath, $viewsvn->in['low'], $viewsvn->in['high']);
 
-if ($viewsvn->svn->common->isdir($path))
-{
-       $viewpg = 'browse';
-}
-else
-{
-       $viewpg = 'view';
-}
+$isdir = (bool)$viewsvn->svn->common->isdir($path);
 
 echo <<<HTML
 <style type="text/css">
@@ -74,10 +67,11 @@ foreach ($diff->fetch() AS $filename => $file)
                {
                        if ($key == 'hunk' AND isset($line['old']))
                        {
+                               $filepath = ($isdir ? $path . $filename : $path);
                                echo '
                        <tr style="background-color: #F7F7F7">
-                               <td><a href="/viewsvn/' . $viewsvn->paths->out($viewpg . '.php?rev=' . $viewsvn->in['low'], $path) . '">r' . $viewsvn->in['low'] . '</a></td>
-                               <td><a href="/viewsvn/' . $viewsvn->paths->out($viewpg . '.php?rev=' . $viewsvn->in['high'], $path) . '">r' . $viewsvn->in['high'] . '</a></td>
+                               <td><a href="/viewsvn/' . $viewsvn->paths->out('view.php?rev=' . $viewsvn->in['low'], $filepath) . '">r' . $viewsvn->in['low'] . '</a></td>
+                               <td><a href="/viewsvn/' . $viewsvn->paths->out('view.php?rev=' . $viewsvn->in['high'], $filepath) . '">r' . $viewsvn->in['high'] . '</a></td>
                                <td>&nbsp;</td>
                        </tr>';
                                continue;
index a35da19f69d818357c61c4c2093d55a8c1778385..cfa15fffc45df0fb87064ff11cac7b147a382069 100644 (file)
@@ -333,7 +333,7 @@ class SVNCommon
        */
        function isdir($path)
        {
-               $output = $this->registry->svn->cat($this->registry->paths->fetch_repos($path), $this->registry->paths->fetch_path($path), 'HEAD');
+               $output = @$this->registry->svn->cat($this->registry->paths->fetch_repos($path), $this->registry->paths->fetch_path($path), 'HEAD');
                $output = implode("\n", $output);
                if (strpos($output, 'svn:') === false)
                {