From 9d1fc02e4d7bef1e0e5faa78bd3a6df925b98b44 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 22 Jan 2006 19:43:09 +0000 Subject: [PATCH] - log.php now works and displays correctly - SVNLib's SVNLog now works --- includes/svnlib.php | 13 ++++++------- log.php | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/includes/svnlib.php b/includes/svnlib.php index e781239..63344b8 100644 --- a/includes/svnlib.php +++ b/includes/svnlib.php @@ -103,16 +103,17 @@ class SVNLib * @access public * * @param string SVN command + * @param bool Alternate revision * * @return array Lines of output */ - function command($command) + function command($command, $rev = false) { global $viewsvn; - $revision = SVNCommon::rev($this->controller->revnum); + $revision = ($rev !== false ? $rev : SVNCommon::rev($this->controller->revnum)); - return $this->svn($command . ' ' . $this->controller->repospath . $this->controller->path . '@' . $revision); + return $this->svn($command . ' ' . $this->controller->repospath . $this->controller->path . ($revision !== null ? '@' . $revision : '')); } /** @@ -351,11 +352,9 @@ class SVNLog * @param integer Lower revision * @param integer Higher revision */ - function SVNLog($repos, $path, $lorev, $hirev) + function SVNLog(&$controller) { - global $viewsvn; - - $this->rawoutput = $viewsvn->svn->log($repos, $path, $lorev, $hirev); + $this->rawoutput = $controller->library->command('log', null); $this->process(); } diff --git a/log.php b/log.php index e69cea1..2c1b01a 100644 --- a/log.php +++ b/log.php @@ -26,37 +26,37 @@ $fetchtemplates = array( require_once('./global.php'); -$navbar = $viewsvn->paths->construct_breadcrumb($viewsvn->paths->path, false); +$navbar = $controller->construct_breadcrumb(); // ################################################################### // this is NOT supposed to allow for revision ranges -$logs = new SVNLog($viewsvn->paths->repos, $viewsvn->paths->relpath, 0, $viewsvn->svn->common->fetch_head_rev($viewsvn->paths->path)); +$logs = new SVNLog($controller); -$isdir = $viewsvn->svn->common->isdir($viewsvn->paths->path); +$isdir = $controller->cachev->isdir(); $nodes = ''; foreach ($logs->fetch() AS $log) { - $prev = $viewsvn->svn->common->fetch_prev_rev($viewsvn->paths->path, $log['rev']); + $prev = $controller->cachev->fetch_prev_revision($log['rev']); - $link['view'] = $viewsvn->paths->out(($isdir ? 'browse.php' : 'view.php') . $viewsvn->paths->fetch_rev_str(false, $log['rev']), $viewsvn->paths->path); - $link['blame'] = $viewsvn->paths->out('blame.php' . $viewsvn->paths->fetch_rev_str(false, $log['rev']), $viewsvn->paths->path); + $link['view'] = $controller->href_compound(($isdir ? 'browse.php' : 'view.php'), null, Paths::fetch_rev_str(false, $log['rev'])); + $link['blame'] = $controller->href_compound('blame.php', null, Paths::fetch_rev_str(false, $log['rev'])); - $show['diffhead'] = $viewsvn->svn->common->fetch_head_rev($viewsvn->paths->path) != $log['rev']; + $show['diffhead'] = $controller->cachev->fetch_head_revision() != $log['rev']; if ($show['diffhead']) { - $link['diffhead'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, 'HEAD', $log['rev']), $viewsvn->paths->path); + $link['diffhead'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, 'HEAD', $log['rev'])); } $show['diffprev'] = $prev != -1; if ($show['diffprev']) { - $link['diffprev'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, $log['rev'], $prev), $viewsvn->paths->path); + $link['diffprev'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, $log['rev'], $prev)); } - $log['message_clean'] = $viewsvn->svn->format_log_message($log['message']); + $log['message_clean'] = SVNCommon::format_log_message($log['message']); eval('$nodes .= "' . $template->fetch('log_node') . '";'); } -- 2.22.5