diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 592f40214b..b3e2ac530e 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -134,6 +134,7 @@ phutil_register_library_map(array( 'DifferentialAction' => 'applications/differential/constants/action', 'DifferentialAddCommentView' => 'applications/differential/view/addcomment', 'DifferentialAuxiliaryField' => 'applications/differential/storage/auxiliaryfield', + 'DifferentialBlameRevisionFieldSpecification' => 'applications/differential/field/specification/blamerev', 'DifferentialCCWelcomeMail' => 'applications/differential/mail/ccwelcome', 'DifferentialChangeType' => 'applications/differential/constants/changetype', 'DifferentialChangeset' => 'applications/differential/storage/changeset', @@ -175,6 +176,7 @@ phutil_register_library_map(array( 'DifferentialNewDiffMail' => 'applications/differential/mail/newdiff', 'DifferentialPrimaryPaneView' => 'applications/differential/view/primarypane', 'DifferentialReplyHandler' => 'applications/differential/replyhandler', + 'DifferentialRevertPlanFieldSpecification' => 'applications/differential/field/specification/revertplan', 'DifferentialReviewRequestMail' => 'applications/differential/mail/reviewrequest', 'DifferentialRevision' => 'applications/differential/storage/revision', 'DifferentialRevisionCommentListView' => 'applications/differential/view/revisioncommentlist', @@ -773,6 +775,7 @@ phutil_register_library_map(array( 'DarkConsoleXHProfPlugin' => 'DarkConsolePlugin', 'DifferentialAddCommentView' => 'AphrontView', 'DifferentialAuxiliaryField' => 'DifferentialDAO', + 'DifferentialBlameRevisionFieldSpecification' => 'DifferentialFieldSpecification', 'DifferentialCCWelcomeMail' => 'DifferentialReviewRequestMail', 'DifferentialChangeset' => 'DifferentialDAO', 'DifferentialChangesetDetailView' => 'AphrontView', @@ -800,6 +803,7 @@ phutil_register_library_map(array( 'DifferentialNewDiffMail' => 'DifferentialReviewRequestMail', 'DifferentialPrimaryPaneView' => 'AphrontView', 'DifferentialReplyHandler' => 'PhabricatorMailReplyHandler', + 'DifferentialRevertPlanFieldSpecification' => 'DifferentialFieldSpecification', 'DifferentialReviewRequestMail' => 'DifferentialMail', 'DifferentialRevision' => 'DifferentialDAO', 'DifferentialRevisionCommentListView' => 'AphrontView', diff --git a/src/applications/differential/field/specification/blamerev/DifferentialBlameRevisionFieldSpecification.php b/src/applications/differential/field/specification/blamerev/DifferentialBlameRevisionFieldSpecification.php new file mode 100644 index 0000000000..54de5290f7 --- /dev/null +++ b/src/applications/differential/field/specification/blamerev/DifferentialBlameRevisionFieldSpecification.php @@ -0,0 +1,73 @@ +value; + } + + public function setValueFromStorage($value) { + $this->value = $value; + return $this; + } + + public function shouldAppearOnEdit() { + return true; + } + + public function setValueFromRequest(AphrontRequest $request) { + $this->value = $request->getStr('aux:phabricator:blame-revision'); + return $this; + } + + public function renderEditControl() { + return id(new AphrontFormTextControl()) + ->setLabel('Blame Revision') + ->setCaption('Revision which broke the stuff which this change fixes.') + ->setName('aux:phabricator:blame-revision') + ->setValue($this->value); + } + + public function validateField() { + return; + } + + public function shouldAppearOnRevisionView() { + return true; + } + + public function renderLabelForRevisionView() { + return 'Blame Revision:'; + } + + public function renderValueForRevisionView() { + if (!$this->value) { + return null; + } + return phutil_escape_html($this->value); + } + +} diff --git a/src/applications/differential/field/specification/blamerev/__init__.php b/src/applications/differential/field/specification/blamerev/__init__.php new file mode 100644 index 0000000000..f318228bcc --- /dev/null +++ b/src/applications/differential/field/specification/blamerev/__init__.php @@ -0,0 +1,16 @@ +value; + } + + public function setValueFromStorage($value) { + $this->value = $value; + return $this; + } + + public function shouldAppearOnEdit() { + return true; + } + + public function setValueFromRequest(AphrontRequest $request) { + $this->value = $request->getStr('aux:phabricator:revert-plan'); + return $this; + } + + public function renderEditControl() { + return id(new AphrontFormTextAreaControl()) + ->setLabel('Revert Plan') + ->setName('aux:phabricator:revert-plan') + ->setCaption('Special steps required to safely revert this change.') + ->setValue($this->value); + } + + public function validateField() { + return; + } + + public function shouldAppearOnRevisionView() { + return true; + } + + public function renderLabelForRevisionView() { + return 'Revert Plan:'; + } + + public function renderValueForRevisionView() { + if (!$this->value) { + return null; + } + return phutil_escape_html($this->value); + } + +} diff --git a/src/applications/differential/field/specification/revertplan/__init__.php b/src/applications/differential/field/specification/revertplan/__init__.php new file mode 100644 index 0000000000..0610b40f10 --- /dev/null +++ b/src/applications/differential/field/specification/revertplan/__init__.php @@ -0,0 +1,16 @@ +