Mercurial > kallithea
changeset 2622:0ffcbeb76e4f beta
Do cleanup on repo2db mapper
- fixed issue with install git hook function
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 16 Jul 2012 16:02:46 +0200 |
parents | 4f3ecd7357a2 |
children | 44678a64cfae |
files | rhodecode/config/environment.py rhodecode/lib/utils.py |
diffstat | 2 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/config/environment.py Mon Jul 16 16:01:15 2012 +0200 +++ b/rhodecode/config/environment.py Mon Jul 16 16:02:46 2012 +0200 @@ -87,7 +87,8 @@ 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)
--- a/rhodecode/lib/utils.py Mon Jul 16 16:01:15 2012 +0200 +++ b/rhodecode/lib/utils.py Mon Jul 16 16:02:46 2012 +0200 @@ -451,13 +451,14 @@ 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 @@ 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)