@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+22 -10
+22 -10
src/applications/diffusion/controller/DiffusionRepositoryEditBranchesController.php
··· 22 22 return new Aphront404Response(); 23 23 } 24 24 25 + $is_git = false; 26 + $is_hg = false; 27 + 25 28 switch ($repository->getVersionControlSystem()) { 26 29 case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 30 + $is_git = true; 31 + break; 27 32 case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: 33 + $is_hg = true; 28 34 break; 29 35 case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 30 36 throw new Exception( ··· 64 70 ->setTransactionType($type_track) 65 71 ->setNewValue($v_track); 66 72 67 - $xactions[] = id(clone $template) 68 - ->setTransactionType($type_autoclose) 69 - ->setNewValue($v_autoclose); 73 + if (!$is_hg) { 74 + $xactions[] = id(clone $template) 75 + ->setTransactionType($type_autoclose) 76 + ->setNewValue($v_autoclose); 77 + } 70 78 71 79 id(new PhabricatorRepositoryEditor()) 72 80 ->setContinueOnNoEffect(true) ··· 119 127 ->setLabel(pht('Track Only')) 120 128 ->setValue($v_track) 121 129 ->setCaption( 122 - pht('Example: %s', phutil_tag('tt', array(), 'master, develop')))) 123 - ->appendChild( 130 + pht('Example: %s', phutil_tag('tt', array(), 'master, develop')))); 131 + 132 + if (!$is_hg) { 133 + $form->appendChild( 124 134 id(new AphrontFormTextControl()) 125 135 ->setName('autoclose') 126 136 ->setLabel(pht('Autoclose Only')) 127 137 ->setValue($v_autoclose) 128 138 ->setCaption( 129 - pht('Example: %s', phutil_tag('tt', array(), 'master, release')))) 130 - ->appendChild( 131 - id(new AphrontFormSubmitControl()) 132 - ->setValue(pht('Save Branches')) 133 - ->addCancelButton($edit_uri)); 139 + pht('Example: %s', phutil_tag('tt', array(), 'master, release')))); 140 + } 141 + 142 + $form->appendChild( 143 + id(new AphrontFormSubmitControl()) 144 + ->setValue(pht('Save Branches')) 145 + ->addCancelButton($edit_uri)); 134 146 135 147 $form_box = id(new PHUIObjectBoxView()) 136 148 ->setHeaderText($title)