repositories: preserve order of defined backends, and switched repo type selector to radios.

This commit is contained in:
Marcin Kuzminski 2020-04-27 09:39:34 +02:00
parent 72820d2808
commit 6e32a23add
5 changed files with 41 additions and 9 deletions

View file

@ -60,10 +60,15 @@ def load_pyramid_environment(global_config, settings):
load_rcextensions(root_path=settings_merged['here'])
# Limit backends to `vcs.backends` from configuration
# Limit backends to `vcs.backends` from configuration, and preserve the order
for alias in rhodecode.BACKENDS.keys():
if alias not in settings['vcs.backends']:
del rhodecode.BACKENDS[alias]
def sorter(item):
return settings['vcs.backends'].index(item[0])
rhodecode.BACKENDS = rhodecode.OrderedDict(sorted(rhodecode.BACKENDS.items(), key=sorter))
log.info('Enabled VCS backends: %s', rhodecode.BACKENDS.keys())
# initialize vcs client and optionally run the server if enabled