@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Hide irrelevant panels in Mercurial/Subversion, fix Subversion URIs

Summary:
Ref T10923.

- Hide "Automation", "Staging" and "Branches" in repositories where they do nothing.
- Fix SVN SSH URIs to read "svn+ssh://" and have proper paths.

Test Plan:
- Verified irrelevant sections did not appear in Subversion in Manage UI.
- Checked out a new hosted SVN repository.

Reviewers: chad, avivey

Reviewed By: avivey

Maniphest Tasks: T10923

Differential Revision: https://secure.phabricator.com/D15874

+35 -2
+6 -1
src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
··· 27 27 28 28 $panels = DiffusionRepositoryManagementPanel::getAllPanels(); 29 29 30 - foreach ($panels as $panel) { 30 + foreach ($panels as $key => $panel) { 31 31 $panel 32 32 ->setViewer($viewer) 33 33 ->setRepository($repository) 34 34 ->setController($this); 35 + 36 + if (!$panel->shouldEnableForRepository($repository)) { 37 + unset($panels[$key]); 38 + continue; 39 + } 35 40 } 36 41 37 42 $selected = $request->getURIData('panel');
+5
src/applications/diffusion/management/DiffusionRepositoryAutomationManagementPanel.php
··· 13 13 return 800; 14 14 } 15 15 16 + public function shouldEnableForRepository( 17 + PhabricatorRepository $repository) { 18 + return $repository->isGit(); 19 + } 20 + 16 21 protected function getEditEngineFieldKeys() { 17 22 return array( 18 23 'automationBlueprintPHIDs',
+5
src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
··· 13 13 return 1000; 14 14 } 15 15 16 + public function shouldEnableForRepository( 17 + PhabricatorRepository $repository) { 18 + return ($repository->isGit() || $repository->isHg()); 19 + } 20 + 16 21 public function getManagementPanelIcon() { 17 22 $repository = $this->getRepository(); 18 23
+5
src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php
··· 46 46 return array(); 47 47 } 48 48 49 + public function shouldEnableForRepository( 50 + PhabricatorRepository $repository) { 51 + return true; 52 + } 53 + 49 54 final protected function newActions() { 50 55 $actions = $this->buildManagementPanelActions(); 51 56 if (!$actions) {
+6
src/applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php
··· 13 13 return 700; 14 14 } 15 15 16 + public function shouldEnableForRepository( 17 + PhabricatorRepository $repository) { 18 + return $repository->isGit(); 19 + } 20 + 21 + 16 22 public function getManagementPanelIcon() { 17 23 $repository = $this->getRepository(); 18 24
+8 -1
src/applications/repository/storage/PhabricatorRepositoryURI.php
··· 310 310 311 311 312 312 private function getForcedProtocol() { 313 + $repository = $this->getRepository(); 314 + 313 315 switch ($this->getBuiltinProtocol()) { 314 316 case self::BUILTIN_PROTOCOL_SSH: 315 - return 'ssh'; 317 + if ($repository->isSVN()) { 318 + return 'svn+ssh'; 319 + } else { 320 + return 'ssh'; 321 + } 316 322 case self::BUILTIN_PROTOCOL_HTTP: 317 323 return 'http'; 318 324 case self::BUILTIN_PROTOCOL_HTTPS: ··· 382 388 $suffix = '/'; 383 389 } else { 384 390 $suffix = ''; 391 + $clone_name = ''; 385 392 } 386 393 387 394 switch ($this->getBuiltinIdentifier()) {