Page MenuHomePhabricator

D17084.id41076.diff
No OneTemporary

D17084.id41076.diff

diff --git a/src/applications/differential/customfield/DifferentialTestPlanField.php b/src/applications/differential/customfield/DifferentialTestPlanField.php
--- a/src/applications/differential/customfield/DifferentialTestPlanField.php
+++ b/src/applications/differential/customfield/DifferentialTestPlanField.php
@@ -7,10 +7,6 @@
return 'differential:test-plan';
}
- public function getFieldKeyForConduit() {
- return 'testPlan';
- }
-
public function getFieldName() {
return pht('Test Plan');
}
@@ -27,83 +23,10 @@
return $revision->getTestPlan();
}
- protected function writeValueToRevision(
- DifferentialRevision $revision,
- $value) {
- $revision->setTestPlan($value);
- }
-
- protected function isCoreFieldRequired() {
- return PhabricatorEnv::getEnvConfig('differential.require-test-plan-field');
- }
-
public function canDisableField() {
return true;
}
- protected function getCoreFieldRequiredErrorString() {
- return pht(
- 'You must provide a test plan. Describe the actions you performed '.
- 'to verify the behavior of this change.');
- }
-
- public function readValueFromRequest(AphrontRequest $request) {
- $this->setValue($request->getStr($this->getFieldKey()));
- }
-
- public function renderEditControl(array $handles) {
- return id(new PhabricatorRemarkupControl())
- ->setUser($this->getViewer())
- ->setName($this->getFieldKey())
- ->setValue($this->getValue())
- ->setError($this->getFieldError())
- ->setLabel($this->getFieldName());
- }
-
- public function getApplicationTransactionTitle(
- PhabricatorApplicationTransaction $xaction) {
- $author_phid = $xaction->getAuthorPHID();
- $old = $xaction->getOldValue();
- $new = $xaction->getNewValue();
-
- return pht(
- '%s updated the test plan for this revision.',
- $xaction->renderHandleLink($author_phid));
- }
-
- public function getApplicationTransactionTitleForFeed(
- PhabricatorApplicationTransaction $xaction) {
-
- $object_phid = $xaction->getObjectPHID();
- $author_phid = $xaction->getAuthorPHID();
- $old = $xaction->getOldValue();
- $new = $xaction->getNewValue();
-
- return pht(
- '%s updated the test plan for %s.',
- $xaction->renderHandleLink($author_phid),
- $xaction->renderHandleLink($object_phid));
- }
-
- public function getApplicationTransactionHasChangeDetails(
- PhabricatorApplicationTransaction $xaction) {
- return true;
- }
-
- public function getApplicationTransactionChangeDetails(
- PhabricatorApplicationTransaction $xaction,
- PhabricatorUser $viewer) {
- return $xaction->renderTextCorpusChangeDetails(
- $viewer,
- $xaction->getOldValue(),
- $xaction->getNewValue());
- }
-
- public function shouldHideInApplicationTransactions(
- PhabricatorApplicationTransaction $xaction) {
- return ($xaction->getOldValue() === null);
- }
-
public function shouldAppearInGlobalSearch() {
return true;
}
@@ -139,39 +62,6 @@
return new PHUIRemarkupView($this->getViewer(), $this->getValue());
}
- public function getApplicationTransactionRemarkupBlocks(
- PhabricatorApplicationTransaction $xaction) {
- return array($xaction->getNewValue());
- }
-
- public function shouldAppearInCommitMessage() {
- return true;
- }
-
- public function shouldAppearInCommitMessageTemplate() {
- return true;
- }
-
- public function shouldOverwriteWhenCommitMessageIsEdited() {
- return true;
- }
-
- public function getCommitMessageLabels() {
- return array(
- 'Test Plan',
- 'Testplan',
- 'Tested',
- 'Tests',
- );
- }
-
- public function validateCommitMessageValue($value) {
- if (!strlen($value) && $this->isCoreFieldRequired()) {
- throw new DifferentialFieldValidationException(
- $this->getCoreFieldRequiredErrorString());
- }
- }
-
public function shouldAppearInTransactionMail() {
return true;
}
diff --git a/src/applications/differential/storage/DifferentialTransaction.php b/src/applications/differential/storage/DifferentialTransaction.php
--- a/src/applications/differential/storage/DifferentialTransaction.php
+++ b/src/applications/differential/storage/DifferentialTransaction.php
@@ -32,6 +32,8 @@
switch ($this->getMetadataValue('customfield:key')) {
case 'differential:title':
return new DifferentialRevisionTitleTransaction();
+ case 'differential:test-plan':
+ return new DifferentialRevisionTestPlanTransaction();
}
}

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 12:53 AM (12 h, 34 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6908990
Default Alt Text
D17084.id41076.diff (4 KB)

Event Timeline