Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistDiffWorkflow.php
Show First 20 Lines • Show All 1,814 Lines • ▼ Show 20 Lines | foreach (new FutureIterator($futures) as $key => $future) { | ||||
throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
pht( | pht( | ||||
'There is no revision %s.', | 'There is no revision %s.', | ||||
"D{$revision_id}")); | "D{$revision_id}")); | ||||
} | } | ||||
$this->checkRevisionOwnership(head($result)); | $this->checkRevisionOwnership(head($result)); | ||||
break; | break; | ||||
case 'reviewers': | case 'reviewers': | ||||
$untils = array(); | $away = array(); | ||||
foreach ($result as $user) { | foreach ($result as $user) { | ||||
if (idx($user, 'currentStatus') == 'away') { | if (idx($user, 'currentStatus') != 'away') { | ||||
$untils[] = $user['currentStatusUntil']; | continue; | ||||
} | } | ||||
$username = $user['userName']; | |||||
$real_name = $user['realName']; | |||||
if (strlen($real_name)) { | |||||
$name = pht('%s (%s)', $username, $real_name); | |||||
} else { | |||||
$name = pht('%s', $username); | |||||
} | } | ||||
if (count($untils) == count($reviewers)) { | |||||
$until = date('l, M j Y', min($untils)); | $away[] = array( | ||||
$confirm = pht( | 'name' => $name, | ||||
'All reviewers are away until %s. Continue anyway?', | 'until' => $user['currentStatusUntil'], | ||||
$until); | ); | ||||
} | |||||
if ($away) { | |||||
if (count($away) == count($reviewers)) { | |||||
$earliest_return = min(ipull($away, 'until')); | |||||
$message = pht( | |||||
'All reviewers are away until %s:', | |||||
date('l, M j Y', $earliest_return)); | |||||
} else { | |||||
$message = pht('Some reviewers are currently away:'); | |||||
} | |||||
echo tsprintf( | |||||
"%s\n\n", | |||||
$message); | |||||
$list = id(new PhutilConsoleList()); | |||||
foreach ($away as $spec) { | |||||
$list->addItem( | |||||
pht( | |||||
'%s (until %s)', | |||||
$spec['name'], | |||||
date('l, M j Y', $spec['until']))); | |||||
} | |||||
echo tsprintf( | |||||
'%B', | |||||
$list->drawConsoleString()); | |||||
$confirm = pht('Continue even though reviewers are unavailable?'); | |||||
amckinley: "even though some reviewers" | |||||
if (!phutil_console_confirm($confirm)) { | if (!phutil_console_confirm($confirm)) { | ||||
throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
pht('Specify available reviewers and retry.')); | pht('Specify available reviewers and retry.')); | ||||
} | } | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,062 Lines • Show Last 20 Lines |
"even though some reviewers"