Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F82101
D7562.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D7562.diff
View Options
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php
@@ -126,6 +126,9 @@
$request = $this->getRequest();
$user = $request->getUser();
+ $type = $repository->getVersionControlSystem();
+ $is_svn = ($type == PhabricatorRepositoryType::REPOSITORY_TYPE_SVN);
+
$v_http_mode = $repository->getDetail(
'serve-over-http',
PhabricatorRepository::SERVE_OFF);
@@ -146,9 +149,11 @@
$type_http = PhabricatorRepositoryTransaction::TYPE_PROTOCOL_HTTP;
$type_ssh = PhabricatorRepositoryTransaction::TYPE_PROTOCOL_SSH;
- $xactions[] = id(clone $template)
- ->setTransactionType($type_http)
- ->setNewValue($v_http_mode);
+ if (!$is_svn) {
+ $xactions[] = id(clone $template)
+ ->setTransactionType($type_http)
+ ->setNewValue($v_http_mode);
+ }
$xactions[] = id(clone $template)
->setTransactionType($type_ssh)
@@ -232,6 +237,18 @@
PhabricatorRepository::SERVE_READWRITE),
$rw_message);
+ if ($is_svn) {
+ $http_control = id(new AphrontFormMarkupControl())
+ ->setLabel(pht('HTTP'))
+ ->setValue(
+ phutil_tag(
+ 'em',
+ array(),
+ pht(
+ 'Phabricator does not currently support HTTP access to '.
+ 'Subversion repositories.')));
+ }
+
$form = id(new AphrontFormView())
->setUser($user)
->appendRemarkupInstructions(
diff --git a/src/applications/diffusion/controller/DiffusionServeController.php b/src/applications/diffusion/controller/DiffusionServeController.php
--- a/src/applications/diffusion/controller/DiffusionServeController.php
+++ b/src/applications/diffusion/controller/DiffusionServeController.php
@@ -172,18 +172,53 @@
pht('This repository is not available over HTTP.'));
}
- switch ($repository->getVersionControlSystem()) {
- case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
- $result = $this->serveGitRequest($repository, $viewer);
- break;
- case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
- $result = $this->serveMercurialRequest($repository, $viewer);
- break;
- default:
- $result = new PhabricatorVCSResponse(
- 999,
- pht('TODO: Implement meaningful responses.'));
- break;
+ $vcs_type = $repository->getVersionControlSystem();
+ $req_type = $this->isVCSRequest($request);
+
+ if ($vcs_type != $req_type) {
+ switch ($req_type) {
+ case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
+ $result = new PhabricatorVCSResponse(
+ 500,
+ pht('This is not a Git repository.'));
+ break;
+ case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
+ $result = new PhabricatorVCSResponse(
+ 500,
+ pht('This is not a Mercurial repository.'));
+ break;
+ case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
+ $result = new PhabricatorVCSResponse(
+ 500,
+ pht('This is not a Subversion repository.'));
+ break;
+ default:
+ $result = new PhabricatorVCSResponse(
+ 500,
+ pht('Unknown request type.'));
+ break;
+ }
+ } else {
+ switch ($vcs_type) {
+ case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
+ $result = $this->serveGitRequest($repository, $viewer);
+ break;
+ case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
+ $result = $this->serveMercurialRequest($repository, $viewer);
+ break;
+ case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
+ $result = new PhabricatorVCSResponse(
+ 500,
+ pht(
+ 'Phabricator does not support HTTP access to Subversion '.
+ 'repositories.'));
+ break;
+ default:
+ $result = new PhabricatorVCSResponse(
+ 500,
+ pht('Unknown version control system.'));
+ break;
+ }
}
$code = $result->getHTTPResponseCode();
@@ -232,7 +267,7 @@
return DiffusionMercurialWireProtocol::isReadOnlyBatchCommand($cmds);
}
return DiffusionMercurialWireProtocol::isReadOnlyCommand($cmd);
- case PhabricatorRepositoryType::REPOSITORY_TYPE_SUBVERSION:
+ case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
break;
}
diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php
--- a/src/applications/repository/storage/PhabricatorRepository.php
+++ b/src/applications/repository/storage/PhabricatorRepository.php
@@ -757,6 +757,9 @@
}
public function getServeOverHTTP() {
+ if ($this->isSVN()) {
+ return self::SERVE_OFF;
+ }
$serve = $this->getDetail('serve-over-http', self::SERVE_OFF);
return $this->normalizeServeConfigSetting($serve);
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/2l/xb/2m3lpj5vzgjps6i3
Default Alt Text
D7562.diff (5 KB)
Attached To
Mode
D7562: Don't implement SVN over HTTP
Attached
Detach File
Event Timeline
Log In to Comment