diff --git a/rhodecode/config/environment.py b/rhodecode/config/environment.py --- a/rhodecode/config/environment.py +++ b/rhodecode/config/environment.py @@ -18,7 +18,7 @@ from rhodecode.config.routing import mak from rhodecode.lib import helpers from rhodecode.lib.auth import set_available_permissions from rhodecode.lib.utils import repo2db_mapper, make_ui, set_rhodecode_config,\ - load_rcextensions, check_git_version + load_rcextensions, check_git_version, set_vcs_config from rhodecode.lib.utils2 import engine_from_config, str2bool from rhodecode.lib.db_manage import DbManage from rhodecode.model import init_model @@ -87,18 +87,14 @@ def load_environment(global_conf, app_co if not int(os.environ.get('RC_WHOOSH_TEST_DISABLE', 0)): create_test_index(TESTS_TMP_PATH, config, True) - #check git version - check_git_version() DbManage.check_waitress() # MULTIPLE DB configs # Setup the SQLAlchemy database engine sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.') init_model(sa_engine_db1) + set_available_permissions(config) repos_path = make_ui('db').configitems('paths')[0][1] - repo2db_mapper(ScmModel().repo_scan(repos_path), - remove_obsolete=False, install_git_hook=False) - set_available_permissions(config) config['base_path'] = repos_path set_rhodecode_config(config) @@ -113,4 +109,12 @@ def load_environment(global_conf, app_co # store config reference into our module to skip import magic of # pylons rhodecode.CONFIG.update(config) + set_vcs_config(rhodecode.CONFIG) + + #check git version + check_git_version() + + if str2bool(config.get('initial_repo_scan', True)): + repo2db_mapper(ScmModel().repo_scan(repos_path), + remove_obsolete=False, install_git_hook=False) return config