Add a setting to blanket-disable autoclosing revisions in a repository
Summary: For git workflows where developers push personal feature branches to the origin, this is a quick workaround until T1210 is implemented properly. I'll also mention this in D2446. Test Plan: - Committed a revision in an "autoclose" repository; it was autoclosed. Committed a revision in a no-autoclose repository, it was not autoclosed. - Edited repositories, saving the "autoclose" setting as enabled/disabled. Reviewers: aurelijus, btrahan Reviewed By: aurelijus CC: aran Maniphest Tasks: T1210 Differential Revision: https://secure.phabricator.com/D2448
This commit is contained in:
parent
d24c81c5e2
commit
61b728b19d
|
@ -248,6 +248,10 @@ final class PhabricatorRepositoryEditController
|
||||||
$repository->setDetail('branch-filter', $branch_filter);
|
$repository->setDetail('branch-filter', $branch_filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$repository->setDetail(
|
||||||
|
'disable-autoclose',
|
||||||
|
$request->getStr('autoclose') == 'disabled' ? true : false);
|
||||||
|
|
||||||
$repository->setDetail(
|
$repository->setDetail(
|
||||||
'pull-frequency',
|
'pull-frequency',
|
||||||
max(1, $request->getInt('frequency')));
|
max(1, $request->getInt('frequency')));
|
||||||
|
@ -606,6 +610,22 @@ final class PhabricatorRepositoryEditController
|
||||||
'Default branch to show in Diffusion.'));
|
'Default branch to show in Diffusion.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$inset
|
||||||
|
->appendChild(id(new AphrontFormSelectControl())
|
||||||
|
->setName('autoclose')
|
||||||
|
->setLabel('Autoclose')
|
||||||
|
->setOptions(array(
|
||||||
|
'enabled' => 'Enabled: Automatically Close Pushed Revisions',
|
||||||
|
'disabled' => 'Disabled: Ignore Pushed Revisions',
|
||||||
|
))
|
||||||
|
->setCaption(
|
||||||
|
"Automatically close Differential revisions which are pushed to ".
|
||||||
|
"this repository.")
|
||||||
|
->setValue(
|
||||||
|
$repository->getDetail('disable-autoclose', false)
|
||||||
|
? 'disabled'
|
||||||
|
: 'enabled'));
|
||||||
|
|
||||||
$inset
|
$inset
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextControl())
|
id(new AphrontFormTextControl())
|
||||||
|
|
|
@ -93,9 +93,11 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
|
||||||
$revision->getID(),
|
$revision->getID(),
|
||||||
$commit->getPHID());
|
$commit->getPHID());
|
||||||
|
|
||||||
if ($revision->getStatus() !=
|
$status_closed = ArcanistDifferentialRevisionStatus::CLOSED;
|
||||||
ArcanistDifferentialRevisionStatus::CLOSED) {
|
$should_close = ($revision->getStatus() != $status_closed) &&
|
||||||
|
(!$repository->getDetail('disable-autoclose', false));
|
||||||
|
|
||||||
|
if ($should_close) {
|
||||||
$revision->setDateCommitted($commit->getEpoch());
|
$revision->setDateCommitted($commit->getEpoch());
|
||||||
|
|
||||||
$message = null;
|
$message = null;
|
||||||
|
|
Loading…
Reference in a new issue