Indefero

Indefero Commit Details


Date:2009-02-02 15:55:45 (15 years 10 months ago)
Author:Loic d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:9bcf99e3a7e2f7712214c95709eece2f2fe34cb1
Parents: 47f84bcb557802cf2e389b5d7383beb4432845c5
Message:Fixed issue 126, easy link to a file in the repository from the tickets.

The syntax src:AUTHORS or src:src/IDF/Scm.php is allowed.
Changes:

File differences

src/IDF/Template/IssueComment.php
5050
5151
5252
53
54
5355
5456
5557
......
102104
103105
104106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
105125
106126
107127
if ($request->rights['hasSourceAccess']) {
$text = preg_replace_callback('#(commit\s+)([0-9a-f]{1,40})#im',
array($this, 'callbackCommit'), $text);
$text = preg_replace_callback('#(src:)([^\s\(\)]+)#im',
array($this, 'callbackSource'), $text);
}
if ($echo) {
echo $text;
return '<a href="'.Pluf_HTTP_URL_urlForView('IDF_Views_Source::commit', array($this->project->shortname, $co->commit)).'">'.$m[1].$m[2].'</a>';
}
function callbackSource($m)
{
$branches = $this->scm->getBranches();
if (count($branches) == 0) return $m[0];
$file = $m[2];
if ('commit' != $this->scm->testHash($branches[0], $file)) {
return $m[0];
}
$request_file_info = $this->scm->getFileInfo($file, $branches[0]);
if (!$request_file_info) {
return $m[0];
}
if ($request_file_info->type != 'tree') {
return $m[1].'<a href="'.Pluf_HTTP_URL_urlForView('IDF_Views_Source::tree', array($this->project->shortname, $branches[0], $file)).'">'.$m[2].'</a>';
}
return $m[0];
}
/**
* Generate the link to an issue.
*

Archive Download the corresponding diff file

Page rendered in 0.07857s using 14 queries.