Differential D21699 Diff 51675 src/applications/harbormaster/xaction/build/HarbormasterBuildMessageAbortTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/xaction/build/HarbormasterBuildMessageAbortTransaction.php
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | public function applyExternalEffects($object, $value) { | ||||
$build->releaseAllArtifacts($actor); | $build->releaseAllArtifacts($actor); | ||||
} | } | ||||
protected function newCanApplyMessageAssertion( | protected function newCanApplyMessageAssertion( | ||||
PhabricatorUser $viewer, | PhabricatorUser $viewer, | ||||
HarbormasterBuild $build) { | HarbormasterBuild $build) { | ||||
if ($build->isAutobuild()) { | if ($build->isAutobuild()) { | ||||
throw new HarbormasterRestartException( | throw new HarbormasterMessageException( | ||||
pht('Unable to Abort Build'), | pht('Unable to Abort Build'), | ||||
pht( | pht( | ||||
'You can not abort a build that uses an autoplan.')); | 'You can not abort a build that uses an autoplan.')); | ||||
} | } | ||||
if ($build->isComplete()) { | if ($build->isComplete()) { | ||||
throw new HarbormasterRestartException( | throw new HarbormasterMessageException( | ||||
pht('Unable to Abort Build'), | pht('Unable to Abort Build'), | ||||
pht( | pht( | ||||
'You can not abort this biuld because it is already complete.')); | 'You can not abort this biuld because it is already complete.')); | ||||
} | } | ||||
} | } | ||||
protected function newCanSendMessageAssertion( | protected function newCanSendMessageAssertion( | ||||
PhabricatorUser $viewer, | PhabricatorUser $viewer, | ||||
HarbormasterBuild $build) { | HarbormasterBuild $build) { | ||||
if ($build->isAborting()) { | if ($build->isAborting()) { | ||||
throw new HarbormasterRestartException( | throw new HarbormasterMessageException( | ||||
pht('Unable to Abort Build'), | pht('Unable to Abort Build'), | ||||
pht( | pht( | ||||
'You can not abort this build because it is already aborting.')); | 'You can not abort this build because it is already aborting.')); | ||||
} | } | ||||
} | } | ||||
} | } |