Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistLandWorkflow.php
| Show First 20 Lines • Show All 399 Lines • ▼ Show 20 Lines | if ($revision_id) { | ||||
| 'ids' => array($revision_id), | 'ids' => array($revision_id), | ||||
| )); | )); | ||||
| if (!$revisions) { | if (!$revisions) { | ||||
| throw new ArcanistUsageException("No such revision 'D{$revision_id}'!"); | throw new ArcanistUsageException("No such revision 'D{$revision_id}'!"); | ||||
| } | } | ||||
| } 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)) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| "arc can not identify which revision exists on {$this->branchType} ". | "arc can not identify which revision exists on {$this->branchType} ". | ||||
| "'{$this->branch}'. Update the revision with recent changes ". | "'{$this->branch}'. Update the revision with recent changes ". | ||||
| "to synchronize the {$this->branchType} name and hashes, or use ". | "to synchronize the {$this->branchType} name and hashes, or use ". | ||||
| "'arc amend' to amend the commit message at HEAD, or use ". | "'arc amend' to amend the commit message at HEAD, or use ". | ||||
| Show All 11 Lines | private function findRevision() { | ||||
| $this->revision = head($revisions); | $this->revision = head($revisions); | ||||
| $rev_status = $this->revision['status']; | $rev_status = $this->revision['status']; | ||||
| $rev_id = $this->revision['id']; | $rev_id = $this->revision['id']; | ||||
| $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 ". | ||||
| "accepted. Continue anyway?"); | "accepted. Continue anyway?"); | ||||
| if (!$ok) { | if (!$ok) { | ||||
| throw new ArcanistUserAbortException(); | throw new ArcanistUserAbortException(); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 637 Lines • Show Last 20 Lines | |||||