]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix `arc diff` in SVN with paths
authorepriestley <git@epriestley.com>
Thu, 20 Dec 2012 19:12:30 +0000 (11:12 -0800)
committerepriestley <git@epriestley.com>
Thu, 20 Dec 2012 19:12:30 +0000 (11:12 -0800)
Summary:
Recently, in D4097 or one of the precursors I refactored this. However, when $rev is null parseBaseCommitArgument() throws ("This VCS does not support commit ranges."). Shield the call so it only happens if if $rev is nonempty (we still want to make the call, so "arc lint --rev x" on SVN will throw and inform the user that "--rev" is incorrect usage).

(@vrana, this was reported by FB and might be worth pushing.)

Test Plan: Ran "arc diff --preview <path>". Grepped for other parseBaseCommitArgument() callsites and verified they don't have similar issues.

Reviewers: vrana, btrahan, chad

Reviewed By: chad

CC: aran
Differential Revision: https://secure.phabricator.com/D4241

src/workflow/ArcanistBaseWorkflow.php

index 32312af2fb53c633424d38789d937909effb739b..12393f1ab33666546915660138d478345240f781 100644 (file)
@@ -1285,7 +1285,10 @@ abstract class ArcanistBaseWorkflow extends Phobject {
       }
     } else {
       $repository_api = $this->getRepositoryAPI();
-      $this->parseBaseCommitArgument(array($rev));
+
+      if ($rev) {
+        $this->parseBaseCommitArgument(array($rev));
+      }
 
       $paths = $repository_api->getWorkingCopyStatus();
       foreach ($paths as $path => $flags) {