1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +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:
Bob Trahan 2014-04-07 11:44:14 -07:00
parent 0e5bea940c
commit f099168aa8

View file

@ -405,9 +405,7 @@ EOTEXT
} else { } else {
$revisions = $repository_api->loadWorkingCopyDifferentialRevisions( $revisions = $repository_api->loadWorkingCopyDifferentialRevisions(
$this->getConduit(), $this->getConduit(),
array( array());
'authors' => array($this->getUserPHID()),
));
} }
if (!count($revisions)) { if (!count($revisions)) {
@ -435,6 +433,22 @@ 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());
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) { if ($rev_status != ArcanistDifferentialRevisionStatus::ACCEPTED) {
$ok = phutil_console_confirm( $ok = phutil_console_confirm(
"Revision 'D{$rev_id}: {$rev_title}' has not been ". "Revision 'D{$rev_id}: {$rev_title}' has not been ".