From 40d453d6aa235bf7406f5687c2f2279d0342781e Mon Sep 17 00:00:00 2001 From: vrana Date: Tue, 26 Feb 2013 13:40:52 -0800 Subject: [PATCH] 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 --- .../differential/mail/DifferentialReviewRequestMail.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/applications/differential/mail/DifferentialReviewRequestMail.php b/src/applications/differential/mail/DifferentialReviewRequestMail.php index 8b50ab2184..51898f9718 100644 --- a/src/applications/differential/mail/DifferentialReviewRequestMail.php +++ b/src/applications/differential/mail/DifferentialReviewRequestMail.php @@ -2,6 +2,8 @@ abstract class DifferentialReviewRequestMail extends DifferentialMail { + const MAX_AFFECTED_FILES = 1000; + protected $comments; private $patch; @@ -58,7 +60,12 @@ abstract class DifferentialReviewRequestMail extends DifferentialMail { $changesets = $this->getChangesets(); if ($changesets) { $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[] = null;