Changeset - 28f631e2c757
[Not reviewed]
default
0 1 0
domruf - 9 years ago 2017-03-23 19:04:21
dominikruf@gmail.com
tests: use the DB set in TEST_DB for git hooks

Obviously the git hooks and the web app need to use the same database.
Therefore, if the web app uses the TEST_DB environment variable, the git hooks
needs to do the same.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/hooks.py
Show inline comments
 
@@ -383,25 +383,25 @@ def handle_git_receive(repo_path, revs, 
 
    """
 
    from paste.deploy import appconfig
 
    from sqlalchemy import engine_from_config
 
    from kallithea.config.environment import load_environment
 
    from kallithea.model.base import init_model
 
    from kallithea.model.db import Ui
 
    from kallithea.lib.utils import make_ui
 
    extras = _extract_extras(env)
 

	
 
    repo_path = safe_unicode(repo_path)
 
    path, ini_name = os.path.split(extras['config'])
 
    conf = appconfig('config:%s' % ini_name, relative_to=path)
 
    load_environment(conf.global_conf, conf.local_conf, test_env=False,
 
    conf = load_environment(conf.global_conf, conf.local_conf, test_env=False,
 
                     test_index=False)
 

	
 
    engine = engine_from_config(conf, 'sqlalchemy.')
 
    init_model(engine)
 

	
 
    baseui = make_ui('db')
 
    # fix if it's not a bare repo
 
    if repo_path.endswith(os.sep + '.git'):
 
        repo_path = repo_path[:-5]
 

	
 
    repo = Repository.get_by_full_path(repo_path)
 
    if not repo:
0 comments (0 inline, 0 general)