mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-01-11 07:11:03 +01:00
Say until when the reviewers are away
Test Plan: `arc diff` with reviewers away. Reviewers: btrahan, epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D2496
This commit is contained in:
parent
a5c6f32a06
commit
d23d2df7e1
1 changed files with 10 additions and 8 deletions
|
@ -1539,18 +1539,20 @@ EOTEXT
|
|||
throw new ArcanistUsageException(
|
||||
"You can not be a reviewer for your own revision.");
|
||||
} else {
|
||||
$statuses = $this->getConduit()->callMethodSynchronous(
|
||||
'user.getcurrentstatus',
|
||||
$users = $this->getConduit()->callMethodSynchronous(
|
||||
'user.query',
|
||||
array(
|
||||
'userPHIDs' => $reviewers,
|
||||
'phids' => $reviewers,
|
||||
));
|
||||
foreach ($statuses as $key => $status) {
|
||||
if ($status['status'] != 'away') {
|
||||
unset($statuses[$key]);
|
||||
$untils = array();
|
||||
foreach ($users as $user) {
|
||||
if (idx($user, 'currentStatus') == 'away') {
|
||||
$untils[] = $user['currentStatusUntil'];
|
||||
}
|
||||
}
|
||||
if (count($statuses) == count($reviewers)) {
|
||||
$confirm = "All reviewers are away. Continue anyway?";
|
||||
if (count($untils) == count($reviewers)) {
|
||||
$until = date('l, M j Y', min($untils));
|
||||
$confirm = "All reviewers are away until {$until}. Continue anyway?";
|
||||
if (!phutil_console_confirm($confirm)) {
|
||||
throw new ArcanistUsageException(
|
||||
'Specify available reviewers and retry.');
|
||||
|
|
Loading…
Reference in a new issue