Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistBrowseWorkflow.php
| Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | if ($this->hasRepositoryAPI()) { | ||||
| 'Opening **%s** as a commit.', | 'Opening **%s** as a commit.', | ||||
| $thing)."\n"); | $thing)."\n"); | ||||
| } | } | ||||
| } | } | ||||
| // If we fail, try to resolve them as paths. | // If we fail, try to resolve them as paths. | ||||
| foreach ($things as $key => $path) { | foreach ($things as $key => $path) { | ||||
| $path = preg_replace('/:([0-9]+)$/', '$\1', $path); | $line = null; | ||||
| $parts = explode(':', $path); | |||||
| if (count($parts) > 1) { | |||||
| $line = (int)array_pop($parts); | |||||
| } | |||||
| $path = implode(':', $parts); | |||||
| $full_path = Filesystem::resolvePath($path); | $full_path = Filesystem::resolvePath($path); | ||||
| if (!$is_force && !Filesystem::pathExists($full_path)) { | if (!$is_force && !Filesystem::pathExists($full_path)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| $console->writeOut( | $console->writeOut( | ||||
| pht( | pht( | ||||
| 'Opening **%s** as a repository path.', | 'Opening **%s** as a repository path.', | ||||
| $key)."\n"); | $key)."\n"); | ||||
| unset($things[$key]); | unset($things[$key]); | ||||
| if ($full_path == $project_root) { | if ($full_path == $project_root) { | ||||
| $path = ''; | $path = ''; | ||||
| } else { | } else { | ||||
| $path = Filesystem::readablePath($full_path, $project_root); | $path = Filesystem::readablePath($full_path, $project_root); | ||||
| } | } | ||||
| $base_uri = $this->getBaseURI(); | $base_uri = $this->getBaseURI(); | ||||
| $uris[] = $base_uri.$path; | $uri = $base_uri.$path; | ||||
| if ($line) { | |||||
| $uri = $uri.'$'.$line; | |||||
| } | |||||
| $uris[] = $uri; | |||||
| } | } | ||||
| } else { | } else { | ||||
| if ($things) { | if ($things) { | ||||
| $console->writeOut( | $console->writeOut( | ||||
| pht( | pht( | ||||
| "The current working directory is not a repository working ". | "The current working directory is not a repository working ". | ||||
| "copy, so remaining arguments can not be resolved as paths or ". | "copy, so remaining arguments can not be resolved as paths or ". | ||||
| "commits. To browse paths or symbolic commits in Diffusion, run ". | "commits. To browse paths or symbolic commits in Diffusion, run ". | ||||
| Show All 36 Lines | |||||