##// END OF EJS Templates
simplevcs: fixed logic of extraction of base_path
marcink -
r2362:8956a981 default
parent child Browse files
Show More
@@ -122,7 +122,11 b' class SimpleVCS(object):'
122
122
123 @property
123 @property
124 def base_path(self):
124 def base_path(self):
125 return self.repo_vcs_config.get(*VcsSettingsModel.PATH_SETTING)
125 settings_path = self.repo_vcs_config.get(*VcsSettingsModel.PATH_SETTING)
126 if not settings_path:
127 # try, maybe we passed in explicitly as config option
128 settings_path = self.config.get('base_path')
129 return settings_path
126
130
127 def set_repo_names(self, environ):
131 def set_repo_names(self, environ):
128 """
132 """
@@ -181,7 +181,11 b' class VCSMiddleware(object):'
181 """
181 """
182 returns serialized VcsSettings
182 returns serialized VcsSettings
183 """
183 """
184 return VcsSettingsModel(repo=repo_name).get_ui_settings_as_config_obj()
184 try:
185 return VcsSettingsModel(
186 repo=repo_name).get_ui_settings_as_config_obj()
187 except Exception:
188 pass
185
189
186 def wrap_in_gzip_if_enabled(self, app, config):
190 def wrap_in_gzip_if_enabled(self, app, config):
187 if self.use_gzip:
191 if self.use_gzip:
@@ -209,6 +213,14 b' class VCSMiddleware(object):'
209 # Set acl, url and vcs repo names.
213 # Set acl, url and vcs repo names.
210 vcs_handler.set_repo_names(environ)
214 vcs_handler.set_repo_names(environ)
211
215
216 # register repo config back to the handler
217 vcs_conf = self.vcs_config(vcs_handler.acl_repo_name)
218 # maybe damaged/non existent settings. We still want to
219 # pass that point to validate on is_valid_and_existing_repo
220 # and return proper HTTP Code back to client
221 if vcs_conf:
222 vcs_handler.repo_vcs_config = vcs_conf
223
212 # check for type, presence in database and on filesystem
224 # check for type, presence in database and on filesystem
213 if not vcs_handler.is_valid_and_existing_repo(
225 if not vcs_handler.is_valid_and_existing_repo(
214 vcs_handler.acl_repo_name,
226 vcs_handler.acl_repo_name,
@@ -218,10 +230,6 b' class VCSMiddleware(object):'
218
230
219 environ['REPO_NAME'] = vcs_handler.url_repo_name
231 environ['REPO_NAME'] = vcs_handler.url_repo_name
220
232
221 # register repo config back to the handler
222 vcs_handler.repo_vcs_config = self.vcs_config(
223 vcs_handler.acl_repo_name)
224
225 # Wrap handler in middlewares if they are enabled.
233 # Wrap handler in middlewares if they are enabled.
226 vcs_handler = self.wrap_in_gzip_if_enabled(
234 vcs_handler = self.wrap_in_gzip_if_enabled(
227 vcs_handler, self.config)
235 vcs_handler, self.config)
General Comments 0
You need to be logged in to leave comments. Login now