Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13983913
D15874.id38232.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
D15874.id38232.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 21, 9:38 AM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6736006
Default Alt Text
D15874.id38232.diff (4 KB)
Attached To
Mode
D15874: Hide irrelevant panels in Mercurial/Subversion, fix Subversion URIs
Attached
Detach File
Event Timeline
Log In to Comment