Changeset - b504198073b7
[Not reviewed]
default
0 2 0
Mads Kiilerich - 11 years ago 2015-01-06 00:54:35
madski@unity3d.com
settings: set current user as owner when running repo scan
2 files changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/settings.py
Show inline comments
 
@@ -205,13 +205,14 @@ class SettingsController(BaseController)
 
                log.debug('invalidating all repositories cache')
 
                for repo in Repository.get_all():
 
                    ScmModel().mark_for_invalidation(repo.repo_name, delete=True)
 

	
 
            filesystem_repos = ScmModel().repo_scan()
 
            added, removed = repo2db_mapper(filesystem_repos, rm_obsolete,
 
                                            install_git_hook=install_git_hooks)
 
                                            install_git_hook=install_git_hooks,
 
                                            user=c.authuser.username)
 
            _repr = lambda l: ', '.join(map(safe_unicode, l)) or '-'
 
            h.flash(_('Repositories successfully '
 
                      'rescanned added: %s ; removed: %s') %
 
                    (_repr(added), _repr(removed)),
 
                    category='success')
 
            return redirect(url('admin_settings_mapping'))
kallithea/lib/utils.py
Show inline comments
 
@@ -468,13 +468,13 @@ def map_groups(path):
 

	
 
        parent = group
 
    return group
 

	
 

	
 
def repo2db_mapper(initial_repo_list, remove_obsolete=False,
 
                   install_git_hook=False):
 
                   install_git_hook=False, user=None):
 
    """
 
    maps all repos given in initial_repo_list, non existing repositories
 
    are created, if remove_obsolete is True it also check for db entries
 
    that are not in initial_repo_list and removes them.
 

	
 
    :param initial_repo_list: list of repositories found by scanning methods
 
@@ -483,12 +483,13 @@ def repo2db_mapper(initial_repo_list, re
 
        for a repo if missing
 
    """
 
    from kallithea.model.repo import RepoModel
 
    from kallithea.model.scm import ScmModel
 
    sa = meta.Session()
 
    repo_model = RepoModel()
 
    if user is None:
 
    user = User.get_first_admin()
 
    added = []
 

	
 
    ##creation defaults
 
    defs = Setting.get_default_repo_settings(strip_prefix=True)
 
    enable_statistics = defs.get('repo_enable_statistics')
0 comments (0 inline, 0 general)