Indefero

Indefero Commit Details

Date:2008-11-23 21:09:44 (5 years 11 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:bebce1812d0e1afb079bb4ca5539bb093a95cf32
Parents: 4260a083be989aeca96451efaa858c5fce173928
Message:Fixed to handle exception nicely instead of crashing the view.

Changes:
Msrc/IDF/Views/Source.php (2 diffs)

File differences

src/IDF/Views/Source.php
118118
119119
120120
121
122
123
121124
122125
123
124
125
126
126
127127
128128
129129
130130
131
132
133
134
131
135132
136133
137134
......
155152
156153
157154
158
155
156
157
158
159
159160
160161
161162
$branches = $scm->getBranches();
$commit = $match[2];
$request_file = $match[3];
$fburl = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($request->project->shortname,
$branches[0]));
if ('commit' != $scm->testHash($commit, $request_file)) {
// Redirect to the first branch
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($request->project->shortname,
$branches[0]));
return new Pluf_HTTP_Response_Redirect($url);
return new Pluf_HTTP_Response_Redirect($fburl);
}
$request_file_info = $scm->getFileInfo($request_file, $commit);
if (!$request_file_info) {
// Redirect to the first branch
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($request->project->shortname,
$branches[0]));
return new Pluf_HTTP_Response_Redirect($url);
return new Pluf_HTTP_Response_Redirect($fburl);
}
if ($request_file_info->type != 'tree') {
$info = self::getMimeType($request_file_info->file);
$page_title = $bc.' - '.$title;
$cobject = $scm->getCommit($commit);
$tree_in = in_array($commit, $branches);
$res = new Pluf_Template_ContextVars($scm->filesAtCommit($commit, $request_file));
try {
$res = new Pluf_Template_ContextVars($scm->filesAtCommit($commit, $request_file));
} catch (Exception $e) {
return new Pluf_HTTP_Response_Redirect($fburl);
}
// try to find the previous level if it exists.
$prev = split('/', $request_file);
$l = array_pop($prev);

Archive Download the corresponding diff file