# HG changeset patch # User Mads Kiilerich # Date 1548243485 -3600 # Node ID bb5650d4a9142fdfb27abb93b37246fad14c970f # Parent 7c5d28775cdff2667a99fb81c461bfe07b111513 config: clarify naming of repo_root_path diff -r 7c5d28775cdf -r bb5650d4a914 kallithea/bin/kallithea_cli_db.py --- a/kallithea/bin/kallithea_cli_db.py Wed Jan 23 12:44:35 2019 +0100 +++ b/kallithea/bin/kallithea_cli_db.py Wed Jan 23 12:38:05 2019 +0100 @@ -57,8 +57,8 @@ dbmanage = DbManage(dbconf=dbconf, root=kallithea.CONFIG['here'], tests=False, cli_args=cli_args) dbmanage.create_tables(override=True) - opts = dbmanage.config_prompt(None) - dbmanage.create_settings(opts) + repo_root_path = dbmanage.prompt_repo_root_path(None) + dbmanage.create_settings(repo_root_path) dbmanage.create_default_user() dbmanage.admin_prompt() dbmanage.create_permissions() diff -r 7c5d28775cdf -r bb5650d4a914 kallithea/lib/db_manage.py --- a/kallithea/lib/db_manage.py Wed Jan 23 12:44:35 2019 +0100 +++ b/kallithea/lib/db_manage.py Wed Jan 23 12:38:05 2019 +0100 @@ -290,7 +290,7 @@ for repo in Repository.query(): repo.update_changeset_cache() - def config_prompt(self, test_repo_path='', retries=3): + def prompt_repo_root_path(self, test_repo_path='', retries=3): _path = self.cli_args.get('repos_location') if retries == 3: log.info('Setting up repositories config') @@ -334,7 +334,7 @@ if _path is not None: sys.exit('Invalid repo path: %s' % _path) retries -= 1 - return self.config_prompt(test_repo_path, retries) # recursing!!! + return self.prompt_repo_root_path(test_repo_path, retries) # recursing!!! real_path = os.path.normpath(os.path.realpath(path)) @@ -343,17 +343,16 @@ return real_path - def create_settings(self, path): - + def create_settings(self, repo_root_path): ui_config = [ ('web', 'allow_archive', 'gz zip bz2', True), ('web', 'baseurl', '/', True), - ('paths', '/', path, True), + ('paths', '/', repo_root_path, True), #('phases', 'publish', 'false', False) ('hooks', Ui.HOOK_UPDATE, 'hg update >&2', False), ('hooks', Ui.HOOK_REPO_SIZE, 'python:kallithea.lib.hooks.repo_size', True), ('extensions', 'largefiles', '', True), - ('largefiles', 'usercache', os.path.join(path, '.cache', 'largefiles'), True), + ('largefiles', 'usercache', os.path.join(repo_root_path, '.cache', 'largefiles'), True), ('extensions', 'hgsubversion', '', False), ('extensions', 'hggit', '', False), ] diff -r 7c5d28775cdf -r bb5650d4a914 kallithea/tests/fixture.py --- a/kallithea/tests/fixture.py Wed Jan 23 12:44:35 2019 +0100 +++ b/kallithea/tests/fixture.py Wed Jan 23 12:38:05 2019 +0100 @@ -368,7 +368,7 @@ tests=True) dbmanage.create_tables(override=True) # for tests dynamically set new root paths based on generated content - dbmanage.create_settings(dbmanage.config_prompt(repos_test_path)) + dbmanage.create_settings(dbmanage.prompt_repo_root_path(repos_test_path)) dbmanage.create_default_user() dbmanage.admin_prompt() dbmanage.create_permissions()