Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13981426
D16976.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D16976.diff
View Options
diff --git a/src/applications/diffusion/ssh/DiffusionGitSSHWorkflow.php b/src/applications/diffusion/ssh/DiffusionGitSSHWorkflow.php
--- a/src/applications/diffusion/ssh/DiffusionGitSSHWorkflow.php
+++ b/src/applications/diffusion/ssh/DiffusionGitSSHWorkflow.php
@@ -35,4 +35,14 @@
}
}
+ protected function raiseWrongVCSException(
+ PhabricatorRepository $repository) {
+ throw new Exception(
+ pht(
+ 'This repository ("%s") is not a Git repository. Use "%s" to '.
+ 'interact with this repository.',
+ $repository->getDisplayName(),
+ $repository->getVersionControlSystem()));
+ }
+
}
diff --git a/src/applications/diffusion/ssh/DiffusionMercurialServeSSHWorkflow.php b/src/applications/diffusion/ssh/DiffusionMercurialServeSSHWorkflow.php
--- a/src/applications/diffusion/ssh/DiffusionMercurialServeSSHWorkflow.php
+++ b/src/applications/diffusion/ssh/DiffusionMercurialServeSSHWorkflow.php
@@ -119,4 +119,14 @@
return $raw_message;
}
+ protected function raiseWrongVCSException(
+ PhabricatorRepository $repository) {
+ throw new Exception(
+ pht(
+ 'This repository ("%s") is not a Mercurial repository. Use "%s" to '.
+ 'interact with this repository.',
+ $repository->getDisplayName(),
+ $repository->getVersionControlSystem()));
+ }
+
}
diff --git a/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php b/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
--- a/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
+++ b/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
@@ -43,6 +43,8 @@
*/
abstract protected function identifyRepository();
abstract protected function executeRepositoryOperations();
+ abstract protected function raiseWrongVCSException(
+ PhabricatorRepository $repository);
protected function getBaseRequestPath() {
return $this->baseRequestPath;
@@ -199,6 +201,10 @@
$repository->getDisplayName()));
}
+ if ($repository->getVersionControlSystem() != $vcs) {
+ $this->raiseWrongVCSException($repository);
+ }
+
return $repository;
}
diff --git a/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php b/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php
--- a/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php
+++ b/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php
@@ -449,4 +449,14 @@
return $path;
}
+ protected function raiseWrongVCSException(
+ PhabricatorRepository $repository) {
+ throw new Exception(
+ pht(
+ 'This repository ("%s") is not a Subversion repository. Use "%s" to '.
+ 'interact with this repository.',
+ $repository->getDisplayName(),
+ $repository->getVersionControlSystem()));
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 20, 4:27 PM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6733485
Default Alt Text
D16976.diff (2 KB)
Attached To
Mode
D16976: Improve error messages for running `git clone` against a Mercurial repository
Attached
Detach File
Event Timeline
Log In to Comment