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 = '';
$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
$class = 'diff_norm';
}
- $line['line_clean'] = $viewsvn->svn->format($line['line']);
+ $line['line_clean'] = SVNCommon::format($line['line']);
}
eval('$lines .= "' . $template->fetch('diff_line') . '";');
*
* @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;
}
}
- $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);
}
/**
* @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();
}