Differential D20252 Diff 48373 src/applications/harbormaster/controller/HarbormasterBuildActionController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/controller/HarbormasterBuildActionController.php
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | switch ($action) { | ||||
case HarbormasterBuildCommand::COMMAND_RESTART: | case HarbormasterBuildCommand::COMMAND_RESTART: | ||||
if ($can_issue) { | if ($can_issue) { | ||||
$title = pht('Really restart build?'); | $title = pht('Really restart build?'); | ||||
$body = pht( | $body = pht( | ||||
'Progress on this build will be discarded and the build will '. | 'Progress on this build will be discarded and the build will '. | ||||
'restart. Side effects of the build will occur again. Really '. | 'restart. Side effects of the build will occur again. Really '. | ||||
'restart build?'); | 'restart build?'); | ||||
$submit = pht('Restart Build'); | $submit = pht('Restart Build'); | ||||
} else if (!$build->getBuildPlan()->canRestartBuildPlan()) { | |||||
$title = pht('Not Restartable'); | |||||
$body = pht( | |||||
'The build plan for this build is not restartable, so you '. | |||||
'can not restart the build.'); | |||||
} else { | |||||
$title = pht('Unable to Restart Build'); | |||||
if ($build->isRestarting()) { | |||||
$body = pht( | |||||
'This build is already restarting. You can not reissue a '. | |||||
'restart command to a restarting build.'); | |||||
} else { | } else { | ||||
$body = pht('You can not restart this build.'); | try { | ||||
$build->assertCanRestartBuild(); | |||||
throw new Exception(pht('Expected to be unable to restart build.')); | |||||
} catch (HarbormasterRestartException $ex) { | |||||
$title = $ex->getTitle(); | |||||
$body = $ex->getBody(); | |||||
} | } | ||||
} | } | ||||
break; | break; | ||||
case HarbormasterBuildCommand::COMMAND_ABORT: | case HarbormasterBuildCommand::COMMAND_ABORT: | ||||
if ($can_issue) { | if ($can_issue) { | ||||
$title = pht('Really abort build?'); | $title = pht('Really abort build?'); | ||||
$body = pht( | $body = pht( | ||||
'Progress on this build will be discarded. Really '. | 'Progress on this build will be discarded. Really '. | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |