mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-01-16 17:51:10 +01:00
(stable) Promote 2017 Week 48
This commit is contained in:
commit
a3519b8fde
1 changed files with 36 additions and 5 deletions
|
@ -694,6 +694,8 @@ EOTEXT
|
||||||
$rev_title = $this->revision['title'];
|
$rev_title = $this->revision['title'];
|
||||||
$rev_auxiliary = idx($this->revision, 'auxiliary', array());
|
$rev_auxiliary = idx($this->revision, 'auxiliary', array());
|
||||||
|
|
||||||
|
$full_name = pht('D%d: %s', $rev_id, $rev_title);
|
||||||
|
|
||||||
if ($this->revision['authorPHID'] != $this->getUserPHID()) {
|
if ($this->revision['authorPHID'] != $this->getUserPHID()) {
|
||||||
$other_author = $this->getConduit()->callMethodSynchronous(
|
$other_author = $this->getConduit()->callMethodSynchronous(
|
||||||
'user.query',
|
'user.query',
|
||||||
|
@ -706,17 +708,46 @@ EOTEXT
|
||||||
"This %s has revision '%s' but you are not the author. Land this ".
|
"This %s has revision '%s' but you are not the author. Land this ".
|
||||||
"revision by %s?",
|
"revision by %s?",
|
||||||
$this->branchType,
|
$this->branchType,
|
||||||
"D{$rev_id}: {$rev_title}",
|
$full_name,
|
||||||
$other_author));
|
$other_author));
|
||||||
if (!$ok) {
|
if (!$ok) {
|
||||||
throw new ArcanistUserAbortException();
|
throw new ArcanistUserAbortException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($rev_status != ArcanistDifferentialRevisionStatus::ACCEPTED) {
|
$state_warning = null;
|
||||||
$ok = phutil_console_confirm(pht(
|
$state_header = null;
|
||||||
"Revision '%s' has not been accepted. Continue anyway?",
|
if ($rev_status == ArcanistDifferentialRevisionStatus::CHANGES_PLANNED) {
|
||||||
"D{$rev_id}: {$rev_title}"));
|
$state_header = pht('REVISION HAS CHANGES PLANNED');
|
||||||
|
$state_warning = pht(
|
||||||
|
'The revision you are landing ("%s") is currently in the "%s" state, '.
|
||||||
|
'indicating that you expect to revise it before moving forward.'.
|
||||||
|
"\n\n".
|
||||||
|
'Normally, you should resubmit it for review and wait until it is '.
|
||||||
|
'"%s" by reviewers before you continue.'.
|
||||||
|
"\n\n".
|
||||||
|
'To resubmit the revision for review, either: update the revision '.
|
||||||
|
'with revised changes; or use "Request Review" from the web interface.',
|
||||||
|
$full_name,
|
||||||
|
pht('Changes Planned'),
|
||||||
|
pht('Accepted'));
|
||||||
|
} else if ($rev_status != ArcanistDifferentialRevisionStatus::ACCEPTED) {
|
||||||
|
$state_header = pht('REVISION HAS NOT BEEN ACCEPTED');
|
||||||
|
$state_warning = pht(
|
||||||
|
'The revision you are landing ("%s") has not been "%s" by reviewers.',
|
||||||
|
$full_name,
|
||||||
|
pht('Accepted'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($state_warning !== null) {
|
||||||
|
$prompt = pht('Land revision in the wrong state?');
|
||||||
|
|
||||||
|
id(new PhutilConsoleBlock())
|
||||||
|
->addParagraph(tsprintf('<bg:yellow>** %s **</bg>', $state_header))
|
||||||
|
->addParagraph(tsprintf('%B', $state_warning))
|
||||||
|
->draw();
|
||||||
|
|
||||||
|
$ok = phutil_console_confirm($prompt);
|
||||||
if (!$ok) {
|
if (!$ok) {
|
||||||
throw new ArcanistUserAbortException();
|
throw new ArcanistUserAbortException();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue