From 6449a0ecb2da06b954a0346460e2c1e906b737f2 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 15 Apr 2019 12:18:46 -0700 Subject: [PATCH] Rename some internal "Autoclose" mentions to "Permanent Refs" Summary: Depends on D20428. Ref T13277. Test Plan: Grep / reading. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13277 Differential Revision: https://secure.phabricator.com/D20432 --- src/__phutil_library_map__.php | 4 ++-- .../diffusion/editor/DiffusionRepositoryEditEngine.php | 4 ++-- .../DiffusionRepositoryBranchesManagementPanel.php | 4 ++-- .../repository/storage/PhabricatorRepository.php | 6 +++--- ...hp => PhabricatorRepositoryPermanentRefsTransaction.php} | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) rename src/applications/repository/xaction/{PhabricatorRepositoryAutocloseOnlyTransaction.php => PhabricatorRepositoryPermanentRefsTransaction.php} (87%) diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 16d63d153d..180728e0fb 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -4321,7 +4321,6 @@ phutil_register_library_map(array( 'PhabricatorRepository' => 'applications/repository/storage/PhabricatorRepository.php', 'PhabricatorRepositoryActivateTransaction' => 'applications/repository/xaction/PhabricatorRepositoryActivateTransaction.php', 'PhabricatorRepositoryAuditRequest' => 'applications/repository/storage/PhabricatorRepositoryAuditRequest.php', - 'PhabricatorRepositoryAutocloseOnlyTransaction' => 'applications/repository/xaction/PhabricatorRepositoryAutocloseOnlyTransaction.php', 'PhabricatorRepositoryBlueprintsTransaction' => 'applications/repository/xaction/PhabricatorRepositoryBlueprintsTransaction.php', 'PhabricatorRepositoryBranch' => 'applications/repository/storage/PhabricatorRepositoryBranch.php', 'PhabricatorRepositoryCallsignTransaction' => 'applications/repository/xaction/PhabricatorRepositoryCallsignTransaction.php', @@ -4397,6 +4396,7 @@ phutil_register_library_map(array( 'PhabricatorRepositoryNotifyTransaction' => 'applications/repository/xaction/PhabricatorRepositoryNotifyTransaction.php', 'PhabricatorRepositoryOldRef' => 'applications/repository/storage/PhabricatorRepositoryOldRef.php', 'PhabricatorRepositoryParsedChange' => 'applications/repository/data/PhabricatorRepositoryParsedChange.php', + 'PhabricatorRepositoryPermanentRefsTransaction' => 'applications/repository/xaction/PhabricatorRepositoryPermanentRefsTransaction.php', 'PhabricatorRepositoryPullEngine' => 'applications/repository/engine/PhabricatorRepositoryPullEngine.php', 'PhabricatorRepositoryPullEvent' => 'applications/repository/storage/PhabricatorRepositoryPullEvent.php', 'PhabricatorRepositoryPullEventPHIDType' => 'applications/repository/phid/PhabricatorRepositoryPullEventPHIDType.php', @@ -10553,7 +10553,6 @@ phutil_register_library_map(array( 'PhabricatorRepositoryDAO', 'PhabricatorPolicyInterface', ), - 'PhabricatorRepositoryAutocloseOnlyTransaction' => 'PhabricatorRepositoryTransactionType', 'PhabricatorRepositoryBlueprintsTransaction' => 'PhabricatorRepositoryTransactionType', 'PhabricatorRepositoryBranch' => 'PhabricatorRepositoryDAO', 'PhabricatorRepositoryCallsignTransaction' => 'PhabricatorRepositoryTransactionType', @@ -10661,6 +10660,7 @@ phutil_register_library_map(array( 'PhabricatorPolicyInterface', ), 'PhabricatorRepositoryParsedChange' => 'Phobject', + 'PhabricatorRepositoryPermanentRefsTransaction' => 'PhabricatorRepositoryTransactionType', 'PhabricatorRepositoryPullEngine' => 'PhabricatorRepositoryEngine', 'PhabricatorRepositoryPullEvent' => array( 'PhabricatorRepositoryDAO', diff --git a/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php b/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php index 65fbe35a8f..688d78fcc5 100644 --- a/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php +++ b/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php @@ -214,7 +214,7 @@ final class DiffusionRepositoryEditEngine $fetch_value = $object->getFetchRules(); $track_value = $object->getTrackOnlyRules(); - $permanent_value = $object->getAutocloseOnlyRules(); + $permanent_value = $object->getPermanentRefRules(); $automation_instructions = pht( "Configure **Repository Automation** to allow Phabricator to ". @@ -392,7 +392,7 @@ final class DiffusionRepositoryEditEngine ->setKey('permanentRefs') ->setLabel(pht('Permanent Refs')) ->setTransactionType( - PhabricatorRepositoryAutocloseOnlyTransaction::TRANSACTIONTYPE) + PhabricatorRepositoryPermanentRefsTransaction::TRANSACTIONTYPE) ->setIsCopyable(true) ->setDescription(pht('Only these refs are considered permanent.')) ->setConduitDescription(pht('Set the permanent refs.')) diff --git a/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php index 124766e13d..dbb1b1ed3a 100644 --- a/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php +++ b/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php @@ -24,7 +24,7 @@ final class DiffusionRepositoryBranchesManagementPanel $has_any = $repository->getDetail('default-branch') || $repository->getTrackOnlyRules() || - $repository->getAutocloseOnlyRules(); + $repository->getPermanentRefRules(); if ($has_any) { return 'fa-code-fork'; @@ -102,7 +102,7 @@ final class DiffusionRepositoryBranchesManagementPanel $permanent_display = phutil_tag('em', array(), pht('Publishing Disabled')); } else { - $permanent_rules = $repository->getAutocloseOnlyRules(); + $permanent_rules = $repository->getPermanentRefRules(); if ($permanent_rules) { $permanent_display = implode(', ', $permanent_rules); } else { diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php index 5fed41db83..9d76271369 100644 --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -1197,11 +1197,11 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO return null; } - public function getAutocloseOnlyRules() { + public function getPermanentRefRules() { return array_keys($this->getDetail('close-commits-filter', array())); } - public function setAutocloseOnlyRules(array $rules) { + public function setPermanentRefRules(array $rules) { $rules = array_fill_keys($rules, true); $this->setDetail('close-commits-filter', $rules); return $this; @@ -2846,7 +2846,7 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO public function getFieldValuesForConduit() { $fetch_rules = $this->getFetchRules(); $track_rules = $this->getTrackOnlyRules(); - $permanent_rules = $this->getAutocloseOnlyRules(); + $permanent_rules = $this->getPermanentRefRules(); $fetch_rules = $this->getStringListForConduit($fetch_rules); $track_rules = $this->getStringListForConduit($track_rules); diff --git a/src/applications/repository/xaction/PhabricatorRepositoryAutocloseOnlyTransaction.php b/src/applications/repository/xaction/PhabricatorRepositoryPermanentRefsTransaction.php similarity index 87% rename from src/applications/repository/xaction/PhabricatorRepositoryAutocloseOnlyTransaction.php rename to src/applications/repository/xaction/PhabricatorRepositoryPermanentRefsTransaction.php index 6e41c319d9..345a9092f0 100644 --- a/src/applications/repository/xaction/PhabricatorRepositoryAutocloseOnlyTransaction.php +++ b/src/applications/repository/xaction/PhabricatorRepositoryPermanentRefsTransaction.php @@ -1,16 +1,16 @@ getAutocloseOnlyRules(); + return $object->getPermanentRefRules(); } public function applyInternalEffects($object, $value) { - $object->setAutocloseOnlyRules($value); + $object->setPermanentRefRules($value); } public function getTitle() {