Changeset View
Changeset View
Standalone View
Standalone View
src/browse/workflow/ArcanistBrowseWorkflow.php
| Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | public function runWorkflow() { | ||||
| $branch = $this->getArgument('branch'); | $branch = $this->getArgument('branch'); | ||||
| if ($branch) { | if ($branch) { | ||||
| foreach ($refs as $ref) { | foreach ($refs as $ref) { | ||||
| $ref->setBranch($branch); | $ref->setBranch($branch); | ||||
| } | } | ||||
| } | } | ||||
| $loaders = ArcanistBrowseURIHardpointLoader::getAllBrowseLoaders(); | // TODO: The "Path" and "Commit" queries should regain the ability to warn | ||||
| foreach ($loaders as $key => $loader) { | // when this command is not run in a working copy that belongs to a | ||||
| $loaders[$key] = clone $loader; | // recognized repository, so they won't ever be able to resolve things. | ||||
| } | |||||
| // TODO: When you run "arc browse" with no arguments, we should either | |||||
| // take you to the repository home page or show help. | |||||
| // TODO: When you "arc browse something/like/a/path.c" but it does not | |||||
| // exist on disk, it is not resolved unless you explicitly use "--type | |||||
| // path". This should be explained more clearly again. | |||||
| $query = $this->newRefQuery($refs) | $this->loadHardpoints( | ||||
| ->needHardpoints( | $refs, | ||||
| array( | array( | ||||
| 'uris', | ArcanistBrowseRef::HARDPOINT_URIS, | ||||
| )) | )); | ||||
| ->setLoaders($loaders); | |||||
| foreach ($loaders as $loader) { | |||||
| $loader->willLoadBrowseURIRefs($refs); | |||||
| } | |||||
| $query->execute(); | |||||
| $zero_hits = array(); | $zero_hits = array(); | ||||
| $open_uris = array(); | $open_uris = array(); | ||||
| $many_hits = array(); | $many_hits = array(); | ||||
| foreach ($refs as $ref) { | foreach ($refs as $ref) { | ||||
| $uris = $ref->getURIs(); | $uris = $ref->getURIs(); | ||||
| if (!$uris) { | if (!$uris) { | ||||
| $zero_hits[] = $ref; | $zero_hits[] = $ref; | ||||
| ▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | if ($zero_hits) { | ||||
| } else { | } else { | ||||
| echo tsprintf( | echo tsprintf( | ||||
| "%s\n", | "%s\n", | ||||
| pht( | pht( | ||||
| 'Unable to resolve argument "%s".', | 'Unable to resolve argument "%s".', | ||||
| $ref->getToken())); | $ref->getToken())); | ||||
| } | } | ||||
| } | } | ||||
| foreach ($loaders as $loader) { | |||||
| $loader->didFailToLoadBrowseURIRefs($refs); | |||||
| } | |||||
| } | } | ||||
| $uris = array(); | $uris = array(); | ||||
| foreach ($open_uris as $ref) { | foreach ($open_uris as $ref) { | ||||
| $ref_uris = $ref->getURIs(); | $ref_uris = $ref->getURIs(); | ||||
| if (count($ref_uris) > 1) { | if (count($ref_uris) > 1) { | ||||
| foreach ($ref_uris as $uri_key => $uri) { | foreach ($ref_uris as $uri_key => $uri) { | ||||
| Show All 16 Lines | |||||