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

Preserve "Autoclose?" information on new Commit edit flow

Summary: Ref T10978. The current "Edit" flow has some autoclose info. This isn't necessarily the best place to put it in the long run, but preseve it for now since the documentation refers to it.

Test Plan: {F2340658}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10978

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

+44 -2
+44 -2
src/applications/diffusion/editor/DiffusionCommitEditEngine.php
··· 30 30 } 31 31 32 32 protected function newObjectQuery() { 33 - return new DiffusionCommitQuery(); 33 + return id(new DiffusionCommitQuery()) 34 + ->needCommitData(true); 34 35 } 35 36 36 37 protected function getObjectCreateTitleText($object) { ··· 63 64 64 65 protected function buildCustomEditFields($object) { 65 66 $viewer = $this->getViewer(); 67 + $data = $object->getCommitData(); 68 + 69 + $fields = array(); 66 70 67 - return array(); 71 + $reason = $data->getCommitDetail('autocloseReason', false); 72 + $reason = PhabricatorRepository::BECAUSE_AUTOCLOSE_FORCED; 73 + if ($reason !== false) { 74 + switch ($reason) { 75 + case PhabricatorRepository::BECAUSE_REPOSITORY_IMPORTING: 76 + $desc = pht('No, Repository Importing'); 77 + break; 78 + case PhabricatorRepository::BECAUSE_AUTOCLOSE_DISABLED: 79 + $desc = pht('No, Autoclose Disabled'); 80 + break; 81 + case PhabricatorRepository::BECAUSE_NOT_ON_AUTOCLOSE_BRANCH: 82 + $desc = pht('No, Not On Autoclose Branch'); 83 + break; 84 + case PhabricatorRepository::BECAUSE_AUTOCLOSE_FORCED: 85 + $desc = pht('Yes, Forced Via bin/repository CLI Tool.'); 86 + break; 87 + case null: 88 + $desc = pht('Yes'); 89 + break; 90 + default: 91 + $desc = pht('Unknown'); 92 + break; 93 + } 94 + 95 + $doc_href = PhabricatorEnv::getDoclink('Diffusion User Guide: Autoclose'); 96 + $doc_link = phutil_tag( 97 + 'a', 98 + array( 99 + 'href' => $doc_href, 100 + 'target' => '_blank', 101 + ), 102 + pht('Learn More')); 103 + 104 + $fields[] = id(new PhabricatorStaticEditField()) 105 + ->setLabel(pht('Autoclose?')) 106 + ->setValue(array($desc, " \xC2\xB7 ", $doc_link)); 107 + } 108 + 109 + return $fields; 68 110 } 69 111 70 112 }