diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -145,7 +145,7 @@ dev-srv: .PHONY: dev-srv-g ## run gunicorn multi process workers dev-srv-g: - gunicorn --paste .dev/dev.ini --bind=0.0.0.0:10020 --config=.dev/gunicorn_config.py --timeout=120 + gunicorn --paste .dev/dev.ini --bind=0.0.0.0:10020 --config=.dev/gunicorn_config.py --timeout=120 --reload # Default command on calling make diff --git a/rhodecode/api/views/server_api.py b/rhodecode/api/views/server_api.py --- a/rhodecode/api/views/server_api.py +++ b/rhodecode/api/views/server_api.py @@ -206,7 +206,7 @@ def rescan_repos(request, apiuser, remov try: rm_obsolete = Optional.extract(remove_obsolete) added, removed = repo2db_mapper(ScmModel().repo_scan(), - remove_obsolete=rm_obsolete) + remove_obsolete=rm_obsolete, force_hooks_rebuild=True) return {'added': added, 'removed': removed} except Exception: log.exception('Failed to run repo rescann') diff --git a/rhodecode/apps/admin/views/settings.py b/rhodecode/apps/admin/views/settings.py --- a/rhodecode/apps/admin/views/settings.py +++ b/rhodecode/apps/admin/views/settings.py @@ -217,7 +217,7 @@ class AdminSettingsView(BaseAppView): def settings_mapping(self): c = self.load_default_context() c.active = 'mapping' - + c.storage_path = VcsSettingsModel().get_repos_location() data = render('rhodecode:templates/admin/settings/settings.mako', self._get_template_context(c), self.request) html = formencode.htmlfill.render( @@ -245,7 +245,7 @@ class AdminSettingsView(BaseAppView): ScmModel().mark_for_invalidation(repo.repo_name, delete=True) filesystem_repos = ScmModel().repo_scan() - added, removed = repo2db_mapper(filesystem_repos, rm_obsolete) + added, removed = repo2db_mapper(filesystem_repos, rm_obsolete, force_hooks_rebuild=True) PermissionModel().trigger_permission_flush() def _repr(rm_repo): diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -508,7 +508,7 @@ def map_groups(path): return group -def repo2db_mapper(initial_repo_list, remove_obsolete=False): +def repo2db_mapper(initial_repo_list, remove_obsolete=False, force_hooks_rebuild=False): """ maps all repos given in initial_repo_list, non existing repositories are created, if remove_obsolete is True it also checks for db entries @@ -537,9 +537,10 @@ def repo2db_mapper(initial_repo_list, re group = map_groups(name) str_name = safe_str(name) db_repo = repo_model.get_by_repo_name(str_name) + # found repo that is on filesystem not in RhodeCode database if not db_repo: - log.info('repository %s not found, creating now', name) + log.info('repository `%s` not found in the database, creating now', name) added.append(name) desc = (repo.description if repo.description != 'unknown' @@ -570,7 +571,7 @@ def repo2db_mapper(initial_repo_list, re config = db_repo._config config.set('extensions', 'largefiles', '') repo = db_repo.scm_instance(config=config) - repo.install_hooks() + repo.install_hooks(force=force_hooks_rebuild) removed = [] if remove_obsolete: diff --git a/rhodecode/templates/admin/settings/settings_mapping.mako b/rhodecode/templates/admin/settings/settings_mapping.mako --- a/rhodecode/templates/admin/settings/settings_mapping.mako +++ b/rhodecode/templates/admin/settings/settings_mapping.mako @@ -5,6 +5,11 @@
+ ${_('This function will scann all data under the current storage path location at')} ${c.storage_path}
+