From c7b2553ca084147f416a4893abed807a01df8839 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 14 Apr 2019 13:20:23 -0700 Subject: [PATCH] Rename most user-facing "Autoclose" strings to "Permanent Refs" Summary: Depends on D20422. Ref T13277. Currently, "track only", "publish", and "autoclose" are three separate ideas. I'd like to generally merge them into a more natural idea called "permanent refs". Since "Autoclose" effectively now controls both "autoclose" and "publish", rename it. This doesn't rename all the methods or internals, and the documentation needs an update, but it renames most of the UI-facing stuff. (You also can only specify branches as "Permanent Refs" today, but we may let you specify tags and other arbitrary refs in the future.) Test Plan: Grepped, poked around the UI, saw UI show "Permanent" / "Permanent Refs" more often and "Autoclose" less. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13277 Differential Revision: https://secure.phabricator.com/D20423 --- .../editor/DiffusionRepositoryEditEngine.php | 14 ++++++------- .../DiffusionCommitAutocloseHeraldField.php | 2 +- ...usionRepositoryBranchesManagementPanel.php | 20 ++++++++++--------- ...atorRepositoryAutocloseOnlyTransaction.php | 6 +++--- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php b/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php index b4bb587cda..cd05b1ca27 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(); - $autoclose_value = $object->getAutocloseOnlyRules(); + $permanent_value = $object->getAutocloseOnlyRules(); $automation_instructions = pht( "Configure **Repository Automation** to allow Phabricator to ". @@ -389,15 +389,15 @@ final class DiffusionRepositoryEditEngine ->setValue($track_value), id(new PhabricatorTextAreaEditField()) ->setIsStringList(true) - ->setKey('autocloseOnly') - ->setLabel(pht('Autoclose Only')) + ->setKey('permanentRefs') + ->setLabel(pht('Permanent Refs')) ->setTransactionType( PhabricatorRepositoryAutocloseOnlyTransaction::TRANSACTIONTYPE) ->setIsCopyable(true) - ->setDescription(pht('Autoclose commits on only these branches.')) - ->setConduitDescription(pht('Set the autoclose branches.')) - ->setConduitTypeDescription(pht('New default tracked branches.')) - ->setValue($autoclose_value), + ->setDescription(pht('Only these refs are considered permanent.')) + ->setConduitDescription(pht('Set the permanent refs.')) + ->setConduitTypeDescription(pht('New permanent ref rules.')) + ->setValue($permanent_value), id(new PhabricatorTextEditField()) ->setKey('importOnly') ->setLabel(pht('Import Only')) diff --git a/src/applications/diffusion/herald/DiffusionCommitAutocloseHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitAutocloseHeraldField.php index 674b023582..c620b18778 100644 --- a/src/applications/diffusion/herald/DiffusionCommitAutocloseHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitAutocloseHeraldField.php @@ -6,7 +6,7 @@ final class DiffusionCommitAutocloseHeraldField const FIELDCONST = 'diffusion.commit.autoclose'; public function getHeraldFieldName() { - return pht('Commit is on autoclose branch'); + return pht('Commit is on permanent branch'); } public function getHeraldFieldValue($object) { diff --git a/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php index 708263ae93..80faeb481b 100644 --- a/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php +++ b/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php @@ -38,7 +38,7 @@ final class DiffusionRepositoryBranchesManagementPanel 'defaultBranch', 'fetchRefs', 'trackOnly', - 'autocloseOnly', + 'permanentRefs', ); } @@ -100,7 +100,7 @@ final class DiffusionRepositoryBranchesManagementPanel $autoclose_rules = implode(', ', $autoclose_rules); $autoclose_only = nonempty( $autoclose_rules, - phutil_tag('em', array(), pht('Autoclose On All Branches'))); + phutil_tag('em', array(), pht('All Branches'))); $autoclose_disabled = false; if ($repository->getDetail('disable-autoclose')) { @@ -109,7 +109,7 @@ final class DiffusionRepositoryBranchesManagementPanel phutil_tag('em', array(), pht('Autoclose has been disabled')); } - $view->addProperty(pht('Autoclose Only'), $autoclose_only); + $view->addProperty(pht('Permanent Refs'), $autoclose_only); $content[] = $this->newBox(pht('Branches'), $view); @@ -136,7 +136,7 @@ final class DiffusionRepositoryBranchesManagementPanel foreach ($branches as $branch) { $branch_name = $branch->getShortName(); $tracking = $repository->shouldTrackBranch($branch_name); - $autoclosing = $repository->shouldAutocloseBranch($branch_name); + $permanent = $repository->shouldAutocloseBranch($branch_name); $default = $repository->getDefaultBranch(); $icon = null; @@ -156,7 +156,7 @@ final class DiffusionRepositoryBranchesManagementPanel if ($autoclose_disabled) { $autoclose_status = pht('Disabled (Repository)'); } else { - $autoclose_status = pht('Off'); + $autoclose_status = pht('Not Permanent'); } $rows[] = array( @@ -164,7 +164,7 @@ final class DiffusionRepositoryBranchesManagementPanel $branch_name, $status, $tracking ? pht('Tracking') : pht('Off'), - $autoclosing ? pht('Autoclose On') : $autoclose_status, + $permanent ? pht('Permanent') : $autoclose_status, ); } $branch_table = new AphrontTableView($rows); @@ -174,7 +174,7 @@ final class DiffusionRepositoryBranchesManagementPanel pht('Branch'), pht('Status'), pht('Track'), - pht('Autoclose'), + pht('Permanent'), )); $branch_table->setColumnClasses( array( @@ -199,8 +199,10 @@ final class DiffusionRepositoryBranchesManagementPanel } else { $content[] = id(new PHUIInfoView()) ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) - ->appendChild(pht('Branch status in unavailable while the repository '. - 'is still importing.')); + ->appendChild( + pht( + 'Branch status is unavailable while the repository is still '. + 'importing.')); } return $content; diff --git a/src/applications/repository/xaction/PhabricatorRepositoryAutocloseOnlyTransaction.php b/src/applications/repository/xaction/PhabricatorRepositoryAutocloseOnlyTransaction.php index 5ff17c4b05..6e41c319d9 100644 --- a/src/applications/repository/xaction/PhabricatorRepositoryAutocloseOnlyTransaction.php +++ b/src/applications/repository/xaction/PhabricatorRepositoryAutocloseOnlyTransaction.php @@ -19,16 +19,16 @@ final class PhabricatorRepositoryAutocloseOnlyTransaction if (!$new) { return pht( - '%s set this repository to autoclose on all branches.', + '%s marked all branches in this repository as permanent.', $this->renderAuthor()); } else if (!$old) { return pht( - '%s set this repository to autoclose on branches: %s.', + '%s set the permanent refs for this repository to: %s.', $this->renderAuthor(), $this->renderValue(implode(', ', $new))); } else { return pht( - '%s changed autoclose branches from %s to %s.', + '%s changed permanent refs for this repository from %s to %s.', $this->renderAuthor(), $this->renderValue(implode(', ', $old)), $this->renderValue(implode(', ', $new)));