]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix getting changed files in SVN
authorvrana <jakubv@fb.com>
Thu, 31 Jan 2013 20:21:26 +0000 (12:21 -0800)
committervrana <jakubv@fb.com>
Thu, 31 Jan 2013 21:47:59 +0000 (13:47 -0800)
Summary:
This is pretty awkward but I don't have anything better.

Also don't compute cache key if caching is disabled.

Test Plan:
  $ svn diff --xml --summarize '' -r 701319:HEAD
  $ svn diff --xml --summarize svn+ssh://tubbs/svnroot/projects/lolbunny -r 701319:HEAD

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4771

src/repository/api/ArcanistSubversionAPI.php
src/workflow/ArcanistLintWorkflow.php

index 672cd13ea7a4f3ebdb90d6ce07f786a8da3a013e..f247b2383b23203e1ff020ebbe745c62b72f0ace 100644 (file)
@@ -494,10 +494,16 @@ EODIFF;
   }
 
   public function getChangedFiles($since_commit) {
+    $url = '';
+    $match = null;
+    if (preg_match('/(.*)@(.*)/', $since_commit, $match)) {
+      list(, $url, $since_commit) = $match;
+    }
     // TODO: Handle paths with newlines.
     list($stdout) = $this->execxLocal(
-      '--xml diff --revision %s:HEAD --summarize',
-      $since_commit);
+      '--xml diff --revision %s:HEAD --summarize %s',
+      $since_commit,
+      $url);
     $xml = new SimpleXMLElement($stdout);
 
     $return = array();
index c1c1fc69ff0c7f4681b850812dbfe5ebdcfe893c..1f3cd213b5cf60f6e355dc6f8377a1621bd5aed9 100644 (file)
@@ -195,7 +195,10 @@ EOTEXT
     $engine = newv($engine, array());
     $this->engine = $engine;
     $engine->setWorkingCopy($working_copy);
-    $engine->setRepositoryVersion($this->getRepositoryVersion());
+
+    if ($use_cache) {
+      $engine->setRepositoryVersion($this->getRepositoryVersion());
+    }
 
     $engine->setMinimumSeverity(
       $this->getArgument('severity', self::DEFAULT_SEVERITY));