Page MenuHomePhabricator

D15874.id38240.diff
No OneTemporary

D15874.id38240.diff

diff --git a/src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php b/src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
@@ -27,11 +27,16 @@
$panels = DiffusionRepositoryManagementPanel::getAllPanels();
- foreach ($panels as $panel) {
+ foreach ($panels as $key => $panel) {
$panel
->setViewer($viewer)
->setRepository($repository)
->setController($this);
+
+ if (!$panel->shouldEnableForRepository($repository)) {
+ unset($panels[$key]);
+ continue;
+ }
}
$selected = $request->getURIData('panel');
diff --git a/src/applications/diffusion/management/DiffusionRepositoryAutomationManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryAutomationManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryAutomationManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryAutomationManagementPanel.php
@@ -13,6 +13,11 @@
return 800;
}
+ public function shouldEnableForRepository(
+ PhabricatorRepository $repository) {
+ return $repository->isGit();
+ }
+
protected function getEditEngineFieldKeys() {
return array(
'automationBlueprintPHIDs',
diff --git a/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
@@ -13,6 +13,11 @@
return 1000;
}
+ public function shouldEnableForRepository(
+ PhabricatorRepository $repository) {
+ return ($repository->isGit() || $repository->isHg());
+ }
+
public function getManagementPanelIcon() {
$repository = $this->getRepository();
diff --git a/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php
@@ -46,6 +46,11 @@
return array();
}
+ public function shouldEnableForRepository(
+ PhabricatorRepository $repository) {
+ return true;
+ }
+
final protected function newActions() {
$actions = $this->buildManagementPanelActions();
if (!$actions) {
diff --git a/src/applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php
@@ -13,6 +13,12 @@
return 700;
}
+ public function shouldEnableForRepository(
+ PhabricatorRepository $repository) {
+ return $repository->isGit();
+ }
+
+
public function getManagementPanelIcon() {
$repository = $this->getRepository();
diff --git a/src/applications/repository/storage/PhabricatorRepositoryURI.php b/src/applications/repository/storage/PhabricatorRepositoryURI.php
--- a/src/applications/repository/storage/PhabricatorRepositoryURI.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryURI.php
@@ -310,9 +310,15 @@
private function getForcedProtocol() {
+ $repository = $this->getRepository();
+
switch ($this->getBuiltinProtocol()) {
case self::BUILTIN_PROTOCOL_SSH:
- return 'ssh';
+ if ($repository->isSVN()) {
+ return 'svn+ssh';
+ } else {
+ return 'ssh';
+ }
case self::BUILTIN_PROTOCOL_HTTP:
return 'http';
case self::BUILTIN_PROTOCOL_HTTPS:
@@ -382,6 +388,7 @@
$suffix = '/';
} else {
$suffix = '';
+ $clone_name = '';
}
switch ($this->getBuiltinIdentifier()) {

File Metadata

Mime Type
text/plain
Expires
Oct 20 2024, 9:43 AM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6736006
Default Alt Text
D15874.id38240.diff (4 KB)

Event Timeline