Allow Herald to be disabled while importing a repository so we don't send a
billion zillion emails.
This commit is contained in:
@@ -240,6 +240,14 @@ class PhabricatorRepositoryEditController
|
||||
'default-owners-path',
|
||||
'/'));
|
||||
|
||||
$repository->setDetail(
|
||||
'herald-disabled',
|
||||
$request->getInt('herald-disabled', 0));
|
||||
|
||||
if ($is_svn) {
|
||||
$repository->setUUID($request->getStr('uuid'));
|
||||
}
|
||||
|
||||
$repository->setDetail(
|
||||
'detail-parser',
|
||||
$request->getStr(
|
||||
@@ -375,6 +383,21 @@ class PhabricatorRepositoryEditController
|
||||
'/'))
|
||||
->setCaption('Default path in Owners tool.'));
|
||||
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormSelectControl())
|
||||
->setName('herald-disabled')
|
||||
->setLabel('Herald Enabled')
|
||||
->setValue($repository->getDetail('herald-disabled', 0))
|
||||
->setOptions(
|
||||
array(
|
||||
0 => 'Enabled - Send Email',
|
||||
1 => 'Disabled - Do Not Send Email',
|
||||
))
|
||||
->setCaption(
|
||||
'You can temporarily disable Herald notifications when reparsing '.
|
||||
'a repository or importing a new repository.'));
|
||||
|
||||
$parsers = id(new PhutilSymbolLoader())
|
||||
->setAncestorClass('PhabricatorRepositoryCommitMessageDetailParser')
|
||||
->selectSymbolsWithoutLoading();
|
||||
@@ -395,7 +418,19 @@ class PhabricatorRepositoryEditController
|
||||
->setValue(
|
||||
$repository->getDetail(
|
||||
'detail-parser',
|
||||
'PhabricatorRepositoryDefaultCommitMessageDetailParser')))
|
||||
'PhabricatorRepositoryDefaultCommitMessageDetailParser')));
|
||||
|
||||
if ($is_svn) {
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setName('uuid')
|
||||
->setLabel('UUID')
|
||||
->setValue($repository->getUUID())
|
||||
->setCaption('Repository UUID from <tt>svn info</tt>.'));
|
||||
}
|
||||
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue('Save'));
|
||||
|
||||
@@ -16,6 +16,7 @@ phutil_require_module('phabricator', 'applications/repository/storage/repository
|
||||
phutil_require_module('phabricator', 'infrastructure/env');
|
||||
phutil_require_module('phabricator', 'view/control/table');
|
||||
phutil_require_module('phabricator', 'view/form/base');
|
||||
phutil_require_module('phabricator', 'view/form/control/select');
|
||||
phutil_require_module('phabricator', 'view/form/control/submit');
|
||||
phutil_require_module('phabricator', 'view/form/control/text');
|
||||
phutil_require_module('phabricator', 'view/form/error');
|
||||
|
||||
Reference in New Issue
Block a user