// ###################################################################
-$node = preg_replace('#(^/|/$)#', '', ($viewsvn->paths->relpath == '' ? $viewsvn->paths->path : $viewsvn->paths->relpath));
-$latest = $controller->cachev->fetch_node($node);
+//$node = preg_replace('#(^/|/$)#', '', ($viewsvn->paths->relpath == '' ? $viewsvn->paths->path : $viewsvn->paths->relpath));
+$latest = $controller->cachev->fetch_node();
$link['log'] = $controller->href_compound('log.php');
-$show['head'] = ($latest['revision'] != $viewsvn->paths->revnum AND $viewsvn->paths->revnum != 'HEAD');
+$show['head'] = ($latest['revision'] != $controller->revnum AND $controller->revnum != 'HEAD');
if ($show['head'])
{
$link['gohead'] = $controller->href_compound('browse.php', null, Paths::fetch_rev_str(false, 'HEAD'));
$link['diffhead'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, 'HEAD', $controller->revnum));
}
-$show['prev'] = ($prev = $controller->cachev->fetch_prev_revision($viewsvn->paths->relpath, $viewsvn->paths->revnum));
+$show['prev'] = ($prev = $controller->cachev->fetch_prev_revision($controller->revnum));
if ($show['prev'])
{
$link['diffprev'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, $controller->revnum, $prev));
$revinfo['message_clean'] = SVNCommon::format_log_message($revinfo['message']);
$revinfo['date'] = SVNCommon::format_date_string($revinfo['dateline']);
-$listing = $controller->library->ls($controller->repos, $controller->path, $controller->revnum);
+$listing = $controller->library->command('ls');
$nodes = '';
*
* @access public
*
- * @param string Node path
* @param integer Revision number
*
* @return array Complete revision/commit entry
*/
- function fetch_prev_revision($node, $revision)
+ function fetch_prev_revision($revision)
{
- $data = $this->fetch_node($node);
+ $data = $this->fetch_node();
$data = $data['history'];
if (count($data['history']) < 1)
*
* @access public
*
- * @param string Node path
- *
* @return integer HEAD revision
*/
- function fetch_head_revision($node)
+ function fetch_head_revision()
{
- $data = $this->fetch_node($node);
+ $data = $this->fetch_node();
$data = $data['history'];
return max(array_keys($data));
*
* @access public
*
- * @param string Node path
- *
* @return integer Latest revision; FALSE if none (not in HEAD)
*/
- function fetch_node($node)
+ function fetch_node()
{
- $node = $this->fetch_node_string($node);
+ $node = $this->fetch_node_string($this->controller->path);
if (!isset($this->memcache['nodes']["$node"]))
{
$result = $this->controller->registry->db->query_first("SELECT * FROM {$this->hash}_nodes WHERE name = '" . $this->controller->registry->escape($node) . "'");
/**
* SVN Wrapper: standard command system
*
- * @access private
+ * @access public
*
* @param string SVN command
- * @param string Repository
- * @param string Path
- * @param integer Revision
*
* @return array Lines of output
*/
- function std($command, $repos, $path, $revision)
+ function command($command)
{
global $viewsvn;
- $revision = SVNCommon::rev($revision);
- $repospath = $viewsvn->repos->fetch_path($repos, false);
+ $revision = SVNCommon::rev($this->controller->revnum);
- return $this->svn($command . ' ' . $repospath . $path . '@' . $revision);
+ return $this->svn($command . ' ' . $this->controller->repospath . $this->controller->path . '@' . $revision);
}
/**
/**
* SVN Wrapper: ls (list)
*
- * @access protected
+ * @access public
*
- * @param string Repository
- * @param string Path
- * @param integer Revision
+ * @param object Controller object
*
* @return array Lines of list output
*/
- function ls($repos, $path, $revision)
+ function ls(&$controller)
{
- return $this->std('list', $repos, $path, $revision);
+ return $this->std('list');
}
}