Page MenuHomePhabricator

D11551.diff
No OneTemporary

D11551.diff

diff --git a/scripts/arcanist.php b/scripts/arcanist.php
--- a/scripts/arcanist.php
+++ b/scripts/arcanist.php
@@ -202,6 +202,17 @@
$workflow->setConduitTimeout($conduit_timeout);
}
+ $supported_vcs_types = $workflow->getSupportedRevisionControlSystems();
+ if (!in_array($working_copy->getVCSType(), $supported_vcs_types) &&
+ !in_array('any', $supported_vcs_types)) {
+ throw new ArcanistUsageException(
+ pht(
+ '`%s %s` is only supported under %s.',
+ 'arc',
+ $workflow->getWorkflowName(),
+ implode(', ', $supported_vcs_types)));
+ }
+
$need_working_copy = $workflow->requiresWorkingCopy();
$need_conduit = $workflow->requiresConduit();
$need_auth = $workflow->requiresAuthentication();
diff --git a/src/workflow/ArcanistAmendWorkflow.php b/src/workflow/ArcanistAmendWorkflow.php
--- a/src/workflow/ArcanistAmendWorkflow.php
+++ b/src/workflow/ArcanistAmendWorkflow.php
@@ -188,7 +188,7 @@
return 0;
}
- protected function getSupportedRevisionControlSystems() {
+ public function getSupportedRevisionControlSystems() {
return array('git', 'hg');
}
diff --git a/src/workflow/ArcanistBookmarkWorkflow.php b/src/workflow/ArcanistBookmarkWorkflow.php
--- a/src/workflow/ArcanistBookmarkWorkflow.php
+++ b/src/workflow/ArcanistBookmarkWorkflow.php
@@ -25,17 +25,8 @@
);
}
- protected function getSupportedRevisionControlSystems() {
+ public function getSupportedRevisionControlSystems() {
return array('hg');
}
- public function run() {
- $repository_api = $this->getRepositoryAPI();
- if (!($repository_api instanceof ArcanistMercurialAPI)) {
- throw new ArcanistUsageException(
- 'arc bookmark is only supported under Mercurial.');
- }
- return parent::run();
- }
-
}
diff --git a/src/workflow/ArcanistCommitWorkflow.php b/src/workflow/ArcanistCommitWorkflow.php
--- a/src/workflow/ArcanistCommitWorkflow.php
+++ b/src/workflow/ArcanistCommitWorkflow.php
@@ -65,12 +65,6 @@
public function run() {
$repository_api = $this->getRepositoryAPI();
- if (!($repository_api instanceof ArcanistSubversionAPI)) {
- throw new ArcanistUsageException(
- "'arc commit' is only supported under svn.");
- }
-
-
$revision_id = $this->normalizeRevisionID($this->getArgument('revision'));
if (!$revision_id) {
$revisions = $repository_api->loadWorkingCopyDifferentialRevisions(
@@ -271,7 +265,7 @@
}
}
- protected function getSupportedRevisionControlSystems() {
+ public function getSupportedRevisionControlSystems() {
return array('svn');
}
diff --git a/src/workflow/ArcanistLandWorkflow.php b/src/workflow/ArcanistLandWorkflow.php
--- a/src/workflow/ArcanistLandWorkflow.php
+++ b/src/workflow/ArcanistLandWorkflow.php
@@ -239,13 +239,6 @@
$this->isGit = $repository_api instanceof ArcanistGitAPI;
$this->isHg = $repository_api instanceof ArcanistMercurialAPI;
- if (!$this->isGit && !$this->isHg) {
- throw new ArcanistUsageException(
- pht(
- "'arc land' only supports Git and Mercurial. For Subversion, try ".
- "'arc commit'."));
- }
-
if ($this->isGit) {
$repository = $this->loadProjectRepository();
$this->isGitSvn = (idx($repository, 'vcs') == 'svn');
@@ -1141,7 +1134,7 @@
}
}
- protected function getSupportedRevisionControlSystems() {
+ public function getSupportedRevisionControlSystems() {
return array('git', 'hg');
}
diff --git a/src/workflow/ArcanistWorkflow.php b/src/workflow/ArcanistWorkflow.php
--- a/src/workflow/ArcanistWorkflow.php
+++ b/src/workflow/ArcanistWorkflow.php
@@ -1215,7 +1215,7 @@
return array();
}
- protected function getSupportedRevisionControlSystems() {
+ public function getSupportedRevisionControlSystems() {
return array('any');
}

File Metadata

Mime Type
text/plain
Expires
Mon, May 13, 10:34 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6277861
Default Alt Text
D11551.diff (3 KB)

Event Timeline