Merge pull request !2787 from rhodecode-enterprise-ce feature/setting-to-pre-populate-branch-in-pr
Changes from branch: Feature/setting to pre populate branch in pr
This commit is contained in:
commit
2e4a6ec5d7
9 changed files with 101 additions and 8 deletions
|
|
@ -453,6 +453,9 @@ class _BaseVcsSettingsForm(formencode.Schema):
|
|||
# cache
|
||||
rhodecode_diff_cache = v.StringBoolean(if_missing=False)
|
||||
|
||||
# Pull Request settings
|
||||
rhodecode_pr_target_branch_prepopulate = v.StringBoolean(if_missing=False)
|
||||
|
||||
|
||||
def ApplicationUiSettingsForm(localizer):
|
||||
_ = localizer
|
||||
|
|
|
|||
|
|
@ -2053,13 +2053,19 @@ class PullRequestModel(BaseModel):
|
|||
workspace_id = "pr-%s" % pull_request.pull_request_id
|
||||
return workspace_id
|
||||
|
||||
def generate_repo_data(self, repo, commit_id=None, branch=None, bookmark=None, translator=None):
|
||||
def generate_repo_data(
|
||||
self, repo, commit_id=None, branch=None, bookmark=None, translator=None, prepopulate_branch=True
|
||||
):
|
||||
from rhodecode.model.repo import RepoModel
|
||||
|
||||
all_refs, selected_ref = self._get_repo_pullrequest_sources(
|
||||
repo.scm_instance(), commit_id=commit_id, branch=branch, bookmark=bookmark, translator=translator
|
||||
)
|
||||
|
||||
# If branch pre-population is disabled, don't auto-select any branch
|
||||
if not prepopulate_branch:
|
||||
selected_ref = None
|
||||
|
||||
refs_select2 = []
|
||||
for element in all_refs:
|
||||
children = [{"id": x[0], "text": x[1]} for x in element[0]]
|
||||
|
|
|
|||
|
|
@ -457,6 +457,7 @@ class VcsSettingsModel(object):
|
|||
"git_close_branch_before_merging",
|
||||
"git_merge_strategy_selector",
|
||||
"diff_cache",
|
||||
"pr_target_branch_prepopulate",
|
||||
)
|
||||
|
||||
HOOKS_SETTINGS = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue