config: Move vcs hooks protocol and direct call setting to vcs configure mehod.

This commit is contained in:
Martin Bornhold 2016-08-08 08:23:53 +02:00
parent 8b36c76305
commit 1739739bed
2 changed files with 7 additions and 25 deletions

View file

@ -125,9 +125,6 @@ def load_environment(global_conf, app_conf, initial=False,
repos_path = list(db_cfg.items('paths'))[0][1]
config['base_path'] = repos_path
config['vcs.hooks.direct_calls'] = _use_direct_hook_calls(config)
config['vcs.hooks.protocol'] = _get_vcs_hooks_protocol(config)
# store db config also in main global CONFIG
set_rhodecode_config(config)
@ -144,18 +141,6 @@ def load_environment(global_conf, app_conf, initial=False,
return config
def _use_direct_hook_calls(config):
default_direct_hook_calls = 'false'
direct_hook_calls = str2bool(
config.get('vcs.hooks.direct_calls', default_direct_hook_calls))
return direct_hook_calls
def _get_vcs_hooks_protocol(config):
protocol = config.get('vcs.hooks.protocol', 'pyro4').lower()
return protocol
def load_pyramid_environment(global_config, settings):
# Some parts of the code expect a merge of global and app settings.
settings_merged = global_config.copy()

View file

@ -49,20 +49,18 @@ def configure_vcs(config):
Patch VCS config with some RhodeCode specific stuff
"""
from rhodecode.lib.vcs import conf
from rhodecode.lib.utils2 import aslist
conf.settings.BACKENDS = {
'hg': 'rhodecode.lib.vcs.backends.hg.MercurialRepository',
'git': 'rhodecode.lib.vcs.backends.git.GitRepository',
'svn': 'rhodecode.lib.vcs.backends.svn.SubversionRepository',
}
conf.settings.GIT_REV_FILTER = shlex.split(
config.get('git_rev_filter', '--all').strip())
conf.settings.DEFAULT_ENCODINGS = aslist(config.get('default_encoding',
'UTF-8'), sep=',')
conf.settings.ALIASES[:] = config.get('vcs.backends')
conf.settings.SVN_COMPATIBLE_VERSION = config.get(
'vcs.svn.compatible_version')
conf.settings.HOOKS_PROTOCOL = config['vcs.hooks.protocol']
conf.settings.HOOKS_DIRECT_CALLS = config['vcs.hooks.direct_calls']
conf.settings.GIT_REV_FILTER = shlex.split(config['git_rev_filter'])
conf.settings.DEFAULT_ENCODINGS = config['default_encoding']
conf.settings.ALIASES[:] = config['vcs.backends']
conf.settings.SVN_COMPATIBLE_VERSION = config['vcs.svn.compatible_version']
def initialize_database(config):
@ -88,8 +86,7 @@ def initialize_test_environment(settings, test_env=None):
def get_vcs_server_protocol(config):
protocol = config.get('vcs.server.protocol', 'pyro4')
return protocol
return config['vcs.server.protocol']
def set_instance_id(config):