Skip to content

Commit

Permalink
differentiate three modes of svn log: normal, quiet, verbose (modifie…
Browse files Browse the repository at this point in the history
…d patch by Paul Chan)
  • Loading branch information
dirk-thomas committed Aug 1, 2011
1 parent 313c6ed commit b059302
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion blame.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

$revurl = $config->getURL($rep, $path, 'blame');
if ($rev < $youngest) {
$history2 = $svnrep->getLog($path, $rev, $youngest, false, 2, $peg);
$history2 = $svnrep->getLog($path, $rev, $youngest, true, 2, $peg);
if (isset($history2->entries[1])) {
$nextRev = $history2->entries[1]->rev;
if ($nextRev != $youngest) {
Expand Down
6 changes: 3 additions & 3 deletions diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
$svnrep = new SVNRepository($rep);

// If there's no revision info, go to the lastest revision for this path
$history = $svnrep->getLog($path, 'HEAD', 1, false, 2, ($path == '/') ? '' : $peg);
$history = $svnrep->getLog($path, 'HEAD', 1, true, 2, ($path == '/') ? '' : $peg);
if (!$history) {
unset($vars['error']);
$history = $svnrep->getLog($path, '', '', false, 2, ($path == '/') ? '' : $peg);
$history = $svnrep->getLog($path, '', '', true, 2, ($path == '/') ? '' : $peg);
}
$youngest = ($history && isset($history->entries[0])) ? $history->entries[0]->rev : false;

Expand Down Expand Up @@ -92,7 +92,7 @@

$revurl = $config->getURL($rep, $path, 'diff');
if ($rev < $youngest) {
$history2 = $svnrep->getLog($path, $rev, $youngest, false, 2, $peg ? $peg : 'HEAD');
$history2 = $svnrep->getLog($path, $rev, $youngest, true, 2, $peg ? $peg : 'HEAD');
if (isset($history2->entries[1])) {
$nextRev = $history2->entries[1]->rev;
if ($nextRev != $youngest) {
Expand Down
4 changes: 2 additions & 2 deletions filedetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@

$revurl = $config->getURL($rep, $path, 'file');
if ($rev < $youngest) {
$history2 = $svnrep->getLog($path, $rev, $youngest, false, 2, $peg ? $peg : 'HEAD');
$history2 = $svnrep->getLog($path, $rev, $youngest, true, 2, $peg ? $peg : 'HEAD');
if (isset($history2->entries[1])) {
$nextRev = $history2->entries[1]->rev;
if ($nextRev != $youngest) {
Expand All @@ -148,7 +148,7 @@
unset($vars['error']);
}

$history3 = $svnrep->getLog($path, $rev, 1, false, 2, $peg ? $peg : 'HEAD');
$history3 = $svnrep->getLog($path, $rev, 1, true, 2, $peg ? $peg : 'HEAD');
if (isset($history3->entries[1])) {
$prevRev = $history3->entries[1]->rev;
$prevPath = $history3->entries[1]->path;
Expand Down
4 changes: 2 additions & 2 deletions include/svnlook.php
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ function getList($path, $rev = 0, $peg = '') {

// {{{ getLog

function getLog($path, $brev = '', $erev = 1, $quiet = false, $limit = 2, $peg = '') {
function getLog($path, $brev = '', $erev = 1, $quiet = false, $limit = 2, $peg = '', $verbose = false) {
global $config, $curLog;

$xml_parser = xml_parser_create('UTF-8');
Expand All @@ -1158,7 +1158,7 @@ function getLog($path, $brev = '', $erev = 1, $quiet = false, $limit = 2, $peg =
// Get the log info
$effectiveRev = ($brev && $erev ? $brev.':'.$erev : ($brev ? $brev.':1' : ''));
$effectivePeg = ($peg ? $peg : ($brev ? $brev : ''));
$cmd = quoteCommand($this->svnCommandString('log --xml '.($quiet ? '--quiet' : '--verbose'), $path, $effectiveRev, $effectivePeg));
$cmd = quoteCommand($this->svnCommandString('log --xml '.($verbose ? '--verbose' : ($quiet ? '--quiet' : '')), $path, $effectiveRev, $effectivePeg));

if (($config->subversionMajorVersion > 1 || $config->subversionMinorVersion >= 2) && $limit != 0) {
$cmd .= ' --limit '.$limit;
Expand Down
2 changes: 1 addition & 1 deletion listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ function showTreeDir($svnrep, $path, $rev, $peg, $listing) {
}
$vars['goyoungestlink'] = '<a href="'.$vars['goyoungesturl'].'"'.($youngest ? ' title="'.$lang['REV'].' '.$youngest.'"' : '').'>'.$lang['GOYOUNGEST'].'</a>';

$history2 = $svnrep->getLog($path, $rev, $youngest, false, 2, $peg);
$history2 = $svnrep->getLog($path, $rev, $youngest, true, 2, $peg);
if (isset($history2->entries[1])) {
$nextRev = $history2->entries[1]->rev;
if ($nextRev != $youngest) {
Expand Down
2 changes: 1 addition & 1 deletion log.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ function removeAccents($string) {

$entries = array();
if ($brev && $erev) {
$history = $svnrep->getLog($path, $brev, $erev, false, 0, $peg);
$history = $svnrep->getLog($path, $brev, $erev, false, 0, $peg, $showchanges);
if ($history)
$entries = $history->entries;
}
Expand Down
16 changes: 7 additions & 9 deletions revision.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
$passRevString = createRevAndPegString($rev, $peg);

// Find the youngest revision containing changes for the given path
$history = $svnrep->getLog($path, 'HEAD', 1, false, 2, ($path == '/') ? '' : $peg);
$history = $svnrep->getLog($path, 'HEAD', 1, true, 2, ($path == '/') ? '' : $peg);
if (!$history) {
unset($vars['error']);
$history = $svnrep->getLog($path, '', '', false, 2, ($path == '/') ? '' : $peg);
$history = $svnrep->getLog($path, '', '', true, 2, ($path == '/') ? '' : $peg);
if (!$history) {
header('HTTP/1.x 404 Not Found', true, 404);
$vars['error'] = $lang['NOPATH'];
Expand All @@ -54,12 +54,10 @@

// Unless otherwise specified, we get the log details of the latest change
$lastChangedRev = ($rev) ? $rev : $youngest;
if ($lastChangedRev != $youngest) {
$history = $svnrep->getLog($path, $lastChangedRev, 1, false, 2, $peg);
if (!$history) {
header('HTTP/1.x 404 Not Found', true, 404);
$vars['error'] = $lang['NOPATH'];
}
$history = $svnrep->getLog($path, $lastChangedRev, 1, false, 2, $peg, true);
if (!$history) {
header('HTTP/1.x 404 Not Found', true, 404);
$vars['error'] = $lang['NOPATH'];
}
if (empty($rev))
$rev = $lastChangedRev;
Expand All @@ -70,7 +68,7 @@
$vars['goyoungesturl'] = $config->getURL($rep, $path, 'revision');
$vars['goyoungestlink'] = '<a href="'.$vars['goyoungesturl'].'"'.($youngest ? ' title="'.$lang['REV'].' '.$youngest.'"' : '').'>'.$lang['GOYOUNGEST'].'</a>';

$history2 = $svnrep->getLog($path, $rev, $youngest, false, 2, $peg);
$history2 = $svnrep->getLog($path, $rev, $youngest, true, 2, $peg);
if (isset($history2->entries[1])) {
$nextRev = $history2->entries[1]->rev;
if ($nextRev != $youngest) {
Expand Down
10 changes: 7 additions & 3 deletions rss.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
// WebSVN - Subversion repository viewing via the web using PHP
// Copyright (C) 2004-2006 Tim Armes
//
Expand Down Expand Up @@ -65,7 +65,7 @@

// If there's no revision info, go to the lastest revision for this path
$svnrep = new SVNRepository($rep);
$history = $svnrep->getLog($path, $rev, '', false, $max, $peg);
$history = $svnrep->getLog($path, $rev, '', false, $max, $peg, !$quiet);
if (!$history) {
header('HTTP/1.x 404 Not Found', true, 404);
echo $lang['NOPATH'];
Expand Down Expand Up @@ -110,7 +110,11 @@
$title = implode(' ', array_slice($words, 0, $wordLimit)).' ...';
}
$title = $lang['REV'].' '.$r->rev.' -- '.$title;
$description = '<div><strong>'.$r->author.' -- '.count($r->mods).' '.$lang['FILESMODIFIED'].'</strong><br/>'.nl2br($bugtraq->replaceIDs(create_anchors(str_replace('<', '&lt;', $r->msg)))).'</div>';
$description = '<div><strong>'.$r->author;
if (!$quiet) {
$description .= ' -- '.count($r->mods).' '.$lang['FILESMODIFIED'];
}
$description .= '</strong><br/>'.nl2br($bugtraq->replaceIDs(create_anchors(str_replace('<', '&lt;', $r->msg)))).'</div>';
if (!$quiet) {
usort($r->mods, 'SVNLogEntry_compare');
foreach ($r->mods as $modifiedResource) {
Expand Down

0 comments on commit b059302

Please sign in to comment.