mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 07:12:41 +01:00
Load contents of shielded files with lots of changes
Summary: We need `$this->old` and `$this->new` in `renderShield()`. Broken since D2358. Test Plan: Loaded contents of file with lots of changes. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3080
This commit is contained in:
parent
c614af53bf
commit
aefc5654c3
1 changed files with 25 additions and 30 deletions
|
@ -941,40 +941,35 @@ final class DifferentialChangesetParser {
|
|||
|
||||
$this->highlightEngine = PhabricatorSyntaxHighlighter::newEngine();
|
||||
|
||||
$this->tryCacheStuff();
|
||||
|
||||
$shield = null;
|
||||
if ($this->isTopLevel && !$this->comments &&
|
||||
!($this->isGenerated() || $this->isUnchanged() || $this->isDeleted()) &&
|
||||
$this->changeset->getAffectedLineCount() > 2500) {
|
||||
$lines = number_format($this->changeset->getAffectedLineCount());
|
||||
$shield = $this->renderShield(
|
||||
"This file has a very large number of changes ({$lines} lines).",
|
||||
true);
|
||||
} else {
|
||||
|
||||
$this->tryCacheStuff();
|
||||
|
||||
if ($this->isTopLevel && !$this->comments) {
|
||||
if ($this->isGenerated()) {
|
||||
if ($this->isTopLevel && !$this->comments) {
|
||||
if ($this->isGenerated()) {
|
||||
$shield = $this->renderShield(
|
||||
"This file contains generated code, which does not normally need ".
|
||||
"to be reviewed.",
|
||||
true);
|
||||
} else if ($this->isUnchanged()) {
|
||||
if ($this->isWhitespaceOnly()) {
|
||||
$shield = $this->renderShield(
|
||||
"This file contains generated code, which does not normally need ".
|
||||
"to be reviewed.",
|
||||
true);
|
||||
} else if ($this->isUnchanged()) {
|
||||
if ($this->isWhitespaceOnly()) {
|
||||
$shield = $this->renderShield(
|
||||
"This file was changed only by adding or removing trailing ".
|
||||
"whitespace.",
|
||||
false);
|
||||
} else {
|
||||
$shield = $this->renderShield(
|
||||
"The contents of this file were not changed.",
|
||||
false);
|
||||
}
|
||||
} else if ($this->isDeleted()) {
|
||||
"This file was changed only by adding or removing trailing ".
|
||||
"whitespace.",
|
||||
false);
|
||||
} else {
|
||||
$shield = $this->renderShield(
|
||||
"This file was completely deleted.",
|
||||
true);
|
||||
"The contents of this file were not changed.",
|
||||
false);
|
||||
}
|
||||
} else if ($this->isDeleted()) {
|
||||
$shield = $this->renderShield(
|
||||
"This file was completely deleted.",
|
||||
true);
|
||||
} else if ($this->changeset->getAffectedLineCount() > 2500) {
|
||||
$lines = number_format($this->changeset->getAffectedLineCount());
|
||||
$shield = $this->renderShield(
|
||||
"This file has a very large number of changes ({$lines} lines).",
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue