Indefero

Indefero Commit Details


Date:2008-12-23 15:29:11 (15 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:0a02916e812c8c76f12f330f01db3676c40fe3c8
Parents: 4f682c2e932f7d1ba7d98931340ed8fd3c267986
Message:Added a partial fix of issue 93 to limit memory exhaustion.

This is not perfect because it means that we cannot get the
corresponding commit message and author for each file in the tree view.
This is just a work around that will not affect most of the repositories
but the biggest ones with files not changes for a long time.

To fully fix this problem, one needs to build at each commit time a
cache table with the data of each commit (including the hash of each
file at each commit).
Changes:

File differences

src/IDF/Scm/Git.php
132132
133133
134134
135
135
136136
137137
138138
......
150150
151151
152152
153
154
153
154
155155
156156
157157
......
309309
310310
311311
312
313312
313
314
314315
315
316
316
317317
318318
319319
320320
321321
322
322
323323
324
324
325
325326
326327
327
328
328329
330
329331
330332
331333
332
334
333335
334336
335337
......
337339
338340
339341
340
342
343
344
345
346
341347
342348
343349
344350
345351
346
347352
348353
349354
// get the raw log corresponding to this commit to find the
// origin of each file.
$rawlog = array();
$cmd = sprintf('GIT_DIR=%s git log --raw --abbrev=40 --pretty=oneline %s',
$cmd = sprintf('GIT_DIR=%s git log --raw --abbrev=40 --pretty=oneline -5000 %s',
escapeshellarg($this->repo), escapeshellarg($commit));
IDF_Scm::exec($cmd, $rawlog);
// We reverse the log to be able to use a fixed efficient
$file->author = $fc->author;
} else if ($file->type == 'blob') {
$file->date = $co->date;
$file->log = $co->title;
$file->author = $co->author; // May be wrong in some cases.
$file->log = '----';
$file->author = 'Unknown';
}
$file->fullpath = ($folder) ? $folder.'/'.$file->file : $file->file;
$res[] = $file;
{
$res = array();
$c = array();
$i = 0;
$hdrs += 2;
$inheads = true;
$next_is_title = false;
foreach ($lines as $line) {
$i++;
if (0 === strpos($line, 'commit')) {
if (preg_match('/^commit (\w{40})$/', $line)) {
if (count($c) > 0) {
$c['full_message'] = trim($c['full_message']);
$res[] = (object) $c;
}
$c = array();
$c['commit'] = trim(substr($line, 7));
$c['commit'] = trim(substr($line, 7, 40));
$c['full_message'] = '';
$i=1;
$inheads = true;
$next_is_title = false;
continue;
}
if ($i == $hdrs) {
if ($next_is_title) {
$c['title'] = trim($line);
$next_is_title = false;
continue;
}
$match = array();
if (preg_match('/(\S+)\s*:\s*(.*)/', $line, $match)) {
if ($inheads and preg_match('/(\S+)\s*:\s*(.*)/', $line, $match)) {
$match[1] = strtolower($match[1]);
$c[$match[1]] = trim($match[2]);
if ($match[1] == 'date') {
}
continue;
}
if ($i > ($hdrs+1)) {
if ($inheads and !$next_is_title and $line == '') {
$next_is_title = true;
$inheads = false;
}
if (!$inheads) {
$c['full_message'] .= trim($line)."\n";
continue;
}
}
$c['full_message'] = trim($c['full_message']);
$res[] = (object) $c;
return $res;
}
src/IDF/templates/idf/source/git/tree.html
3333
3434
3535
36
36
3737
3838
3939
<td class="fileicon"><img src="{media '/idf/img/'~$file.type~'.png'}" alt="{$file.type}" /></td>
<td{if $file.type != 'blob'} colspan="4"{/if}><a href="{$url}">{$file.file}</a></td>
{if $file.type == 'blob'}
{if isset($file.date)}
{if isset($file.date) and $file.log != '----'}
<td><span class="smaller">{$file.date|dateago:"wihtout"}</span></td>
<td><span class="smaller">{$file.author|strip_tags|trim}{trans ':'} {issuetext $file.log, $request, true, false}</span></td>
{else}<td colspan="2"></td>{/if}

Archive Download the corresponding diff file

Page rendered in 0.08327s using 14 queries.