Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/parser/DifferentialChangesetParser.php
Show First 20 Lines • Show All 844 Lines • ▼ Show 20 Lines | if ($this->isTopLevel && !$this->comments) { | ||||
// file content (for example, if you "chmod +x" a file and then | // file content (for example, if you "chmod +x" a file and then | ||||
// run "git show", the file content is not available). Similarly, | // run "git show", the file content is not available). Similarly, | ||||
// if you move a file from A to B without changing it, diffs normally | // if you move a file from A to B without changing it, diffs normally | ||||
// do not show the file content. In some cases `arc` is able to | // do not show the file content. In some cases `arc` is able to | ||||
// synthetically generate content for these diffs, but for raw diffs | // synthetically generate content for these diffs, but for raw diffs | ||||
// we'll never have it so we need to be prepared to not render a link. | // we'll never have it so we need to be prepared to not render a link. | ||||
$type = 'none'; | $type = 'none'; | ||||
} | } | ||||
$type_add = DifferentialChangeType::TYPE_ADD; | |||||
if ($this->changeset->getChangeType() == $type_add) { | |||||
// Although the generic message is sort of accurate in a technical | |||||
// sense, this more-tailored message is less confusing. | |||||
$shield = $renderer->renderShield( | |||||
pht('This is an empty file.'), | |||||
$type); | |||||
} else { | |||||
$shield = $renderer->renderShield( | $shield = $renderer->renderShield( | ||||
pht('The contents of this file were not changed.'), | pht('The contents of this file were not changed.'), | ||||
$type); | $type); | ||||
} | |||||
} else if ($this->isWhitespaceOnly()) { | } else if ($this->isWhitespaceOnly()) { | ||||
$shield = $renderer->renderShield( | $shield = $renderer->renderShield( | ||||
pht('This file was changed only by adding or removing whitespace.'), | pht('This file was changed only by adding or removing whitespace.'), | ||||
'whitespace'); | 'whitespace'); | ||||
} else if ($this->isDeleted()) { | } else if ($this->isDeleted()) { | ||||
$shield = $renderer->renderShield( | $shield = $renderer->renderShield( | ||||
pht('This file was completely deleted.')); | pht('This file was completely deleted.')); | ||||
} else if ($this->changeset->getAffectedLineCount() > 2500) { | } else if ($this->changeset->getAffectedLineCount() > 2500) { | ||||
▲ Show 20 Lines • Show All 502 Lines • Show Last 20 Lines |