From: vrana Date: Fri, 14 Dec 2012 23:49:01 +0000 (-0800) Subject: Don't require clean working copy for `arc diff path` in SVN X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f830b3bf3f8f9194c8cfcbe0835ab09d26e345e5;p=arcanist.git Don't require clean working copy for `arc diff path` in SVN Summary: If you are explicit then there is no need to ask you. Test Plan: $ touch a $ arc diff $ arc diff a $ arc diff existing Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4186 --- diff --git a/src/repository/api/ArcanistSubversionAPI.php b/src/repository/api/ArcanistSubversionAPI.php index 2d46e9f6..74ab37a5 100644 --- a/src/repository/api/ArcanistSubversionAPI.php +++ b/src/repository/api/ArcanistSubversionAPI.php @@ -15,6 +15,7 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI { protected $svnDiffRaw = array(); private $svnBaseRevisionNumber; + private $statusPaths = array(); public function getSourceControlSystemName() { return 'svn'; @@ -63,9 +64,20 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI { return $this->svnBaseRevisions; } + public function limitStatusToPaths(array $paths) { + $this->statusPaths = $paths; + return $this; + } + public function getSVNStatus($with_externals = false) { if ($this->svnStatus === null) { - list($status) = $this->execxLocal('--xml status'); + if ($this->statusPaths) { + list($status) = $this->execxLocal( + '--xml status %Ls', + $this->statusPaths); + } else { + list($status) = $this->execxLocal('--xml status'); + } $xml = new SimpleXMLElement($status); if (count($xml->target) != 1) { diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index bea10bd2..6b510863 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -616,6 +616,7 @@ EOTEXT } if ($this->requiresWorkingCopy()) { + $repository_api = $this->getRepositoryAPI(); try { if ($this->getArgument('add-all')) { $this->setCommitMode(self::COMMIT_ENABLE); @@ -624,9 +625,11 @@ EOTEXT } else { $this->setCommitMode(self::COMMIT_ALLOW); } + if ($repository_api instanceof ArcanistSubversionAPI) { + $repository_api->limitStatusToPaths($this->getArgument('paths')); + } $this->requireCleanWorkingCopy(); } catch (ArcanistUncommittedChangesException $ex) { - $repository_api = $this->getRepositoryAPI(); if ($repository_api instanceof ArcanistMercurialAPI) { // Some Mercurial users prefer to use it like SVN, where they don't