mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +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:
parent
5e11eb7f72
commit
40d453d6aa
1 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue