From f21262048fcda60884da201cb734695199a4133b Mon Sep 17 00:00:00 2001 From: Vihang Mehta Date: Tue, 26 Aug 2014 09:02:34 -0700 Subject: [PATCH] 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 --- src/workflow/ArcanistBrowseWorkflow.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/workflow/ArcanistBrowseWorkflow.php b/src/workflow/ArcanistBrowseWorkflow.php index 1c144cfc..9653affe 100644 --- a/src/workflow/ArcanistBrowseWorkflow.php +++ b/src/workflow/ArcanistBrowseWorkflow.php @@ -144,10 +144,10 @@ EOTEXT // If we fail, try to resolve them as paths. foreach ($things as $key => $path) { - $line = null; + $lines = null; $parts = explode(':', $path); if (count($parts) > 1) { - $line = (int)array_pop($parts); + $lines = array_pop($parts); } $path = implode(':', $parts); @@ -173,8 +173,8 @@ EOTEXT $base_uri = $this->getBaseURI(); $uri = $base_uri.$path; - if ($line) { - $uri = $uri.'$'.$line; + if ($lines) { + $uri = $uri.'$'.$lines; } $uris[] = $uri;