Changeset - 092e897458fa
[Not reviewed]
default
0 1 0
Mads Kiilerich (mads) - 5 years ago 2021-04-21 14:52:00
mads@kiilerich.com
hg: read hgrc, also in repo_scan

This might make a difference in some real world cases.
1 file changed with 1 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/model/scm.py
Show inline comments
 
@@ -163,38 +163,37 @@ class ScmModel(object):
 
        Listing of repositories in given path. This path should not be a
 
        repository itself. Return a dictionary of repository objects mapping to
 
        vcs instances.
 

	
 
        :param repos_path: path to directory containing repositories
 
        """
 

	
 
        if repos_path is None:
 
            repos_path = self.repos_path
 

	
 
        log.info('scanning for repositories in %s', repos_path)
 

	
 
        baseui = make_ui()
 
        repos = {}
 

	
 
        for name, path in get_filesystem_repos(repos_path):
 
            # name need to be decomposed and put back together using the /
 
            # since this is internal storage separator for kallithea
 
            name = db.Repository.normalize_repo_name(name)
 

	
 
            try:
 
                if name in repos:
 
                    raise RepositoryError('Duplicate repository name %s '
 
                                          'found in %s' % (name, path))
 
                else:
 
                    repos[name] = get_repo(path[1], baseui=baseui)
 
                    repos[name] = get_repo(path[1], baseui=make_ui(path[1]))
 
            except (OSError, VCSError):
 
                continue
 
        log.debug('found %s paths with repositories', len(repos))
 
        return repos
 

	
 
    def get_repos(self, repos):
 
        """Return the repos the user has access to"""
 
        return RepoList(repos, perm_level='read')
 

	
 
    def get_repo_groups(self, groups=None):
 
        """Return the repo groups the user has access to
 
        If no groups are specified, use top level groups.
0 comments (0 inline, 0 general)