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

In repository settings, fold "Autoclose On/Off" into "Publishing On/Off"

Summary:
Depends on D20423. Ref T13277. Repositories currently have separate toggles for "Autoclose" and "Publishing".

Merge the "Autoclose" toggle into the "Publishing" toggle. I'm unaware of any valid use case for enabling one but not the other.

(This doesn't fix all the documentation, yet.)

Test Plan: Edited a repository, saw only one publishing option.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13277

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

+46 -100
+2 -4
src/__phutil_library_map__.php
··· 935 935 'DiffusionRefTableController' => 'applications/diffusion/controller/DiffusionRefTableController.php', 936 936 'DiffusionRefsQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionRefsQueryConduitAPIMethod.php', 937 937 'DiffusionRenameHistoryQuery' => 'applications/diffusion/query/DiffusionRenameHistoryQuery.php', 938 - 'DiffusionRepositoryActionsManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryActionsManagementPanel.php', 939 938 'DiffusionRepositoryAutomationManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryAutomationManagementPanel.php', 940 939 'DiffusionRepositoryBasicsManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php', 941 940 'DiffusionRepositoryBranchesManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php', ··· 970 969 'DiffusionRepositoryPath' => 'applications/diffusion/data/DiffusionRepositoryPath.php', 971 970 'DiffusionRepositoryPoliciesManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryPoliciesManagementPanel.php', 972 971 'DiffusionRepositoryProfilePictureController' => 'applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php', 972 + 'DiffusionRepositoryPublishingManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryPublishingManagementPanel.php', 973 973 'DiffusionRepositoryRef' => 'applications/diffusion/data/DiffusionRepositoryRef.php', 974 974 'DiffusionRepositoryRemarkupRule' => 'applications/diffusion/remarkup/DiffusionRepositoryRemarkupRule.php', 975 975 'DiffusionRepositorySearchConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionRepositorySearchConduitAPIMethod.php', ··· 4322 4322 'PhabricatorRepositoryActivateTransaction' => 'applications/repository/xaction/PhabricatorRepositoryActivateTransaction.php', 4323 4323 'PhabricatorRepositoryAuditRequest' => 'applications/repository/storage/PhabricatorRepositoryAuditRequest.php', 4324 4324 'PhabricatorRepositoryAutocloseOnlyTransaction' => 'applications/repository/xaction/PhabricatorRepositoryAutocloseOnlyTransaction.php', 4325 - 'PhabricatorRepositoryAutocloseTransaction' => 'applications/repository/xaction/PhabricatorRepositoryAutocloseTransaction.php', 4326 4325 'PhabricatorRepositoryBlueprintsTransaction' => 'applications/repository/xaction/PhabricatorRepositoryBlueprintsTransaction.php', 4327 4326 'PhabricatorRepositoryBranch' => 'applications/repository/storage/PhabricatorRepositoryBranch.php', 4328 4327 'PhabricatorRepositoryCallsignTransaction' => 'applications/repository/xaction/PhabricatorRepositoryCallsignTransaction.php', ··· 6588 6587 'DiffusionRefTableController' => 'DiffusionController', 6589 6588 'DiffusionRefsQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod', 6590 6589 'DiffusionRenameHistoryQuery' => 'Phobject', 6591 - 'DiffusionRepositoryActionsManagementPanel' => 'DiffusionRepositoryManagementPanel', 6592 6590 'DiffusionRepositoryAutomationManagementPanel' => 'DiffusionRepositoryManagementPanel', 6593 6591 'DiffusionRepositoryBasicsManagementPanel' => 'DiffusionRepositoryManagementPanel', 6594 6592 'DiffusionRepositoryBranchesManagementPanel' => 'DiffusionRepositoryManagementPanel', ··· 6622 6620 'DiffusionRepositoryPath' => 'Phobject', 6623 6621 'DiffusionRepositoryPoliciesManagementPanel' => 'DiffusionRepositoryManagementPanel', 6624 6622 'DiffusionRepositoryProfilePictureController' => 'DiffusionController', 6623 + 'DiffusionRepositoryPublishingManagementPanel' => 'DiffusionRepositoryManagementPanel', 6625 6624 'DiffusionRepositoryRef' => 'Phobject', 6626 6625 'DiffusionRepositoryRemarkupRule' => 'PhabricatorObjectRemarkupRule', 6627 6626 'DiffusionRepositorySearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', ··· 10555 10554 'PhabricatorPolicyInterface', 10556 10555 ), 10557 10556 'PhabricatorRepositoryAutocloseOnlyTransaction' => 'PhabricatorRepositoryTransactionType', 10558 - 'PhabricatorRepositoryAutocloseTransaction' => 'PhabricatorRepositoryTransactionType', 10559 10557 'PhabricatorRepositoryBlueprintsTransaction' => 'PhabricatorRepositoryTransactionType', 10560 10558 'PhabricatorRepositoryBranch' => 'PhabricatorRepositoryDAO', 10561 10559 'PhabricatorRepositoryCallsignTransaction' => 'PhabricatorRepositoryTransactionType',
+2 -2
src/applications/diffusion/editor/DiffusionCommitEditEngine.php
··· 120 120 $desc = pht('No, Repository Importing'); 121 121 break; 122 122 case PhabricatorRepository::BECAUSE_AUTOCLOSE_DISABLED: 123 - $desc = pht('No, Autoclose Disabled'); 123 + $desc = pht('No, Repository Publishing Disabled'); 124 124 break; 125 125 case PhabricatorRepository::BECAUSE_NOT_ON_AUTOCLOSE_BRANCH: 126 - $desc = pht('No, Not On Autoclose Branch'); 126 + $desc = pht('No, Not Reachable from Permanent Ref'); 127 127 break; 128 128 case PhabricatorRepository::BECAUSE_AUTOCLOSE_FORCED: 129 129 $desc = pht('Yes, Forced Via bin/repository CLI Tool.');
+1 -14
src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php
··· 468 468 ->setDescription(pht('Configure how changes are published.')) 469 469 ->setConduitDescription(pht('Change publishing options.')) 470 470 ->setConduitTypeDescription(pht('New notification setting.')) 471 - ->setValue(!$object->getDetail('herald-disabled')), 472 - id(new PhabricatorBoolEditField()) 473 - ->setKey('autoclose') 474 - ->setLabel(pht('Autoclose')) 475 - ->setTransactionType( 476 - PhabricatorRepositoryAutocloseTransaction::TRANSACTIONTYPE) 477 - ->setIsCopyable(true) 478 - ->setOptions( 479 - pht('Disable Autoclose'), 480 - pht('Enable Autoclose')) 481 - ->setDescription(pht('Stop or resume autoclosing in this repository.')) 482 - ->setConduitDescription(pht('Change autoclose setting.')) 483 - ->setConduitTypeDescription(pht('New autoclose setting.')) 484 - ->setValue(!$object->getDetail('disable-autoclose')), 471 + ->setValue(!$object->isPublishingDisabled()), 485 472 id(new PhabricatorPolicyEditField()) 486 473 ->setKey('policy.push') 487 474 ->setLabel(pht('Push Policy'))
+10 -22
src/applications/diffusion/management/DiffusionRepositoryActionsManagementPanel.php src/applications/diffusion/management/DiffusionRepositoryPublishingManagementPanel.php
··· 1 1 <?php 2 2 3 - final class DiffusionRepositoryActionsManagementPanel 3 + final class DiffusionRepositoryPublishingManagementPanel 4 4 extends DiffusionRepositoryManagementPanel { 5 5 6 - const PANELKEY = 'actions'; 6 + const PANELKEY = 'publishing'; 7 7 8 8 public function getManagementPanelLabel() { 9 - return pht('Actions'); 9 + return pht('Publishing'); 10 10 } 11 11 12 12 public function getManagementPanelOrder() { ··· 16 16 public function getManagementPanelIcon() { 17 17 $repository = $this->getRepository(); 18 18 19 - $has_any = 20 - $repository->getDetail('herald-disabled') || 21 - $repository->getDetail('disable-autoclose'); 22 - 23 - // NOTE: Any value here really means something is disabled, so try to 24 - // hint that a little bit with the icon. 19 + $has_any = $repository->isPublishingDisabled(); 25 20 26 21 if ($has_any) { 27 22 return 'fa-flash'; ··· 33 28 protected function getEditEngineFieldKeys() { 34 29 return array( 35 30 'publish', 36 - 'autoclose', 37 31 ); 38 32 } 39 33 ··· 47 41 $repository, 48 42 PhabricatorPolicyCapability::CAN_EDIT); 49 43 50 - $actions_uri = $this->getEditPageURI(); 44 + $publishing_uri = $this->getEditPageURI(); 51 45 52 46 $action_list->addAction( 53 47 id(new PhabricatorActionView()) 54 48 ->setIcon('fa-pencil') 55 - ->setName(pht('Edit Actions')) 56 - ->setHref($actions_uri) 49 + ->setName(pht('Edit Publishing')) 50 + ->setHref($publishing_uri) 57 51 ->setDisabled(!$can_edit) 58 52 ->setWorkflow(!$can_edit)); 59 53 ··· 68 62 $view = id(new PHUIPropertyListView()) 69 63 ->setViewer($viewer); 70 64 71 - $notify = $repository->getDetail('herald-disabled') 65 + $notify = $repository->isPublishingDisabled() 72 66 ? pht('Off') 73 67 : pht('On'); 74 68 $notify = phutil_tag('em', array(), $notify); 75 - $view->addProperty(pht('Publish/Notify'), $notify); 76 - 77 - $autoclose = $repository->getDetail('disable-autoclose') 78 - ? pht('Off') 79 - : pht('On'); 80 - $autoclose = phutil_tag('em', array(), $autoclose); 81 - $view->addProperty(pht('Autoclose'), $autoclose); 69 + $view->addProperty(pht('Publishing'), $notify); 82 70 83 - return $this->newBox(pht('Actions'), $view); 71 + return $this->newBox(pht('Publishing'), $view); 84 72 } 85 73 86 74 }
+20 -17
src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
··· 96 96 phutil_tag('em', array(), pht('Track All Branches'))); 97 97 $view->addProperty(pht('Track Only'), $track_only); 98 98 99 - $autoclose_rules = $repository->getAutocloseOnlyRules(); 100 - $autoclose_rules = implode(', ', $autoclose_rules); 101 - $autoclose_only = nonempty( 102 - $autoclose_rules, 103 - phutil_tag('em', array(), pht('All Branches'))); 104 99 105 - $autoclose_disabled = false; 106 - if ($repository->getDetail('disable-autoclose')) { 107 - $autoclose_disabled = true; 108 - $autoclose_only = 109 - phutil_tag('em', array(), pht('Autoclose has been disabled')); 100 + $publishing_disabled = $repository->isPublishingDisabled(); 101 + if ($publishing_disabled) { 102 + $permanent_display = 103 + phutil_tag('em', array(), pht('Publishing Disabled')); 104 + } else { 105 + $permanent_rules = $repository->getAutocloseOnlyRules(); 106 + if ($permanent_rules) { 107 + $permanent_display = implode(', ', $permanent_rules); 108 + } else { 109 + $permanent_display = phutil_tag('em', array(), pht('All Branches')); 110 + } 110 111 } 111 - 112 - $view->addProperty(pht('Permanent Refs'), $autoclose_only); 112 + $view->addProperty(pht('Permanent Refs'), $permanent_display); 113 113 114 114 $content[] = $this->newBox(pht('Branches'), $view); 115 115 116 - // Branch Autoclose Table 117 116 if (!$repository->isImporting()) { 118 117 $request = $this->getRequest(); 119 118 $pager = id(new PHUIPagerView()) ··· 153 152 $status = pht('Open'); 154 153 } 155 154 156 - if ($autoclose_disabled) { 157 - $autoclose_status = pht('Disabled (Repository)'); 155 + if ($publishing_disabled) { 156 + $permanent_status = pht('Publishing Disabled'); 158 157 } else { 159 - $autoclose_status = pht('Not Permanent'); 158 + if ($permanent) { 159 + $permanent_status = pht('Permanent'); 160 + } else { 161 + $permanent_status = pht('Not Permanent'); 162 + } 160 163 } 161 164 162 165 $rows[] = array( ··· 164 167 $branch_name, 165 168 $status, 166 169 $tracking ? pht('Tracking') : pht('Off'), 167 - $permanent ? pht('Permanent') : $autoclose_status, 170 + $permanent_status, 168 171 ); 169 172 } 170 173 $branch_table = new AphrontTableView($rows);
+3 -3
src/applications/diffusion/view/DiffusionBranchTableView.php
··· 60 60 break; 61 61 case PhabricatorRepository::BECAUSE_AUTOCLOSE_DISABLED: 62 62 $icon = 'fa-times bluegrey'; 63 - $tip = pht('Repository Autoclose Disabled'); 63 + $tip = pht('Repository Publishing Disabled'); 64 64 break; 65 65 case PhabricatorRepository::BECAUSE_BRANCH_UNTRACKED: 66 66 $icon = 'fa-times bluegrey'; ··· 68 68 break; 69 69 case PhabricatorRepository::BECAUSE_BRANCH_NOT_AUTOCLOSE: 70 70 $icon = 'fa-times bluegrey'; 71 - $tip = pht('Branch Autoclose Disabled'); 71 + $tip = pht('Branch Not Permanent'); 72 72 break; 73 73 case null: 74 74 $icon = 'fa-check bluegrey'; 75 - $tip = pht('Autoclose Enabled'); 75 + $tip = pht('Permanent Branch'); 76 76 break; 77 77 default: 78 78 $icon = 'fa-question';
+6 -2
src/applications/repository/storage/PhabricatorRepository.php
··· 1048 1048 return false; 1049 1049 } 1050 1050 1051 - if ($this->getDetail('herald-disabled')) { 1051 + if ($this->isPublishingDisabled()) { 1052 1052 return false; 1053 1053 } 1054 1054 1055 1055 return true; 1056 + } 1057 + 1058 + public function isPublishingDisabled() { 1059 + return $this->getDetail('herald-disabled'); 1056 1060 } 1057 1061 1058 1062 public function shouldPublishCommit(PhabricatorRepositoryCommit $commit) { ··· 1186 1190 return self::BECAUSE_REPOSITORY_IMPORTING; 1187 1191 } 1188 1192 1189 - if ($this->getDetail('disable-autoclose', false)) { 1193 + if ($this->isPublishingDisabled()) { 1190 1194 return self::BECAUSE_AUTOCLOSE_DISABLED; 1191 1195 } 1192 1196
-34
src/applications/repository/xaction/PhabricatorRepositoryAutocloseTransaction.php
··· 1 - <?php 2 - 3 - final class PhabricatorRepositoryAutocloseTransaction 4 - extends PhabricatorRepositoryTransactionType { 5 - 6 - const TRANSACTIONTYPE = 'repo:autoclose'; 7 - 8 - public function generateOldValue($object) { 9 - return (int)!$object->getDetail('disable-autoclose'); 10 - } 11 - 12 - public function generateNewValue($object, $value) { 13 - return (int)$value; 14 - } 15 - 16 - public function applyInternalEffects($object, $value) { 17 - $object->setDetail('disable-autoclose', (int)!$value); 18 - } 19 - 20 - public function getTitle() { 21 - $new = $this->getNewValue(); 22 - 23 - if ($new) { 24 - return pht( 25 - '%s enabled autoclose for this repository.', 26 - $this->renderAuthor()); 27 - } else { 28 - return pht( 29 - '%s disabled autoclose for this repository.', 30 - $this->renderAuthor()); 31 - } 32 - } 33 - 34 - }
+2 -2
src/applications/repository/xaction/PhabricatorRepositoryNotifyTransaction.php
··· 22 22 23 23 if ($new) { 24 24 return pht( 25 - '%s enabled notifications and publishing for this repository.', 25 + '%s enabled publishing for this repository.', 26 26 $this->renderAuthor()); 27 27 } else { 28 28 return pht( 29 - '%s disabled notifications and publishing for this repository.', 29 + '%s disabled publishing for this repository.', 30 30 $this->renderAuthor()); 31 31 } 32 32 }