##// END OF EJS Templates
Do cleanup on repo2db mapper...
marcink -
r2622:0ffcbeb7 beta
parent child Browse files
Show More
@@ -87,7 +87,8 b' def load_environment(global_conf, app_co'
87 init_model(sa_engine_db1)
87 init_model(sa_engine_db1)
88
88
89 repos_path = make_ui('db').configitems('paths')[0][1]
89 repos_path = make_ui('db').configitems('paths')[0][1]
90 repo2db_mapper(ScmModel().repo_scan(repos_path))
90 repo2db_mapper(ScmModel().repo_scan(repos_path),
91 remove_obsolete=True,)
91 set_available_permissions(config)
92 set_available_permissions(config)
92 config['base_path'] = repos_path
93 config['base_path'] = repos_path
93 set_rhodecode_config(config)
94 set_rhodecode_config(config)
@@ -451,13 +451,14 b' def repo2db_mapper(initial_repo_list, re'
451 for name, repo in initial_repo_list.items():
451 for name, repo in initial_repo_list.items():
452 group = map_groups(name)
452 group = map_groups(name)
453 db_repo = rm.get_by_repo_name(name)
453 db_repo = rm.get_by_repo_name(name)
454 # found repo that is on filesystem not in RhodeCode database
454 if not db_repo:
455 if not db_repo:
455 log.info('repository %s not found creating now' % name)
456 log.info('repository %s not found creating now' % name)
456 added.append(name)
457 added.append(name)
457 desc = (repo.description
458 desc = (repo.description
458 if repo.description != 'unknown'
459 if repo.description != 'unknown'
459 else '%s repository' % name)
460 else '%s repository' % name)
460 rm.create_repo(
461 new_repo = rm.create_repo(
461 repo_name=name,
462 repo_name=name,
462 repo_type=repo.alias,
463 repo_type=repo.alias,
463 description=desc,
464 description=desc,
@@ -465,6 +466,10 b' def repo2db_mapper(initial_repo_list, re'
465 owner=user,
466 owner=user,
466 just_db=True
467 just_db=True
467 )
468 )
469 # we added that repo just now, and make sure it has githook
470 # installed
471 if new_repo.repo_type == 'git':
472 ScmModel().install_git_hook(new_repo.scm_instance)
468 elif install_git_hook:
473 elif install_git_hook:
469 if db_repo.repo_type == 'git':
474 if db_repo.repo_type == 'git':
470 ScmModel().install_git_hook(db_repo.scm_instance)
475 ScmModel().install_git_hook(db_repo.scm_instance)
General Comments 0
You need to be logged in to leave comments. Login now