Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14089652
D11550.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D11550.diff
View Options
diff --git a/scripts/arcanist.php b/scripts/arcanist.php
--- a/scripts/arcanist.php
+++ b/scripts/arcanist.php
@@ -202,6 +202,16 @@
$workflow->setConduitTimeout($conduit_timeout);
}
+ $supported_vcs_types = $workflow->getSupportedRevisionControlSystems();
+ if (!in_array($working_copy->getVCSType(), $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,12 +25,11 @@
);
}
+ 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/ArcanistRevertWorkflow.php b/src/workflow/ArcanistRevertWorkflow.php
--- a/src/workflow/ArcanistRevertWorkflow.php
+++ b/src/workflow/ArcanistRevertWorkflow.php
@@ -29,7 +29,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('git', 'hg', 'svn');
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 12:23 PM (7 h, 38 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6785877
Default Alt Text
D11550.diff (4 KB)
Attached To
Mode
D11550: Explicitly check for supported VCS
Attached
Detach File
Event Timeline
Log In to Comment