Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistFeatureWorkflow.php
| Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | public function runWorkflow() { | ||||
| $branches = $repository_api->getAllBranchRefs(); | $branches = $repository_api->getAllBranchRefs(); | ||||
| if (!$branches) { | if (!$branches) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| pht('No branches in this working copy.')); | pht('No branches in this working copy.')); | ||||
| } | } | ||||
| $states = array(); | $states = array(); | ||||
| foreach ($branches as $branch) { | foreach ($branches as $branch_key => $branch) { | ||||
| $states[] = $this->newWorkingCopyStateRef() | $state_ref = id(new ArcanistWorkingCopyStateRef()) | ||||
| ->attachBranchRef($branch); | ->setCommitRef($branch->getCommitRef()); | ||||
| $states[] = array( | |||||
| 'branch' => $branch, | |||||
| 'state' => $state_ref, | |||||
| ); | |||||
| } | } | ||||
| $this->newRefQuery($states) | $this->loadHardpoints( | ||||
| ->needHardpoints( | ipull($states, 'state'), | ||||
| array( | array( | ||||
| 'revisionRefs', | ArcanistWorkingCopyStateRef::HARDPOINT_REVISIONREFS, | ||||
| )) | )); | ||||
| ->execute(); | |||||
| $this->printBranches($states); | $this->printBranches($states); | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| private function checkoutBranch(array $names) { | private function checkoutBranch(array $names) { | ||||
| $api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
| ▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | static $ssort_map = array( | ||||
| 'Closed' => 1, | 'Closed' => 1, | ||||
| 'No Revision' => 2, | 'No Revision' => 2, | ||||
| 'Needs Review' => 3, | 'Needs Review' => 3, | ||||
| 'Needs Revision' => 4, | 'Needs Revision' => 4, | ||||
| 'Accepted' => 5, | 'Accepted' => 5, | ||||
| ); | ); | ||||
| $out = array(); | $out = array(); | ||||
| foreach ($states as $state) { | foreach ($states as $objects) { | ||||
| $branch = $state->getBranchRef(); | $state = $objects['state']; | ||||
| $branch = $objects['branch']; | |||||
| $revision = null; | $revision = null; | ||||
| if ($state->hasAmbiguousRevisionRefs()) { | if ($state->hasAmbiguousRevisionRefs()) { | ||||
| $status = pht('Ambiguous Revision'); | $status = pht('Ambiguous Revision'); | ||||
| } else { | } else { | ||||
| $revision = $state->getRevisionRef(); | $revision = $state->getRevisionRef(); | ||||
| if ($revision) { | if ($revision) { | ||||
| $status = $revision->getStatusDisplayName(); | $status = $revision->getStatusDisplayName(); | ||||
| ▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines | |||||