Changeset - 5de682ee0b06
[Not reviewed]
default
0 1 0
Mads Kiilerich (mads) - 5 years ago 2020-11-20 16:06:13
mads@kiilerich.com
Grafted from: 899712c8e8df
repo-scan: introduce cli repo-scan options --install-git-hooks and --overwrite-git-hooks
1 file changed with 8 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/bin/kallithea_cli_repo.py
Show inline comments
 
@@ -37,7 +37,11 @@ from kallithea.model.scm import ScmModel
 
@cli_base.register_command(config_file_initialize_app=True)
 
@click.option('--remove-missing', is_flag=True,
 
        help='Remove missing repositories from the Kallithea database.')
 
def repo_scan(remove_missing):
 
@click.option('--install-git-hooks', is_flag=True,
 
        help='(Re)install Kallithea Git hooks without overwriting other hooks.')
 
@click.option('--overwrite-git-hooks', is_flag=True,
 
        help='(Re)install Kallithea Git hooks, overwriting other hooks.')
 
def repo_scan(remove_missing, install_git_hooks, overwrite_git_hooks):
 
    """Scan filesystem for repositories.
 

	
 
    Search the configured repository root for new repositories and add them
 
@@ -48,7 +52,9 @@ def repo_scan(remove_missing):
 
    """
 
    click.echo('Now scanning root location for new repos ...')
 
    added, removed = repo2db_mapper(ScmModel().repo_scan(),
 
                                    remove_obsolete=remove_missing)
 
                                    remove_obsolete=remove_missing,
 
                                    install_git_hooks=install_git_hooks,
 
                                    overwrite_git_hooks=overwrite_git_hooks)
 
    click.echo('Scan completed.')
 
    if added:
 
        click.echo('Added: %s' % ', '.join(added))
0 comments (0 inline, 0 general)