mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-02 02:40:58 +01:00
Don't allow "autoclose only" to be set in Mercurial
Summary: We don't actually support this yet, so hide the configuration. Test Plan: Edited branches for an hg repo. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7563
This commit is contained in:
parent
d4eca25774
commit
62794e4494
1 changed files with 22 additions and 10 deletions
|
@ -22,9 +22,15 @@ final class DiffusionRepositoryEditBranchesController
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$is_git = false;
|
||||||
|
$is_hg = false;
|
||||||
|
|
||||||
switch ($repository->getVersionControlSystem()) {
|
switch ($repository->getVersionControlSystem()) {
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
||||||
|
$is_git = true;
|
||||||
|
break;
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
||||||
|
$is_hg = true;
|
||||||
break;
|
break;
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
|
@ -64,9 +70,11 @@ final class DiffusionRepositoryEditBranchesController
|
||||||
->setTransactionType($type_track)
|
->setTransactionType($type_track)
|
||||||
->setNewValue($v_track);
|
->setNewValue($v_track);
|
||||||
|
|
||||||
|
if (!$is_hg) {
|
||||||
$xactions[] = id(clone $template)
|
$xactions[] = id(clone $template)
|
||||||
->setTransactionType($type_autoclose)
|
->setTransactionType($type_autoclose)
|
||||||
->setNewValue($v_autoclose);
|
->setNewValue($v_autoclose);
|
||||||
|
}
|
||||||
|
|
||||||
id(new PhabricatorRepositoryEditor())
|
id(new PhabricatorRepositoryEditor())
|
||||||
->setContinueOnNoEffect(true)
|
->setContinueOnNoEffect(true)
|
||||||
|
@ -119,15 +127,19 @@ final class DiffusionRepositoryEditBranchesController
|
||||||
->setLabel(pht('Track Only'))
|
->setLabel(pht('Track Only'))
|
||||||
->setValue($v_track)
|
->setValue($v_track)
|
||||||
->setCaption(
|
->setCaption(
|
||||||
pht('Example: %s', phutil_tag('tt', array(), 'master, develop'))))
|
pht('Example: %s', phutil_tag('tt', array(), 'master, develop'))));
|
||||||
->appendChild(
|
|
||||||
|
if (!$is_hg) {
|
||||||
|
$form->appendChild(
|
||||||
id(new AphrontFormTextControl())
|
id(new AphrontFormTextControl())
|
||||||
->setName('autoclose')
|
->setName('autoclose')
|
||||||
->setLabel(pht('Autoclose Only'))
|
->setLabel(pht('Autoclose Only'))
|
||||||
->setValue($v_autoclose)
|
->setValue($v_autoclose)
|
||||||
->setCaption(
|
->setCaption(
|
||||||
pht('Example: %s', phutil_tag('tt', array(), 'master, release'))))
|
pht('Example: %s', phutil_tag('tt', array(), 'master, release'))));
|
||||||
->appendChild(
|
}
|
||||||
|
|
||||||
|
$form->appendChild(
|
||||||
id(new AphrontFormSubmitControl())
|
id(new AphrontFormSubmitControl())
|
||||||
->setValue(pht('Save Branches'))
|
->setValue(pht('Save Branches'))
|
||||||
->addCancelButton($edit_uri));
|
->addCancelButton($edit_uri));
|
||||||
|
|
Loading…
Reference in a new issue