diff.php now runs without throwing errors, but it's still not working per se
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 22 Jan 2006 20:22:10 +0000 (20:22 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 22 Jan 2006 20:22:10 +0000 (20:22 +0000)
diff.php
includes/svnlib.php

index a9ad0127dd976cd78e434c3fcc7cb43cb94f4293..949204dde1cb76a29a4fb9cec986622e83d748b7 100644 (file)
--- a/diff.php
+++ b/diff.php
@@ -30,47 +30,47 @@ $fetchtemplates = array(
 
 require_once('./global.php');
 
-$navbar = $viewsvn->paths->construct_breadcrumb($viewsvn->paths->path, false);
+$navbar = $controller->construct_breadcrumb();
 
 // ###################################################################
 
-$link['log'] = $viewsvn->paths->out('log.php' . $viewsvn->paths->revstr, $viewsvn->paths->path);
+$link['log'] = $controller->href_compound('log.php');
 
 // ###################################################################
 
-$revs = $viewsvn->paths->fetch_rev_num(true);
+$revs = Paths::fetch_rev_num(true);
 $high = $revs['high'];
 $low = $revs['low'];
 
 if ($high == 'HEAD')
 {
-       $high = $viewsvn->svn->common->fetch_head_rev($viewsvn->paths->path);
+       $high = $controller->cachev->fetch_head_revision();
 }
 
 if ($low == 0)
 {
-       $low = $viewsvn->svn->common->fetch_prev_rev($viewsvn->paths->path, $high);
+       $low = $controller->cachev->fetch_prev_revision($high);
 }
 
 // ###################################################################
 
-$show['fullchangeset'] = ($viewsvn->paths->is_root_path($viewsvn->paths->path) ? false : true);
+$show['fullchangeset'] = (Paths::is_root_path($controller->path) ? false : true);
 if ($show['fullchangeset'])
 {
-       $link['changeset'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, $high, $low), $viewsvn->paths->repos . '/');
+       $link['changeset'] = $controller->href_struct('diff.php' . Paths::fetch_rev_str(true, $high, $low), $controller->repos . '/');
 }
 
-$log = $viewsvn->svn->common->fetch_log($viewsvn->paths->path, $high);
+$log = $controller->cachev->fetch_revision($high);
 
-$log['message_clean'] = $viewsvn->svn->format_log_message($log['message']);
+$log['message_clean'] = SVNCommon::format_log_message($log['message']);
 
-$files = $viewsvn->svn->common->construct_file_changes($log['files'], $viewsvn->paths->repos, $high);
+$files = SVNCommon::construct_file_changes($log['files'], $controller->repos, $high);
 
 // ###################################################################
 
-$diff = new SVNDiff($viewsvn->paths->repos, $viewsvn->paths->relpath, $low, $high);
+$diff = new SVNDiff($controller, $low, $high);
 
-$isdir = (bool)$viewsvn->svn->common->isdir($viewsvn->paths->path);
+$isdir = (bool)$controller->cachev->isdir();
 
 $changes = '';
 
@@ -96,9 +96,9 @@ foreach ($diff->fetch() AS $filename => $file)
                        $show['hunk'] = false;
                        if ($key == 'hunk' AND isset($line['old']))
                        {
-                               $filepath = ($isdir ? $viewsvn->paths->path . $filename : $viewsvn->paths->path);
-                               $rlow = $viewsvn->paths->out('view.php' . $viewsvn->paths->fetch_rev_str(false, $low), $filepath);
-                               $rhigh = $viewsvn->paths->out('view.php' . $viewsvn->paths->fetch_rev_str(false, $high), $filepath);
+                               $filepath = ($isdir ? $controller->path . $filename : $controller->path);
+                               $rlow = $controller->href_struct('view.php' . Paths::fetch_rev_str(false, $low), $filepath);
+                               $rhigh = $controller->href_struct('view.php' . Paths::fetch_rev_str(false, $high), $filepath);
                                $show['hunk'] = true;
                        }
                        else
@@ -116,7 +116,7 @@ foreach ($diff->fetch() AS $filename => $file)
                                        $class = 'diff_norm';
                                }
                                
-                               $line['line_clean'] = $viewsvn->svn->format($line['line']);
+                               $line['line_clean'] = SVNCommon::format($line['line']);
                        }
                        
                        eval('$lines .= "' . $template->fetch('diff_line') . '";');
index 63344b8f2a64f7a37be6f1ffa7c017cdc40ba917..d2b962b60c04869b3255e405b71cc867001667be 100644 (file)
@@ -153,19 +153,17 @@ class SVNLib
        *
        * @access       protected
        *
-       * @param        string  Repository
-       * @param        string  Path
        * @param        integer Lower revision
        * @param        integer Higher revision
        *
        * @return       array   Lines of diff output
        */
-       function diff($repos, $path, $lorev, $hirev)
+       function diff($lorev, $hirev)
        {
                global $viewsvn;
                
-               $hirev = $this->rev($hirev);
-               $lorev = $this->rev($lorev);
+               $hirev = SVNCommon::rev($hirev);
+               $lorev = SVNCommon::rev($lorev);
                if ($lorev == 'HEAD')
                {
                        $lorev = 1;
@@ -183,9 +181,7 @@ class SVNLib
                        }
                }
                
-               $repospath = $viewsvn->repos->fetch_path($repos, false);
-               
-               return $this->svn('diff -r' . $lorev . ':' . $hirev . ' ' . $repospath . $path);
+               return $this->svn('diff -r' . $lorev . ':' . $hirev . ' ' . $this->controller->repospath . $this->controller->path);
        }
        
        /**
@@ -472,11 +468,9 @@ class SVNDiff
        * @param        integer Lower revision
        * @param        integer Higher revision
        */
-       function SVNDiff($repos, $path, $lorev, $hirev)
+       function SVNDiff(&$controller, $lorev, $hirev)
        {
-               global $viewsvn;
-               
-               $this->rawoutput = $viewsvn->svn->diff($repos, $path, $lorev, $hirev);
+               $this->rawoutput = $controller->library->diff($lorev, $hirev);
                $this->process();
        }