getLog($path, '', '', true);
if (is_string($history)) {
echo $history;
exit;
}
$youngest = $history->entries[0]->rev;
if (empty($rev)) {
$rev = $youngest;
}
if ($path{0} != '/') {
$ppath = '/'.$path;
} else {
$ppath = $path;
}
// Find the parent path (or the whole path if it's already a directory)
$pos = strrpos($ppath, '/');
$parent = substr($ppath, 0, $pos + 1);
$vars['repname'] = htmlentities($rep->getDisplayName(), ENT_QUOTES, 'UTF-8');
$vars['rev'] = $rev;
$vars['path'] = htmlentities($ppath, ENT_QUOTES, 'UTF-8');
createDirLinks($rep, $ppath, $rev);
if ($rev != $youngest) {
$url = $config->getURL($rep, $path, 'blame');
$vars["goyoungestlink"] = ''.$lang["GOYOUNGEST"].'';
} else {
$vars["goyoungestlink"] = "";
}
$vars['indexurl'] = $config->getURL($rep, '', 'index');
$vars['repurl'] = $config->getURL($rep, '', 'dir');
$url = $config->getURL($rep, $path, "file");
$vars["filedetaillink"] = "${lang["FILEDETAIL"]}";
$url = $config->getURL($rep, $path, "log");
$vars["fileviewloglink"] = "${lang["VIEWLOG"]}";
$url = $config->getURL($rep, $path, "diff");
$vars["prevdifflink"] = "${lang["DIFFPREV"]}";
$listing = array();
// Get the contents of the file
$tfname = tempnam('temp', '');
$highlighted = $svnrep->getFileContents($path, $tfname, $rev, '', true);
if ($file = fopen($tfname, 'r')) {
// Get the blame info
$tbname = tempnam('temp', '');
$svnrep->getBlameDetails($path, $tbname, $rev);
if ($blame = fopen($tbname, 'r')) {
// Create an array of version/author/line
$index = 0;
$seen_rev = array();
$last_rev = "";
$row_class = '';
while (!feof($blame) && !feof($file)) {
$blameline = fgets($blame);
if ($blameline != '') {
list($revision, $author, $remainder) = sscanf($blameline, '%d %s %s');
$empty = !$remainder;
$listing[$index]['lineno'] = $index + 1;
if ($last_rev != $revision) {
$url = $config->getURL($rep, $parent, 'revision');
$listing[$index]['revision'] = "$revision";
$seen_rev[$revision] = 1;
$row_class = ($row_class == 'light') ? 'dark' : 'light';
$listing[$index]['author'] = $author;
} else {
$listing[$index]['revision'] = "";
$listing[$index]['author'] = '';
}
$listing[$index]['row_class'] = $row_class;
$last_rev = $revision;
$line = rtrim(fgets($file));
if (!$highlighted) $line = replaceEntities($line, $rep);
if ($empty) $line = ' ';
$listing[$index]['line'] = hardspace($line);
$index++;
}
}
fclose($blame);
}
fclose($file);
@unlink($tbname);
}
@unlink($tfname);
$vars['version'] = $version;
if (!$rep->hasReadAccess($path, false)) {
$vars['noaccess'] = true;
}
$vars['javascript'] = <<
/* $val) {
$history = $svnrep->getLog($path, $key, $key, false, 1);
if (!is_string($history)) {
$vars['javascript'] .= "rev[$key] = '";
$vars['javascript'] .= "
";
$vars['javascript'] .= "
".$history->curEntry->date."<\/span>";
$vars['javascript'] .= "<\/div>";
$vars['javascript'] .= "".addslashes(preg_replace('/\n/', "
", $history->curEntry->msg))."<\/div>";
$vars['javascript'] .= "';\n";
}
}
$vars['javascript'] .= "/* ]]> */\n";
// ob_start('ob_gzhandler');
parseTemplate($rep->getTemplatePath().'header.tmpl', $vars, $listing);
parseTemplate($rep->getTemplatePath().'blame.tmpl', $vars, $listing);
parseTemplate($rep->getTemplatePath().'footer.tmpl', $vars, $listing);
WebSVN
- websvn
- Blame
- Rev 5
- /blame.php
websvn |
Subversion Repositories: |
[
/] [
blame.php] - Blame information for rev
5
Powered by WebSVN 2.2.1