Changeset - 0ffcbeb76e4f
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2012-07-16 16:02:46
marcin@python-works.com
Do cleanup on repo2db mapper
- fixed issue with install git hook function
2 files changed with 8 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/config/environment.py
Show inline comments
 
@@ -87,7 +87,8 @@ def load_environment(global_conf, app_co
 
    init_model(sa_engine_db1)
 

	
 
    repos_path = make_ui('db').configitems('paths')[0][1]
 
    repo2db_mapper(ScmModel().repo_scan(repos_path))
 
    repo2db_mapper(ScmModel().repo_scan(repos_path),
 
                   remove_obsolete=True,)
 
    set_available_permissions(config)
 
    config['base_path'] = repos_path
 
    set_rhodecode_config(config)
rhodecode/lib/utils.py
Show inline comments
 
@@ -451,13 +451,14 @@ def repo2db_mapper(initial_repo_list, re
 
    for name, repo in initial_repo_list.items():
 
        group = map_groups(name)
 
        db_repo = rm.get_by_repo_name(name)
 
        # found repo that is on filesystem not in RhodeCode database
 
        if not db_repo:
 
            log.info('repository %s not found creating now' % name)
 
            added.append(name)
 
            desc = (repo.description
 
                    if repo.description != 'unknown'
 
                    else '%s repository' % name)
 
            rm.create_repo(
 
            new_repo = rm.create_repo(
 
                repo_name=name,
 
                repo_type=repo.alias,
 
                description=desc,
 
@@ -465,6 +466,10 @@ def repo2db_mapper(initial_repo_list, re
 
                owner=user,
 
                just_db=True
 
            )
 
            # we added that repo just now, and make sure it has githook
 
            # installed
 
            if new_repo.repo_type == 'git':
 
                ScmModel().install_git_hook(new_repo.scm_instance)
 
        elif install_git_hook:
 
            if db_repo.repo_type == 'git':
 
                ScmModel().install_git_hook(db_repo.scm_instance)
0 comments (0 inline, 0 general)