1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-29 02:02:40 +01:00

Allow lines to be specified as comma delimited number ranges for arc browse

Summary: Ref T5971. We lose validation of the line ranges, but I don't think that's a huge issue.

Test Plan: Ran `arc browse README`, `arc browse README:3`, and `arc browse README:3,6-7`

Reviewers: btrahan, epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5971

Differential Revision: https://secure.phabricator.com/D10352
This commit is contained in:
Vihang Mehta 2014-08-26 09:02:34 -07:00 committed by epriestley
parent e336b04aa1
commit f21262048f

View file

@ -144,10 +144,10 @@ EOTEXT
// 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);
@ -173,8 +173,8 @@ EOTEXT
$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;