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) { | ||||
| $line = null; | $lines = null; | ||||
| $parts = explode(':', $path); | $parts = explode(':', $path); | ||||
| if (count($parts) > 1) { | if (count($parts) > 1) { | ||||
| $line = (int)array_pop($parts); | $lines = array_pop($parts); | ||||
| } | } | ||||
| $path = implode(':', $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; | ||||
| } | } | ||||
| Show All 9 Lines | if ($this->hasRepositoryAPI()) { | ||||
| $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(); | ||||
| $uri = $base_uri.$path; | $uri = $base_uri.$path; | ||||
| if ($line) { | if ($lines) { | ||||
| $uri = $uri.'$'.$line; | $uri = $uri.'$'.$lines; | ||||
| } | } | ||||
| $uris[] = $uri; | $uris[] = $uri; | ||||
| } | } | ||||
| } else { | } else { | ||||
| if ($things) { | if ($things) { | ||||
| $console->writeOut( | $console->writeOut( | ||||
| pht( | pht( | ||||
| Show All 39 Lines | |||||