# HG changeset patch # User Martin Bornhold # Date 2016-08-08 06:23:53 # Node ID 741f06351f549f5b559d6c7e31ba2a56db2d3c5d # Parent 402963851c8a793dc55d78380d2631b7a3be57ae config: Move vcs hooks protocol and direct call setting to vcs configure mehod. diff --git a/rhodecode/config/environment.py b/rhodecode/config/environment.py --- a/rhodecode/config/environment.py +++ b/rhodecode/config/environment.py @@ -125,9 +125,6 @@ def load_environment(global_conf, app_co 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_co 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() diff --git a/rhodecode/config/utils.py b/rhodecode/config/utils.py --- a/rhodecode/config/utils.py +++ b/rhodecode/config/utils.py @@ -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 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):