Changeset View
Changeset View
Standalone View
Standalone View
src/land/engine/ArcanistLandEngine.php
| Show First 20 Lines • Show All 629 Lines • ▼ Show 20 Lines | foreach ($problem_builds as $build_ref) { | ||||
| $object_phid = $buildable_ref->getObjectPHID(); | $object_phid = $buildable_ref->getObjectPHID(); | ||||
| $revision_ref = $revision_map[$object_phid]; | $revision_ref = $revision_map[$object_phid]; | ||||
| $revision_phid = $revision_ref->getPHID(); | $revision_phid = $revision_ref->getPHID(); | ||||
| if (!isset($build_map[$revision_phid])) { | if (!isset($build_map[$revision_phid])) { | ||||
| $build_map[$revision_phid] = array( | $build_map[$revision_phid] = array( | ||||
| 'revisionRef' => $revision_phid, | 'revisionRef' => $revision_ref, | ||||
| 'buildRefs' => array(), | 'buildRefs' => array(), | ||||
| ); | ); | ||||
| } | } | ||||
| $build_map[$revision_phid]['buildRefs'][] = $build_ref; | $build_map[$revision_phid]['buildRefs'][] = $build_ref; | ||||
| } | } | ||||
| $log = $this->getLogEngine(); | $log = $this->getLogEngine(); | ||||
| Show All 14 Lines | if ($has_failures) { | ||||
| phutil_count($build_map)); | phutil_count($build_map)); | ||||
| $query = pht( | $query = pht( | ||||
| 'Land %s revision(s) anyway, despite failed builds?', | 'Land %s revision(s) anyway, despite failed builds?', | ||||
| phutil_count($build_map)); | phutil_count($build_map)); | ||||
| } | } | ||||
| echo tsprintf( | echo tsprintf( | ||||
| "%!\n%s\n\n", | "%!\n%s\n", | ||||
| pht('BUILD FAILURES'), | pht('BUILD FAILURES'), | ||||
| $message); | $message); | ||||
| $prompt_key = 'arc.land.failed-builds'; | $prompt_key = 'arc.land.failed-builds'; | ||||
| } else if ($has_ongoing) { | } else if ($has_ongoing) { | ||||
| echo tsprintf( | echo tsprintf( | ||||
| "%!\n%s\n\n", | "%!\n%s\n", | ||||
| pht('ONGOING BUILDS'), | pht('ONGOING BUILDS'), | ||||
| pht( | pht( | ||||
| '%s revision(s) have ongoing builds:', | '%s revision(s) have ongoing builds:', | ||||
| phutil_count($build_map))); | phutil_count($build_map))); | ||||
| $query = pht( | $query = pht( | ||||
| 'Land %s revision(s) anyway, despite ongoing builds?', | 'Land %s revision(s) anyway, despite ongoing builds?', | ||||
| phutil_count($build_map)); | phutil_count($build_map)); | ||||
| Show All 10 Lines | foreach ($build_map as $build_item) { | ||||
| foreach ($build_item['buildRefs'] as $build_ref) { | foreach ($build_item['buildRefs'] as $build_ref) { | ||||
| echo tsprintf('%s', $build_ref->newDisplayRef()); | echo tsprintf('%s', $build_ref->newDisplayRef()); | ||||
| } | } | ||||
| echo tsprintf("\n"); | echo tsprintf("\n"); | ||||
| } | } | ||||
| echo tsprintf( | echo tsprintf( | ||||
| "\n%s\n\n", | "\n%s\n", | ||||
| pht('You can review build details here:')); | pht('You can review build details here:')); | ||||
| // TODO: Only show buildables with problem builds. | // TODO: Only show buildables with problem builds. | ||||
| $workflow = $this->getWorkflow(); | |||||
| foreach ($buildable_refs as $buildable) { | foreach ($buildable_refs as $buildable) { | ||||
| $display_ref = $buildable->newDisplayRef(); | $display_ref = $buildable->newDisplayRef(); | ||||
| // TODO: Include URI here. | $raw_uri = $buildable->getURI(); | ||||
| $raw_uri = $workflow->getAbsoluteURI($raw_uri); | |||||
| $display_ref->setURI($raw_uri); | |||||
| echo tsprintf('%s', $display_ref); | echo tsprintf('%s', $display_ref); | ||||
| } | } | ||||
| $this->getWorkflow() | $this->getWorkflow() | ||||
| ->getPrompt($prompt_key) | ->getPrompt($prompt_key) | ||||
| ->setQuery($query) | ->setQuery($query) | ||||
| ->execute(); | ->execute(); | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | if ($force_ref) { | ||||
| // TODO: Make this more clear. | // TODO: Make this more clear. | ||||
| // TODO: Show all the commits. | // TODO: Show all the commits. | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| 'TODO: You are forcing a revision, but commits are associated '. | 'TODO: You are forcing a revision, but commits are associated '. | ||||
| 'with some other revision. Are you REALLY sure you want to land '. | 'with some other revision. Are you REALLY sure you want to land '. | ||||
| 'ALL these commits wiht a different unrelated revision???')); | 'ALL these commits with a different unrelated revision???')); | ||||
| } | } | ||||
| foreach ($confirm_force as $commit) { | foreach ($confirm_force as $commit) { | ||||
| $commit->setExplicitRevisionRef($force_ref); | $commit->setExplicitRevisionRef($force_ref); | ||||
| } | } | ||||
| } | } | ||||
| // Finally, raise an error if we're left with ambiguous revisions. This | // Finally, raise an error if we're left with ambiguous revisions. This | ||||
| ▲ Show 20 Lines • Show All 656 Lines • Show Last 20 Lines | |||||