- log.php now works and displays correctly
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 22 Jan 2006 19:43:09 +0000 (19:43 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 22 Jan 2006 19:43:09 +0000 (19:43 +0000)
- SVNLib's SVNLog now works

includes/svnlib.php
log.php

index e781239676efc77ef4e9efab8758453936c1693f..63344b8f2a64f7a37be6f1ffa7c017cdc40ba917 100644 (file)
@@ -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 e69cea10bbfa83784dc4429ab980fad8740fa0b7..2c1b01ab4b16a5a46f99af2a234f842750933f2d 100644 (file)
--- 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') . '";');
 }