mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-12-26 15:30:57 +01:00
Make "arc land" support landing someone else's code that got there via arc patch
Summary: Ref T4670. Test Plan: arc patch D8685; arc land --hold; verified i got a nice message asking me to be sure i wanted to land epriestley's code Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T4670 Differential Revision: https://secure.phabricator.com/D8709
This commit is contained in:
parent
0e5bea940c
commit
f099168aa8
1 changed files with 17 additions and 3 deletions
|
@ -405,9 +405,7 @@ EOTEXT
|
|||
} else {
|
||||
$revisions = $repository_api->loadWorkingCopyDifferentialRevisions(
|
||||
$this->getConduit(),
|
||||
array(
|
||||
'authors' => array($this->getUserPHID()),
|
||||
));
|
||||
array());
|
||||
}
|
||||
|
||||
if (!count($revisions)) {
|
||||
|
@ -435,6 +433,22 @@ EOTEXT
|
|||
$rev_title = $this->revision['title'];
|
||||
$rev_auxiliary = idx($this->revision, 'auxiliary', array());
|
||||
|
||||
if ($this->revision['authorPHID'] != $this->getUserPHID()) {
|
||||
$other_author = $this->getConduit()->callMethodSynchronous(
|
||||
'user.query',
|
||||
array(
|
||||
'phids' => array($this->revision['authorPHID']),
|
||||
));
|
||||
$other_author = ipull($other_author, 'userName', 'phid');
|
||||
$other_author = $other_author[$this->revision['authorPHID']];
|
||||
$ok = phutil_console_confirm(
|
||||
"This {$this->branchType} has revision 'D{$rev_id}: {$rev_title}' ".
|
||||
"but you are not the author. Land this revision by {$other_author}?");
|
||||
if (!$ok) {
|
||||
throw new ArcanistUserAbortException();
|
||||
}
|
||||
}
|
||||
|
||||
if ($rev_status != ArcanistDifferentialRevisionStatus::ACCEPTED) {
|
||||
$ok = phutil_console_confirm(
|
||||
"Revision 'D{$rev_id}: {$rev_title}' has not been ".
|
||||
|
|
Loading…
Reference in a new issue