##// END OF EJS Templates
vcs: Move the setup code for vcs lib from pylons to pyramid layer....
Martin Bornhold -
r582:3ea09690 default
parent child Browse files
Show More
@@ -119,26 +119,6 b' def load_environment(global_conf, app_co'
119 119 'secret': config.get('channelstream.secret')
120 120 }
121 121
122 # Limit backends to "vcs.backends" from configuration
123 backends = config['vcs.backends'] = aslist(
124 config.get('vcs.backends', 'hg,git'), sep=',')
125 for alias in rhodecode.BACKENDS.keys():
126 if alias not in backends:
127 del rhodecode.BACKENDS[alias]
128 log.info("Enabled backends: %s", backends)
129
130 # initialize vcs client and optionally run the server if enabled
131 vcs_server_uri = config.get('vcs.server', '')
132 vcs_server_enabled = str2bool(config.get('vcs.server.enable', 'true'))
133 start_server = (
134 str2bool(config.get('vcs.start_server', 'false')) and
135 not int(os.environ.get('RC_VCSSERVER_TEST_DISABLE', '0')))
136 if vcs_server_enabled and start_server:
137 log.info("Starting vcsserver")
138 start_vcs_server(server_and_port=vcs_server_uri,
139 protocol=utils.get_vcs_server_protocol(config),
140 log_level=config['vcs.server.log_level'])
141
142 122 set_available_permissions(config)
143 123 db_cfg = make_db_config(clear_session=True)
144 124
@@ -161,10 +141,6 b' def load_environment(global_conf, app_co'
161 141 rhodecode.CONFIG.update(config)
162 142
163 143 utils.configure_pyro4(config)
164 utils.configure_vcs(config)
165 if vcs_server_enabled:
166 connect_vcs(vcs_server_uri, utils.get_vcs_server_protocol(config))
167
168 144 return config
169 145
170 146
@@ -194,3 +170,26 b' def load_pyramid_environment(global_conf'
194 170
195 171 # Initialize the database connection.
196 172 utils.initialize_database(settings_merged)
173
174 # Limit backends to `vcs.backends` from configuration
175 for alias in rhodecode.BACKENDS.keys():
176 if alias not in settings['vcs.backends']:
177 del rhodecode.BACKENDS[alias]
178 log.info('Enabled VCS backends: %s', rhodecode.BACKENDS.keys())
179
180 # initialize vcs client and optionally run the server if enabled
181 vcs_server_uri = settings['vcs.server']
182 vcs_server_enabled = settings['vcs.server.enable']
183 start_server = (
184 settings['vcs.start_server'] and
185 not int(os.environ.get('RC_VCSSERVER_TEST_DISABLE', '0')))
186
187 if vcs_server_enabled and start_server:
188 log.info("Starting vcsserver")
189 start_vcs_server(server_and_port=vcs_server_uri,
190 protocol=utils.get_vcs_server_protocol(settings),
191 log_level=settings['vcs.server.log_level'])
192
193 utils.configure_vcs(settings)
194 if vcs_server_enabled:
195 connect_vcs(vcs_server_uri, utils.get_vcs_server_protocol(settings))
General Comments 0
You need to be logged in to leave comments. Login now