Page MenuHomePhabricator

D16976.diff
No OneTemporary

D16976.diff

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

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)

Event Timeline