# HG changeset patch # User Mads Kiilerich # Date 1421858111 -3600 # Node ID 2d49ab82003bfc728cd223d7b14991d26fab1dea # Parent 787f30a1a9966c50c9809188eb51dea7c7a146d1 admin: when scanning for repos without 'remove', report the repos that could/would be removed diff -r 787f30a1a996 -r 2d49ab82003b kallithea/lib/utils.py --- a/kallithea/lib/utils.py Wed Jan 21 17:35:11 2015 +0100 +++ b/kallithea/lib/utils.py Wed Jan 21 17:35:11 2015 +0100 @@ -523,20 +523,20 @@ ScmModel().install_git_hook(db_repo.scm_instance) removed = [] - if remove_obsolete: - # remove from database those repositories that are not in the filesystem - for repo in sa.query(Repository).all(): - if repo.repo_name not in initial_repo_list.keys(): + # remove from database those repositories that are not in the filesystem + for repo in sa.query(Repository).all(): + if repo.repo_name not in initial_repo_list.keys(): + if remove_obsolete: log.debug("Removing non-existing repository found in db `%s`" % repo.repo_name) try: - removed.append(repo.repo_name) RepoModel(sa).delete(repo, forks='detach', fs_remove=False) sa.commit() except Exception: #don't hold further removals on error log.error(traceback.format_exc()) sa.rollback() + removed.append(repo.repo_name) return added, removed