Commit 5e073588 authored by epriestley's avatar epriestley
Browse files

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:
parent a27c824d
......@@ -30,7 +30,8 @@ final class DiffusionCommitEditEngine
protected function newObjectQuery() {
return new DiffusionCommitQuery();
return id(new DiffusionCommitQuery())
protected function getObjectCreateTitleText($object) {
......@@ -63,8 +64,49 @@ final class DiffusionCommitEditEngine
protected function buildCustomEditFields($object) {
$viewer = $this->getViewer();
return array();
$data = $object->getCommitData();
$fields = array();
$reason = $data->getCommitDetail('autocloseReason', false);
$reason = PhabricatorRepository::BECAUSE_AUTOCLOSE_FORCED;
if ($reason !== false) {
switch ($reason) {
case PhabricatorRepository::BECAUSE_REPOSITORY_IMPORTING:
$desc = pht('No, Repository Importing');
case PhabricatorRepository::BECAUSE_AUTOCLOSE_DISABLED:
$desc = pht('No, Autoclose Disabled');
case PhabricatorRepository::BECAUSE_NOT_ON_AUTOCLOSE_BRANCH:
$desc = pht('No, Not On Autoclose Branch');
case PhabricatorRepository::BECAUSE_AUTOCLOSE_FORCED:
$desc = pht('Yes, Forced Via bin/repository CLI Tool.');
case null:
$desc = pht('Yes');
$desc = pht('Unknown');
$doc_href = PhabricatorEnv::getDoclink('Diffusion User Guide: Autoclose');
$doc_link = phutil_tag(
'href' => $doc_href,
'target' => '_blank',
pht('Learn More'));
$fields[] = id(new PhabricatorStaticEditField())
->setValue(array($desc, " \xC2\xB7 ", $doc_link));
return $fields;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment