Show a more tailored message when adding empty files

Summary: Fixes T6695. Tailor this message.

Test Plan: {F333305}

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T6695

Differential Revision: https://secure.phabricator.com/D12022
This commit is contained in:
epriestley
2015-03-08 17:45:57 -07:00
parent b7be4ccca1
commit 10a84d66db
5 changed files with 62 additions and 39 deletions

View File

@@ -0,0 +1,3 @@
diff --git a/empty b/empty
new file mode 100644
index 0000000..e69de29

View File

@@ -0,0 +1,5 @@
CTYPE 1 1 (unforced)
empty
empty
-
SHIELD (none) This is an empty file.

View File

@@ -0,0 +1,5 @@
CTYPE 1 1 (unforced)
empty
empty
-
SHIELD (none) This is an empty file.

View File

@@ -850,9 +850,19 @@ final class DifferentialChangesetParser {
// we'll never have it so we need to be prepared to not render a link.
$type = 'none';
}
$shield = $renderer->renderShield(
pht('The contents of this file were not changed.'),
$type);
$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(
pht('The contents of this file were not changed.'),
$type);
}
} else if ($this->isWhitespaceOnly()) {
$shield = $renderer->renderShield(
pht('This file was changed only by adding or removing whitespace.'),