Indefero

Indefero Commit Details


Date:2009-05-25 07:18:48 (15 years 6 months ago)
Author:Loic d'Anterroches
Branch: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:d31cd2aef4e4a816d844028e09bfbc1b6e30a0db
Parents: c83e2e6f30bd64e9b17eab2531647a6246ee3ceb
Message:Added the latest fixes for the new backend.

Changes:

File differences

src/IDF/Commit.php
148148
149149
150150
151
152
153
154
155
156
157
158
159
160
161
162
163
151
164152
165153
166154
......
188176
189177
190178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
191211
192212
193213
$commit = new IDF_Commit();
$commit->project = $project;
$commit->scm_id = $change->commit;
if (Pluf_Text_UTF8::check($change->title)) {
$commit->summary = $change->title;
$commit->fullmessage = $change->full_message;
} else {
// Not in utf8, so we try to detect the encoding and
// convert accordingly.
$encoding = mb_detect_encoding($change->title, mb_detect_order(), true);
if ($encoding == false) {
$encoding = Pluf_Text_UTF8::detect_cyr_charset($change->title);
}
$commit->summary = mb_convert_encoding($change->title, 'UTF-8', $encoding);
$commit->fullmessage = mb_convert_encoding($change->full_message, 'UTF-8', $encoding);
}
list($commit->summary, $commit->fullmessage) = self::toUTF8(array($change->title, $change->full_message));
$commit->author = $scm->findAuthor($change->author);
$commit->origauthor = $change->author;
$commit->creation_dtime = $change->date;
}
/**
* Convert encoding to UTF8.
*
* If an array is given, the encoding is detected only on the
* first value and then used to convert all the strings.
*
* @param mixed String or array of string to be converted
* @return mixed String or array of string
*/
public static function toUTF8($text)
{
$ref = $text;
if (is_array($text)) {
$ref = $text[0];
}
if (Pluf_Text_UTF8::check($ref)) {
return $text;
}
$encoding = mb_detect_encoding($ref, mb_detect_order(), true);
if ($encoding == false) {
$encoding = Pluf_Text_UTF8::detect_cyr_charset($ref);
}
if (is_array($text)) {
foreach ($text as $t) {
$res[] = mb_convert_encoding($t, 'UTF-8', $encoding);
}
return $res;
} else {
return mb_convert_encoding($text, 'UTF-8', $encoding);
}
}
/**
* Returns the timeline fragment for the commit.
*
*
src/IDF/Scm/Cache/Git.php
5454
5555
5656
57
5758
5859
5960
$cache = new IDF_Scm_Cache_Git();
$cache->project = $this->_project;
$cache->githash = $blob->hash;
$blob->title = IDF_Commit::toUTF8($blob->title);
$cache->content = $blob->date.chr(31).$blob->author.chr(31).$blob->title;
$sql = new Pluf_SQL('project=%s AND githash=%s',
array($this->_project->id, $blob->hash));
src/IDF/Scm/Mercurial.php
207207
208208
209209
210
211
212
213
214
215
216
217
218
219
220
221210
222211
223212
......
229218
230219
231220
232
233
234
235
236
237
238
239
221
240222
241
242
243
244
223
224
225
226
227
245228
246229
247230
} else {
$type = 'blob';
}
if (!$root and !$folder and preg_match('/^.*\/.*$/', $file)) {
continue;
}
if ($folder) {
preg_match('|^'.$folder.'[/]?([^/]+)?$|', $file,$match);
if (count($match) > 1) {
$file = $match[1];
} else {
continue;
}
}
if ($totest == $file) {
return (object) array('perm' => $perm, 'type' => $type,
'hash' => $hash,
return false;
}
/**
* Get a blob.
*
* @param string request_file_info
* @param null to be svn client compatible
* @return string Raw blob
*/
public function getBlob($request_file_info, $dummy=null)
public function getFile($def, $cmd_only=false)
{
return shell_exec(sprintf(Pluf::f('hg_path', 'hg').' cat -R %s -r %s %s',
escapeshellarg($this->repo),
$dummy,
escapeshellarg($this->repo . '/' . $request_file_info->file)));
$cmd = sprintf(Pluf::f('hg_path', 'hg').' cat -R %s -r %s %s',
escapeshellarg($this->repo),
escapeshellarg($def->commit),
escapeshellarg($this->repo.'/'.$def->file));
return ($cmd_only) ? $cmd : shell_exec($cmd);
}
/**
src/IDF/Views/Source.php
204204
205205
206206
207
208
209
210
211
212
213
214
215
216
217
207
208
209
210
211
212
218213
219214
220215
......
326321
327322
328323
329
324
330325
331326
332327
......
345340
346341
347342
348
343
349344
350345
351346
......
437432
438433
439434
440
435
441436
442437
443438
$page_title = $bc.' - '.$title;
$cobject = $scm->getCommit($commit);
$in_branches = $scm->inBranches($commit, $request_file);
try {
$cache = Pluf_Cache::factory();
$key = sprintf('Project:%s::IDF_Views_Source::tree:%s::%s',
$request->project->id, $commit, $request_file);
if (null === ($res=$cache->get($key))) {
$res = new Pluf_Template_ContextVars($scm->getTree($commit, $request_file));
$cache->set($key, $res);
}
} catch (Exception $e) {
throw $e;
$cache = Pluf_Cache::factory();
$key = sprintf('Project:%s::IDF_Views_Source::tree:%s::%s',
$request->project->id, $commit, $request_file);
if (null === ($res=$cache->get($key))) {
$res = new Pluf_Template_ContextVars($scm->getTree($commit, $request_file));
$cache->set($key, $res);
}
// try to find the previous level if it exists.
$prev = split('/', $request_file);
$bc = self::makeBreadCrumb($request->project, $commit, $request_file_info->file);
$page_title = $bc.' - '.$title;
$cobject = $scm->getCommit($commit);
$tree_in = in_array($commit, $branches);
$in_branches = $scm->inBranches($commit, $request_file);
// try to find the previous level if it exists.
$prev = split('/', $request_file);
$l = array_pop($prev);
'fullpath' => $request_file,
'base' => $request_file_info->file,
'prev' => $previous,
'tree_in' => $tree_in,
'tree_in' => $in_branches,
'branches' => $branches,
'props' => $props,
),
* @param string File content
* @return array Mime type found or 'application/octet-stream', basename, extension
*/
public static function getMimeTypeFromContent($file, &$filedata)
public static function getMimeTypeFromContent($file, $filedata)
{
$info = pathinfo($file);
$res = array('application/octet-stream',
src/IDF/templates/idf/source/git/file.html
2323
2424
2525
26
26
2727
28
28
2929
3030
3131
{/block}
{block context}
<p><strong>{trans 'Branches:'}</strong><br />
{foreach $branches as $branch}
{foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
<span class="label{if $commit == $branch} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
{/foreach}
</p>
{/block}
src/IDF/templates/idf/source/mercurial/file.html
2424
2525
2626
27
27
2828
29
29
3030
3131
3232
{block context}
<p><strong>{trans 'Branches:'}</strong><br />
{foreach $branches as $branch}
{foreach $branches as $branch => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
<span class="label{if $commit == $branch} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
{/foreach}
</p>
{/block}

Archive Download the corresponding diff file

Page rendered in 0.10556s using 13 queries.