@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.

Restore edit UI for "Import Only" in Subversion

Summary: Ref T10923. Although I'd ideally like to get rid of this eventually, keep it around for now.

Test Plan:
- Edited value for an SVN repository.
- Observed no panel present for a Git repository.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10923

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

+95
+2
src/__phutil_library_map__.php
··· 775 775 'DiffusionRepositoryStagingManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php', 776 776 'DiffusionRepositoryStatusManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryStatusManagementPanel.php', 777 777 'DiffusionRepositoryStorageManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php', 778 + 'DiffusionRepositorySubversionManagementPanel' => 'applications/diffusion/management/DiffusionRepositorySubversionManagementPanel.php', 778 779 'DiffusionRepositorySymbolsManagementPanel' => 'applications/diffusion/management/DiffusionRepositorySymbolsManagementPanel.php', 779 780 'DiffusionRepositoryTag' => 'applications/diffusion/data/DiffusionRepositoryTag.php', 780 781 'DiffusionRepositoryTestAutomationController' => 'applications/diffusion/controller/DiffusionRepositoryTestAutomationController.php', ··· 4995 4996 'DiffusionRepositoryStagingManagementPanel' => 'DiffusionRepositoryManagementPanel', 4996 4997 'DiffusionRepositoryStatusManagementPanel' => 'DiffusionRepositoryManagementPanel', 4997 4998 'DiffusionRepositoryStorageManagementPanel' => 'DiffusionRepositoryManagementPanel', 4999 + 'DiffusionRepositorySubversionManagementPanel' => 'DiffusionRepositoryManagementPanel', 4998 5000 'DiffusionRepositorySymbolsManagementPanel' => 'DiffusionRepositoryManagementPanel', 4999 5001 'DiffusionRepositoryTag' => 'Phobject', 5000 5002 'DiffusionRepositoryTestAutomationController' => 'DiffusionRepositoryManageController',
+16
src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php
··· 226 226 "IMPORTANT: This feature is new, experimental, and not supported. ". 227 227 "Use it at your own risk."); 228 228 229 + $subpath_instructions = pht( 230 + 'If you want to import only part of a repository, like `trunk/`, '. 231 + 'you can set a path in **Import Only**. Phabricator will ignore '. 232 + 'commits which do not affect this path.'); 233 + 229 234 return array( 230 235 id(new PhabricatorSelectEditField()) 231 236 ->setKey('vcs') ··· 338 343 ->setConduitDescription(pht('Set the autoclose branches.')) 339 344 ->setConduitTypeDescription(pht('New default tracked branchs.')) 340 345 ->setValue($autoclose_value), 346 + id(new PhabricatorTextEditField()) 347 + ->setKey('importOnly') 348 + ->setLabel(pht('Import Only')) 349 + ->setTransactionType( 350 + PhabricatorRepositoryTransaction::TYPE_SVN_SUBPATH) 351 + ->setIsCopyable(true) 352 + ->setDescription(pht('Subpath to selectively import.')) 353 + ->setConduitDescription(pht('Set the subpath to import.')) 354 + ->setConduitTypeDescription(pht('New subpath to import.')) 355 + ->setValue($object->getDetail('svn-subpath')) 356 + ->setControlInstructions($subpath_instructions), 341 357 id(new PhabricatorTextEditField()) 342 358 ->setKey('stagingAreaURI') 343 359 ->setLabel(pht('Staging Area URI'))
+77
src/applications/diffusion/management/DiffusionRepositorySubversionManagementPanel.php
··· 1 + <?php 2 + 3 + final class DiffusionRepositorySubversionManagementPanel 4 + extends DiffusionRepositoryManagementPanel { 5 + 6 + const PANELKEY = 'subversion'; 7 + 8 + public function getManagementPanelLabel() { 9 + return pht('Subversion'); 10 + } 11 + 12 + public function getManagementPanelOrder() { 13 + return 1000; 14 + } 15 + 16 + public function shouldEnableForRepository( 17 + PhabricatorRepository $repository) { 18 + return $repository->isSVN(); 19 + } 20 + 21 + public function getManagementPanelIcon() { 22 + $repository = $this->getRepository(); 23 + 24 + $has_any = (bool)$repository->getDetail('svn-subpath'); 25 + 26 + if ($has_any) { 27 + return 'fa-database'; 28 + } else { 29 + return 'fa-database grey'; 30 + } 31 + } 32 + 33 + protected function getEditEngineFieldKeys() { 34 + return array( 35 + 'importOnly', 36 + ); 37 + } 38 + 39 + protected function buildManagementPanelActions() { 40 + $repository = $this->getRepository(); 41 + $viewer = $this->getViewer(); 42 + 43 + $can_edit = PhabricatorPolicyFilter::hasCapability( 44 + $viewer, 45 + $repository, 46 + PhabricatorPolicyCapability::CAN_EDIT); 47 + 48 + $subversion_uri = $this->getEditPageURI(); 49 + 50 + return array( 51 + id(new PhabricatorActionView()) 52 + ->setIcon('fa-pencil') 53 + ->setName(pht('Edit Properties')) 54 + ->setHref($subversion_uri) 55 + ->setDisabled(!$can_edit) 56 + ->setWorkflow(!$can_edit), 57 + ); 58 + } 59 + 60 + public function buildManagementPanelContent() { 61 + $repository = $this->getRepository(); 62 + $viewer = $this->getViewer(); 63 + 64 + $view = id(new PHUIPropertyListView()) 65 + ->setViewer($viewer) 66 + ->setActionList($this->newActions()); 67 + 68 + $default_branch = nonempty( 69 + $repository->getHumanReadableDetail('svn-subpath'), 70 + phutil_tag('em', array(), pht('Import Entire Repository'))); 71 + $view->addProperty(pht('Import Only'), $default_branch); 72 + 73 + 74 + return $this->newBox(pht('Subversion'), $view); 75 + } 76 + 77 + }