From ac0b7c1cd92dc645b80b5a45c1b81e94e26381e1 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 22 Jan 2006 20:22:10 +0000 Subject: [PATCH] diff.php now runs without throwing errors, but it's still not working per se --- diff.php | 32 ++++++++++++++++---------------- includes/svnlib.php | 18 ++++++------------ 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/diff.php b/diff.php index a9ad012..949204d 100644 --- 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') . '";'); diff --git a/includes/svnlib.php b/includes/svnlib.php index 63344b8..d2b962b 100644 --- a/includes/svnlib.php +++ b/includes/svnlib.php @@ -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(); } -- 2.22.5