1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 09:20:58 +01:00

Limit number of affected files in Differential e-mails

Summary: This triggers mainly for SVN branch copy.

Test Plan: Ran this code separately.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5126
This commit is contained in:
vrana 2013-02-26 13:40:52 -08:00
parent 5e11eb7f72
commit 40d453d6aa

View file

@ -2,6 +2,8 @@
abstract class DifferentialReviewRequestMail extends DifferentialMail { abstract class DifferentialReviewRequestMail extends DifferentialMail {
const MAX_AFFECTED_FILES = 1000;
protected $comments; protected $comments;
private $patch; private $patch;
@ -58,7 +60,12 @@ abstract class DifferentialReviewRequestMail extends DifferentialMail {
$changesets = $this->getChangesets(); $changesets = $this->getChangesets();
if ($changesets) { if ($changesets) {
$body[] = 'AFFECTED FILES'; $body[] = 'AFFECTED FILES';
foreach ($changesets as $changeset) { $max = self::MAX_AFFECTED_FILES;
foreach (array_values($changesets) as $i => $changeset) {
if ($i == $max) {
$body[] = ' ('.(count($changesets) - $max).' more files)';
break;
}
$body[] = ' '.$changeset->getFilename(); $body[] = ' '.$changeset->getFilename();
} }
$body[] = null; $body[] = null;