##// END OF EJS Templates
utils: drop make_ui parameter clear_session - this utility function should never mess with sessions...
Mads Kiilerich -
r7878:a1115795 default
parent child Browse files
Show More
@@ -322,7 +322,7 b" ui_sections = ['alias', 'auth',"
322 'ui', 'web', ]
322 'ui', 'web', ]
323
323
324
324
325 def make_ui(repo_path=None, clear_session=True):
325 def make_ui(repo_path=None):
326 """
326 """
327 Create an Mercurial 'ui' object based on database Ui settings, possibly
327 Create an Mercurial 'ui' object based on database Ui settings, possibly
328 augmenting with content from a hgrc file.
328 augmenting with content from a hgrc file.
@@ -342,8 +342,6 b' def make_ui(repo_path=None, clear_sessio'
342 ui_.ui_key, ui_val)
342 ui_.ui_key, ui_val)
343 baseui.setconfig(safe_str(ui_.ui_section), safe_str(ui_.ui_key),
343 baseui.setconfig(safe_str(ui_.ui_section), safe_str(ui_.ui_key),
344 ui_val)
344 ui_val)
345 if clear_session:
346 meta.Session.remove()
347
345
348 # force set push_ssl requirement to False, Kallithea handles that
346 # force set push_ssl requirement to False, Kallithea handles that
349 baseui.setconfig('web', 'push_ssl', False)
347 baseui.setconfig('web', 'push_ssl', False)
@@ -1190,7 +1190,7 b' class Repository(Base, BaseDbModel):'
1190 Creates an db based ui object for this repository
1190 Creates an db based ui object for this repository
1191 """
1191 """
1192 from kallithea.lib.utils import make_ui
1192 from kallithea.lib.utils import make_ui
1193 return make_ui(clear_session=False)
1193 return make_ui()
1194
1194
1195 @classmethod
1195 @classmethod
1196 def is_valid(cls, repo_name):
1196 def is_valid(cls, repo_name):
@@ -290,7 +290,7 b' class RepoModel(object):'
290 # clone_uri is modified - if given a value, check it is valid
290 # clone_uri is modified - if given a value, check it is valid
291 if clone_uri != '':
291 if clone_uri != '':
292 # will raise exception on error
292 # will raise exception on error
293 is_valid_repo_uri(cur_repo.repo_type, clone_uri, make_ui(clear_session=False))
293 is_valid_repo_uri(cur_repo.repo_type, clone_uri, make_ui())
294 cur_repo.clone_uri = clone_uri
294 cur_repo.clone_uri = clone_uri
295
295
296 if 'repo_name' in kwargs:
296 if 'repo_name' in kwargs:
@@ -360,7 +360,7 b' class RepoModel(object):'
360 new_repo.private = private
360 new_repo.private = private
361 if clone_uri:
361 if clone_uri:
362 # will raise exception on error
362 # will raise exception on error
363 is_valid_repo_uri(repo_type, clone_uri, make_ui(clear_session=False))
363 is_valid_repo_uri(repo_type, clone_uri, make_ui())
364 new_repo.clone_uri = clone_uri
364 new_repo.clone_uri = clone_uri
365 new_repo.landing_rev = landing_rev
365 new_repo.landing_rev = landing_rev
366
366
@@ -661,7 +661,7 b' class RepoModel(object):'
661 backend = get_backend(repo_type)
661 backend = get_backend(repo_type)
662
662
663 if repo_type == 'hg':
663 if repo_type == 'hg':
664 baseui = make_ui(clear_session=False)
664 baseui = make_ui()
665 # patch and reset hooks section of UI config to not run any
665 # patch and reset hooks section of UI config to not run any
666 # hooks on creating remote repo
666 # hooks on creating remote repo
667 for k, v in baseui.configitems('hooks'):
667 for k, v in baseui.configitems('hooks'):
@@ -412,7 +412,7 b' def ValidCloneUri():'
412
412
413 if url and url != value.get('clone_uri_hidden'):
413 if url and url != value.get('clone_uri_hidden'):
414 try:
414 try:
415 is_valid_repo_uri(repo_type, url, make_ui(clear_session=False))
415 is_valid_repo_uri(repo_type, url, make_ui())
416 except Exception:
416 except Exception:
417 log.exception('URL validation failed')
417 log.exception('URL validation failed')
418 msg = self.message('clone_uri', state)
418 msg = self.message('clone_uri', state)
General Comments 0
You need to be logged in to leave comments. Login now