Show More
@@ -145,7 +145,7 b' dev-srv:' | |||||
145 | .PHONY: dev-srv-g |
|
145 | .PHONY: dev-srv-g | |
146 | ## run gunicorn multi process workers |
|
146 | ## run gunicorn multi process workers | |
147 | dev-srv-g: |
|
147 | dev-srv-g: | |
148 | gunicorn --paste .dev/dev.ini --bind=0.0.0.0:10020 --config=.dev/gunicorn_config.py --timeout=120 |
|
148 | gunicorn --paste .dev/dev.ini --bind=0.0.0.0:10020 --config=.dev/gunicorn_config.py --timeout=120 --reload | |
149 |
|
149 | |||
150 |
|
150 | |||
151 | # Default command on calling make |
|
151 | # Default command on calling make |
@@ -206,7 +206,7 b' def rescan_repos(request, apiuser, remov' | |||||
206 | try: |
|
206 | try: | |
207 | rm_obsolete = Optional.extract(remove_obsolete) |
|
207 | rm_obsolete = Optional.extract(remove_obsolete) | |
208 | added, removed = repo2db_mapper(ScmModel().repo_scan(), |
|
208 | added, removed = repo2db_mapper(ScmModel().repo_scan(), | |
209 | remove_obsolete=rm_obsolete) |
|
209 | remove_obsolete=rm_obsolete, force_hooks_rebuild=True) | |
210 | return {'added': added, 'removed': removed} |
|
210 | return {'added': added, 'removed': removed} | |
211 | except Exception: |
|
211 | except Exception: | |
212 | log.exception('Failed to run repo rescann') |
|
212 | log.exception('Failed to run repo rescann') |
@@ -217,7 +217,7 b' class AdminSettingsView(BaseAppView):' | |||||
217 | def settings_mapping(self): |
|
217 | def settings_mapping(self): | |
218 | c = self.load_default_context() |
|
218 | c = self.load_default_context() | |
219 | c.active = 'mapping' |
|
219 | c.active = 'mapping' | |
220 |
|
220 | c.storage_path = VcsSettingsModel().get_repos_location() | ||
221 | data = render('rhodecode:templates/admin/settings/settings.mako', |
|
221 | data = render('rhodecode:templates/admin/settings/settings.mako', | |
222 | self._get_template_context(c), self.request) |
|
222 | self._get_template_context(c), self.request) | |
223 | html = formencode.htmlfill.render( |
|
223 | html = formencode.htmlfill.render( | |
@@ -245,7 +245,7 b' class AdminSettingsView(BaseAppView):' | |||||
245 | ScmModel().mark_for_invalidation(repo.repo_name, delete=True) |
|
245 | ScmModel().mark_for_invalidation(repo.repo_name, delete=True) | |
246 |
|
246 | |||
247 | filesystem_repos = ScmModel().repo_scan() |
|
247 | filesystem_repos = ScmModel().repo_scan() | |
248 | added, removed = repo2db_mapper(filesystem_repos, rm_obsolete) |
|
248 | added, removed = repo2db_mapper(filesystem_repos, rm_obsolete, force_hooks_rebuild=True) | |
249 | PermissionModel().trigger_permission_flush() |
|
249 | PermissionModel().trigger_permission_flush() | |
250 |
|
250 | |||
251 | def _repr(rm_repo): |
|
251 | def _repr(rm_repo): |
@@ -508,7 +508,7 b' def map_groups(path):' | |||||
508 | return group |
|
508 | return group | |
509 |
|
509 | |||
510 |
|
510 | |||
511 | def repo2db_mapper(initial_repo_list, remove_obsolete=False): |
|
511 | def repo2db_mapper(initial_repo_list, remove_obsolete=False, force_hooks_rebuild=False): | |
512 | """ |
|
512 | """ | |
513 | maps all repos given in initial_repo_list, non existing repositories |
|
513 | maps all repos given in initial_repo_list, non existing repositories | |
514 | are created, if remove_obsolete is True it also checks for db entries |
|
514 | are created, if remove_obsolete is True it also checks for db entries | |
@@ -537,9 +537,10 b' def repo2db_mapper(initial_repo_list, re' | |||||
537 | group = map_groups(name) |
|
537 | group = map_groups(name) | |
538 | str_name = safe_str(name) |
|
538 | str_name = safe_str(name) | |
539 | db_repo = repo_model.get_by_repo_name(str_name) |
|
539 | db_repo = repo_model.get_by_repo_name(str_name) | |
|
540 | ||||
540 | # found repo that is on filesystem not in RhodeCode database |
|
541 | # found repo that is on filesystem not in RhodeCode database | |
541 | if not db_repo: |
|
542 | if not db_repo: | |
542 | log.info('repository %s not found, creating now', name) |
|
543 | log.info('repository `%s` not found in the database, creating now', name) | |
543 | added.append(name) |
|
544 | added.append(name) | |
544 | desc = (repo.description |
|
545 | desc = (repo.description | |
545 | if repo.description != 'unknown' |
|
546 | if repo.description != 'unknown' | |
@@ -570,7 +571,7 b' def repo2db_mapper(initial_repo_list, re' | |||||
570 | config = db_repo._config |
|
571 | config = db_repo._config | |
571 | config.set('extensions', 'largefiles', '') |
|
572 | config.set('extensions', 'largefiles', '') | |
572 | repo = db_repo.scm_instance(config=config) |
|
573 | repo = db_repo.scm_instance(config=config) | |
573 | repo.install_hooks() |
|
574 | repo.install_hooks(force=force_hooks_rebuild) | |
574 |
|
575 | |||
575 | removed = [] |
|
576 | removed = [] | |
576 | if remove_obsolete: |
|
577 | if remove_obsolete: |
@@ -5,6 +5,11 b'' | |||||
5 | <h3 class="panel-title">${_('Import New Groups or Repositories')}</h3> |
|
5 | <h3 class="panel-title">${_('Import New Groups or Repositories')}</h3> | |
6 | </div> |
|
6 | </div> | |
7 | <div class="panel-body"> |
|
7 | <div class="panel-body"> | |
|
8 | ||||
|
9 | <p> | |||
|
10 | ${_('This function will scann all data under the current storage path location at')} <code>${c.storage_path}</code> | |||
|
11 | </p> | |||
|
12 | ||||
8 | <div class="checkbox"> |
|
13 | <div class="checkbox"> | |
9 | ${h.checkbox('destroy',True)} |
|
14 | ${h.checkbox('destroy',True)} | |
10 | <label for="destroy">${_('Destroy old data')}</label> |
|
15 | <label for="destroy">${_('Destroy old data')}</label> |
@@ -358,7 +358,7 b' class TestRepoContainer(object):' | |||||
358 | return Repository.get(self._repos[key]) |
|
358 | return Repository.get(self._repos[key]) | |
359 |
|
359 | |||
360 | def _create_repo(self, dump_name, backend_alias, config): |
|
360 | def _create_repo(self, dump_name, backend_alias, config): | |
361 |
repo_name = ' |
|
361 | repo_name = f'{backend_alias}-{dump_name}' | |
362 | backend = get_backend(backend_alias) |
|
362 | backend = get_backend(backend_alias) | |
363 | dump_extractor = self.dump_extractors[backend_alias] |
|
363 | dump_extractor = self.dump_extractors[backend_alias] | |
364 | repo_path = dump_extractor(dump_name, repo_name) |
|
364 | repo_path = dump_extractor(dump_name, repo_name) |
@@ -231,8 +231,6 b' def platform_encodes_filenames():' | |||||
231 | return path_with_latin1 != read_path |
|
231 | return path_with_latin1 != read_path | |
232 |
|
232 | |||
233 |
|
233 | |||
234 |
|
||||
235 |
|
||||
236 | def test_repo2db_mapper_groups(repo_groups): |
|
234 | def test_repo2db_mapper_groups(repo_groups): | |
237 | session = meta.Session() |
|
235 | session = meta.Session() | |
238 | zombie_group, parent_group, child_group = repo_groups |
|
236 | zombie_group, parent_group, child_group = repo_groups |
General Comments 0
You need to be logged in to leave comments.
Login now