# HG changeset patch # User Marcin Kuzminski # Date 2019-07-24 08:43:11 # Node ID 707232aea5c57cd64df7f1920620b5411e3bb0c0 # Parent 2bc3e4d7c81c71fb99691111ad1970a772a9ce0a caches: enable no-cache repos for certain scenarios where we explicitly don't need to cache things like gists etc. diff --git a/rhodecode/model/repo.py b/rhodecode/model/repo.py --- a/rhodecode/model/repo.py +++ b/rhodecode/model/repo.py @@ -883,11 +883,12 @@ class RepoModel(BaseModel): # TODO: johbo: Unify this, hardcoded "bare=True" does not look nice if repo_type == 'git': repo = backend( - repo_path, config=config, create=True, src_url=clone_uri, - bare=True) + repo_path, config=config, create=True, src_url=clone_uri, bare=True, + with_wire={"cache": False}) else: repo = backend( - repo_path, config=config, create=True, src_url=clone_uri) + repo_path, config=config, create=True, src_url=clone_uri, + with_wire={"cache": False}) repo.install_hooks() diff --git a/rhodecode/model/scm.py b/rhodecode/model/scm.py --- a/rhodecode/model/scm.py +++ b/rhodecode/model/scm.py @@ -226,8 +226,9 @@ class ScmModel(BaseModel): raise RepositoryError('Duplicate repository name %s ' 'found in %s' % (name, path)) elif path[0] in rhodecode.BACKENDS: - klass = get_backend(path[0]) - repos[name] = klass(path[1], config=config) + backend = get_backend(path[0]) + repos[name] = backend(path[1], config=config, + with_wire={"cache": False}) except OSError: continue log.debug('found %s paths with repositories', len(repos)) diff --git a/rhodecode/tests/plugin.py b/rhodecode/tests/plugin.py --- a/rhodecode/tests/plugin.py +++ b/rhodecode/tests/plugin.py @@ -432,11 +432,11 @@ class TestRepoContainer(object): def _create_repo(self, dump_name, backend_alias, config): repo_name = '%s-%s' % (backend_alias, dump_name) - backend_class = get_backend(backend_alias) + backend = get_backend(backend_alias) dump_extractor = self.dump_extractors[backend_alias] repo_path = dump_extractor(dump_name, repo_name) - vcs_repo = backend_class(repo_path, config=config) + vcs_repo = backend(repo_path, config=config) repo2db_mapper({repo_name: vcs_repo}) repo = RepoModel().get_by_repo_name(repo_name)