## snippet for displaying vcs settings ## usage: ## <%namespace name="vcss" file="/base/vcssettings.mako"/> ## ${vcss.vcs_settings_fields()} <%def name="vcs_settings_fields(suffix='', svn_branch_patterns=None, svn_tag_patterns=None, repo_type=None, display_globals=False, **kwargs)"> % if display_globals: % endif % if display_globals or repo_type in ['git', 'hg']:

${_('Internal Hooks')}

${h.checkbox('hooks_changegroup_repo_size' + suffix, 'True', **kwargs)}
${_('Trigger a hook that calculates repository size after each push.')}
${h.checkbox('hooks_changegroup_push_logger' + suffix, 'True', **kwargs)}
${_('Execute Built in pre/post push hooks. This also executes rcextensions hooks.')}
${h.checkbox('hooks_outgoing_pull_logger' + suffix, 'True', **kwargs)}
${_('Execute Built in pre/post pull hooks. This also executes rcextensions hooks.')}
% endif % if display_globals or repo_type in ['hg']:

${_('Mercurial Settings')}

${h.checkbox('extensions_largefiles' + suffix, 'True', **kwargs)}
% if display_globals: ${_('Enable Largefiles extensions for all repositories.')} % else: ${_('Enable Largefiles extensions for this repository.')} % endif
${h.checkbox('phases_publish' + suffix, 'True', **kwargs)}
${_('When this is enabled all commits in the repository are seen as public commits by clients.')}
${h.checkbox('extensions_evolve' + suffix, 'True', **kwargs)}
% if display_globals: ${_('Enable Evolve and Topic extensions for all repositories.')} % else: ${_('Enable Evolve and Topic extensions for this repository.')} % endif
% endif % if display_globals or repo_type in ['git']:

${_('Git Settings')}

${h.checkbox('vcs_git_lfs_enabled' + suffix, 'True', **kwargs)}
% if display_globals: ${_('Enable lfs extensions for all repositories.')} % else: ${_('Enable lfs extensions for this repository.')} % endif
% endif % if display_globals or repo_type in ['svn']:

${_('Subversion Settings')}

% if display_globals:

path: ${c.svn_config_path}

% if c.svn_generate_config: % endif
% endif

${_('Patterns for identifying SVN branches and tags. For recursive search, use "*". Eg.: "/branches/*"')}

% if svn_branch_patterns: % for branch in svn_branch_patterns:
${h.hidden('branch_ui_key' + suffix, branch.ui_key)} ${h.text('branch_value_%d' % branch.ui_id + suffix, branch.ui_value, size=59, readonly="readonly", class_='disabled')} % if kwargs.get('disabled') != 'disabled': ${_('Delete')} % endif
% endfor %endif
% if kwargs.get('disabled') != 'disabled':
${h.text('new_svn_branch',size=59,placeholder='New branch pattern')}
% endif

% if svn_tag_patterns: % for tag in svn_tag_patterns:
${h.hidden('tag_ui_key' + suffix, tag.ui_key)} ${h.text('tag_ui_value_new_%d' % tag.ui_id + suffix, tag.ui_value, size=59, readonly="readonly", class_='disabled tag_input')} % if kwargs.get('disabled') != 'disabled': ${_('Delete')} %endif
% endfor % endif
% if kwargs.get('disabled') != 'disabled':
${h.text('new_svn_tag' + suffix, size=59, placeholder='New tag pattern')}
%endif
% else: ${h.hidden('new_svn_branch' + suffix, '')} ${h.hidden('new_svn_tag' + suffix, '')} % endif % if display_globals or repo_type in ['hg', 'git']:

${_('Pull Request Settings')}

${h.checkbox('rhodecode_pr_merge_enabled' + suffix, 'True', **kwargs)}
${_('Note: when this feature is enabled, it only runs hooks defined in the rcextension package. Custom hooks added on the Admin -> Settings -> Hooks page will not be run when pull requests are automatically merged from the web interface.')}
%if c.rhodecode_edition_id != 'EE':
${_('This feature is available in RhodeCode EE edition only. Contact {sales_email} to obtain a trial license.').format(sales_email='sales@rhodecode.com')|n}
%else:
${h.checkbox('rhodecode_auto_merge_enabled' + suffix, 'True', **kwargs)}
${_('When this is enabled, the pull request will be merged once it has at least one reviewer and is approved.')}
%endif
${h.checkbox('rhodecode_use_outdated_comments' + suffix, 'True', **kwargs)}
${_('During the update of a pull request, the position of inline comments will be updated and outdated inline comments will be hidden.')}
% endif % if display_globals or repo_type in ['hg', 'git', 'svn']:

${_('Diff cache')}

${h.checkbox('rhodecode_diff_cache' + suffix, 'True', **kwargs)}
% endif % if display_globals or repo_type in ['hg',]:

${_('Mercurial Pull Request Settings')}

## Specific HG settings
${h.checkbox('rhodecode_hg_use_rebase_for_merging' + suffix, 'True', **kwargs)}
${_('Use rebase instead of creating a merge commit when merging via web interface.')}
${h.checkbox('rhodecode_hg_close_branch_before_merging' + suffix, 'True', **kwargs)}
${_('Close branch before merging it into destination branch. No effect when rebase strategy is use.')}
% endif % if display_globals or repo_type in ['git']:

${_('Git Pull Request Settings')}

##
## ${h.checkbox('rhodecode_git_use_rebase_for_merging' + suffix, 'True', **kwargs)} ## ##
##
## ${_('Use rebase instead of creating a merge commit when merging via web interface.')} ##
${h.checkbox('rhodecode_git_close_branch_before_merging' + suffix, 'True', **kwargs)}
${_('Delete branch after merging it into destination branch.')}
% endif