From 24305cadb9026a744a554e26b75e5a1e89c3ae32 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 30 Apr 2018 11:51:55 -0700 Subject: [PATCH] Hide the "large" diff warning on "very large" diffs Summary: Ref T13110. Ref T13130. When a revision is "large" (100 - 1000 files) we hide the actual textual changes by default. When it is "very large" (more than 1000 files) we hide all the changesets by default. For "very large" diffs, we currently still show the "large" warning, which doesn't really make sense since there aren't any actual changesets. When a diff is "very large", don't show the "large" warning. Test Plan: - Viewed a small diff (<100 files), saw no warnings. - Viewed a large diff (100-1000 files), saw just the large warning. - Viewed a very large diff (>1000 files). - Before: both "large" and "very large" help warnings. - After: just "very large" warnings. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13130, T13110 Differential Revision: https://secure.phabricator.com/D19416 --- .../controller/DifferentialRevisionViewController.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 9b015887a6..9672654c58 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -153,9 +153,17 @@ final class DifferentialRevisionViewController extends DifferentialController { $request_uri = $request->getRequestURI(); + // Revisions with more than 100 files are "large". + // Revisions with more than 1000 files are "very large". $limit = 100; $large = $request->getStr('large'); - if (count($changesets) > $limit && !$large) { + + $large_warning = + (!$this->isVeryLargeDiff()) && + (count($changesets) > $limit) && + (!$large); + + if ($large_warning) { $count = count($changesets); $warning = new PHUIInfoView(); $warning->setTitle(pht('Large Diff'));