]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Allow lines to be specified as comma delimited number ranges for arc browse
authorVihang Mehta <vihang@trifacta.com>
Tue, 26 Aug 2014 16:02:34 +0000 (09:02 -0700)
committerepriestley <git@epriestley.com>
Tue, 26 Aug 2014 16:02:34 +0000 (09:02 -0700)
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

index 1c144cfc8da9a4ca27e7b1d8fd70aa89eea4fd07..9653affe1e4fc51ff3cca3b1bd45c40a2a499b3d 100644 (file)
@@ -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;