##// END OF EJS Templates
config: Move vcs hooks protocol and direct call setting to vcs configure mehod.
Martin Bornhold -
r588:741f0635 default
parent child Browse files
Show More
@@ -125,9 +125,6 b' def load_environment(global_conf, app_co'
125 repos_path = list(db_cfg.items('paths'))[0][1]
125 repos_path = list(db_cfg.items('paths'))[0][1]
126 config['base_path'] = repos_path
126 config['base_path'] = repos_path
127
127
128 config['vcs.hooks.direct_calls'] = _use_direct_hook_calls(config)
129 config['vcs.hooks.protocol'] = _get_vcs_hooks_protocol(config)
130
131 # store db config also in main global CONFIG
128 # store db config also in main global CONFIG
132 set_rhodecode_config(config)
129 set_rhodecode_config(config)
133
130
@@ -144,18 +141,6 b' def load_environment(global_conf, app_co'
144 return config
141 return config
145
142
146
143
147 def _use_direct_hook_calls(config):
148 default_direct_hook_calls = 'false'
149 direct_hook_calls = str2bool(
150 config.get('vcs.hooks.direct_calls', default_direct_hook_calls))
151 return direct_hook_calls
152
153
154 def _get_vcs_hooks_protocol(config):
155 protocol = config.get('vcs.hooks.protocol', 'pyro4').lower()
156 return protocol
157
158
159 def load_pyramid_environment(global_config, settings):
144 def load_pyramid_environment(global_config, settings):
160 # Some parts of the code expect a merge of global and app settings.
145 # Some parts of the code expect a merge of global and app settings.
161 settings_merged = global_config.copy()
146 settings_merged = global_config.copy()
@@ -49,20 +49,18 b' def configure_vcs(config):'
49 Patch VCS config with some RhodeCode specific stuff
49 Patch VCS config with some RhodeCode specific stuff
50 """
50 """
51 from rhodecode.lib.vcs import conf
51 from rhodecode.lib.vcs import conf
52 from rhodecode.lib.utils2 import aslist
53 conf.settings.BACKENDS = {
52 conf.settings.BACKENDS = {
54 'hg': 'rhodecode.lib.vcs.backends.hg.MercurialRepository',
53 'hg': 'rhodecode.lib.vcs.backends.hg.MercurialRepository',
55 'git': 'rhodecode.lib.vcs.backends.git.GitRepository',
54 'git': 'rhodecode.lib.vcs.backends.git.GitRepository',
56 'svn': 'rhodecode.lib.vcs.backends.svn.SubversionRepository',
55 'svn': 'rhodecode.lib.vcs.backends.svn.SubversionRepository',
57 }
56 }
58
57
59 conf.settings.GIT_REV_FILTER = shlex.split(
58 conf.settings.HOOKS_PROTOCOL = config['vcs.hooks.protocol']
60 config.get('git_rev_filter', '--all').strip())
59 conf.settings.HOOKS_DIRECT_CALLS = config['vcs.hooks.direct_calls']
61 conf.settings.DEFAULT_ENCODINGS = aslist(config.get('default_encoding',
60 conf.settings.GIT_REV_FILTER = shlex.split(config['git_rev_filter'])
62 'UTF-8'), sep=',')
61 conf.settings.DEFAULT_ENCODINGS = config['default_encoding']
63 conf.settings.ALIASES[:] = config.get('vcs.backends')
62 conf.settings.ALIASES[:] = config['vcs.backends']
64 conf.settings.SVN_COMPATIBLE_VERSION = config.get(
63 conf.settings.SVN_COMPATIBLE_VERSION = config['vcs.svn.compatible_version']
65 'vcs.svn.compatible_version')
66
64
67
65
68 def initialize_database(config):
66 def initialize_database(config):
@@ -88,8 +86,7 b' def initialize_test_environment(settings'
88
86
89
87
90 def get_vcs_server_protocol(config):
88 def get_vcs_server_protocol(config):
91 protocol = config.get('vcs.server.protocol', 'pyro4')
89 return config['vcs.server.protocol']
92 return protocol
93
90
94
91
95 def set_instance_id(config):
92 def set_instance_id(config):
General Comments 0
You need to be logged in to leave comments. Login now