1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-10 08:52:39 +01:00

Fix arc browse path:line

Summary: Ref T5781. This was broken in some earlier changes in T5781.

Test Plan: Ran `arc browse README`, `arc browse README:10`.

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5781

Differential Revision: https://secure.phabricator.com/D10346
This commit is contained in:
epriestley 2014-08-25 12:45:49 -07:00
parent 7e901d8b4f
commit e336b04aa1

View file

@ -144,7 +144,13 @@ EOTEXT
// If we fail, try to resolve them as paths.
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);
if (!$is_force && !Filesystem::pathExists($full_path)) {
@ -165,7 +171,13 @@ EOTEXT
}
$base_uri = $this->getBaseURI();
$uris[] = $base_uri.$path;
$uri = $base_uri.$path;
if ($line) {
$uri = $uri.'$'.$line;
}
$uris[] = $uri;
}
} else {
if ($things) {