mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 13:00:56 +01:00
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
2 changed files with 24 additions and 2 deletions
|
@ -248,6 +248,10 @@ final class PhabricatorRepositoryEditController
|
|||
$repository->setDetail('branch-filter', $branch_filter);
|
||||
}
|
||||
|
||||
$repository->setDetail(
|
||||
'disable-autoclose',
|
||||
$request->getStr('autoclose') == 'disabled' ? true : false);
|
||||
|
||||
$repository->setDetail(
|
||||
'pull-frequency',
|
||||
max(1, $request->getInt('frequency')));
|
||||
|
@ -606,6 +610,22 @@ final class PhabricatorRepositoryEditController
|
|||
'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
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
|
|
|
@ -93,9 +93,11 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
|
|||
$revision->getID(),
|
||||
$commit->getPHID());
|
||||
|
||||
if ($revision->getStatus() !=
|
||||
ArcanistDifferentialRevisionStatus::CLOSED) {
|
||||
$status_closed = ArcanistDifferentialRevisionStatus::CLOSED;
|
||||
$should_close = ($revision->getStatus() != $status_closed) &&
|
||||
(!$repository->getDetail('disable-autoclose', false));
|
||||
|
||||
if ($should_close) {
|
||||
$revision->setDateCommitted($commit->getEpoch());
|
||||
|
||||
$message = null;
|
||||
|
|
Loading…
Reference in a new issue