Skip to content

Commit

Permalink
fixed handling of forward revisions in which the specific path has no…
Browse files Browse the repository at this point in the history
…t been modified
  • Loading branch information
dirk-thomas committed Mar 6, 2011
1 parent b7df138 commit 42d7efc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
6 changes: 4 additions & 2 deletions filedetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@
if (!$history) {
unset($vars['error']);
$history = $svnrep->getLog($path, '', '', false, 2, ($path == '/') ? '' : $peg);
if (!$history) {
unset($vars['error']);
$vars['error'] = 'Revision '.$peg.' of this resource does not exist.';
}
}
$youngest = ($history && isset($history->entries[0])) ? $history->entries[0]->rev : false;

if (empty($rev)) {
$rev = $youngest;
} else if ($rev > $youngest) {
$vars['warning'] = 'Revision '.$rev.' of this resource does not exist.';
}

$extn = strtolower(strrchr($path, '.'));
Expand Down
20 changes: 13 additions & 7 deletions log.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ function removeAccents($string) {
if (!$history) {
unset($vars['error']);
$history = $svnrep->getLog($path, '', '', false, 1, ($path == '/') ? '' : $peg);
if (!$history) {
unset($vars['error']);
$vars['error'] = 'Revision '.$peg.' of this resource does not exist.';
}
}

$youngest = ($history && isset($history->entries[0])) ? $history->entries[0]->rev : 0;
Expand All @@ -107,8 +111,6 @@ function removeAccents($string) {

if (empty($rev)) {
$rev = $youngest;
} else if ($rev > $youngest) {
$vars['warning'] = 'Revision '.$rev.' of this resource does not exist.';
}

if (empty($startrev)) {
Expand All @@ -126,7 +128,7 @@ function removeAccents($string) {
$vars['peg'] = $peg;
$vars['path'] = escape($ppath);

if (isset($history->entries[0])) {
if ($history && isset($history->entries[0])) {
$vars['log'] = xml_entities($history->entries[0]->msg);
$vars['date'] = $history->entries[0]->date;
$vars['age'] = datetimeFormatDuration(time() - strtotime($history->entries[0]->date));
Expand Down Expand Up @@ -198,10 +200,14 @@ function removeAccents($string) {
$vars['pagelinks'] = '';
$vars['showalllink'] = '';

$history = $svnrep->getLog($path, $startrev, $endrev, true, $max, $peg);
if (empty($history)) {
$vars['warning'] = 'Revision '.$rev.' of this resource does not exist.';
} else {
if ($history) {
$history = $svnrep->getLog($path, $startrev, $endrev, true, $max, $peg);
if (empty($history)) {
unset($vars['error']);
$vars['warning'] = 'Revision '.$startrev.' of this resource does not exist.';
}
}
if (!empty($history)) {
// Get the number of separate revisions
$revisions = count($history->entries);

Expand Down

0 comments on commit 42d7efc

Please sign in to comment.