Changeset - bb5650d4a914
[Not reviewed]
default
0 3 0
Mads Kiilerich - 7 years ago 2019-01-23 12:38:05
mads@kiilerich.com
Grafted from: f8a623483871
config: clarify naming of repo_root_path
3 files changed with 8 insertions and 9 deletions:
0 comments (0 inline, 0 general)
kallithea/bin/kallithea_cli_db.py
Show inline comments
 
@@ -57,8 +57,8 @@ def db_create(user, password, email, rep
 
    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()
kallithea/lib/db_manage.py
Show inline comments
 
@@ -290,7 +290,7 @@ class DbManage(object):
 
        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 @@ class DbManage(object):
 
            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 @@ class DbManage(object):
 

	
 
        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),
 
        ]
kallithea/tests/fixture.py
Show inline comments
 
@@ -368,7 +368,7 @@ def create_test_env(repos_test_path, con
 
                        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()
0 comments (0 inline, 0 general)