Fixed issue 93 by preventing the display of a large commit diff.

Still needs to implement the equivalent for subversion and mercurial,
maybe with a simple command $scm->isCommitLarge($commit).
This commit is contained in:
Loic d'Anterroches
2009-01-17 18:46:26 +01:00
parent 61bc7a70b6
commit 835eab9c24
5 changed files with 66 additions and 2 deletions

View File

@@ -216,7 +216,9 @@ class IDF_Views_Source
}
$title = sprintf(__('%s Commit Details'), (string) $request->project);
$page_title = sprintf(__('%s Commit Details - %s'), (string) $request->project, $commit);
$cobject = $scm->getCommit($commit, true);
$size = $scm->getCommitSize($commit);
$large = ($size[2] > 100 or ($size[0] + $size[1]) > 20000);
$cobject = $scm->getCommit($commit, !$large);
$rcommit = IDF_Commit::getOrAdd($cobject, $request->project);
$diff = new IDF_Diff($cobject->changes);
$diff->parse();
@@ -231,6 +233,7 @@ class IDF_Views_Source
'branches' => $branches,
'scm' => $scmConf,
'rcommit' => $rcommit,
'large_commit' => $large,
),
$request);
}