# HG changeset patch # User RhodeCode Admin # Date 2022-09-01 20:00:13 # Node ID 77c2f985a1229de00b934c64c6ecac59f45beb5e # Parent 06411f9c19086a3186f001599adc03ae61d85afa caches: make sure we init caches on repo names withou '/' to not create a new cache subpath diff --git a/rhodecode/lib/rc_cache/backends.py b/rhodecode/lib/rc_cache/backends.py --- a/rhodecode/lib/rc_cache/backends.py +++ b/rhodecode/lib/rc_cache/backends.py @@ -168,7 +168,7 @@ class FileNamespaceBackend(PickleSeriali try: super(FileNamespaceBackend, self).__init__(arguments) except Exception: - log.error('Failed to initialize db at: %s', db_file) + log.exception('Failed to initialize db at: %s', db_file) raise def __repr__(self): diff --git a/rhodecode/lib/vcs/client_http.py b/rhodecode/lib/vcs/client_http.py --- a/rhodecode/lib/vcs/client_http.py +++ b/rhodecode/lib/vcs/client_http.py @@ -186,7 +186,7 @@ class RemoteRepo(object): self.stream_url = remote_maker.stream_url self._session = remote_maker._session_factory() self._cache_region, self._cache_namespace = \ - remote_maker.init_cache_region(repo_id) + remote_maker.init_cache_region(self._repo_id_sanitizer(repo_id)) with_wire = with_wire or {} @@ -209,6 +209,9 @@ class RemoteRepo(object): self.cert_dir = get_cert_path(rhodecode.CONFIG.get('__file__')) + def _repo_id_sanitizer(self, repo_id): + return repo_id.replace('/', '__') + def __getattr__(self, name): if name.startswith('stream:'): diff --git a/rhodecode/model/repo.py b/rhodecode/model/repo.py --- a/rhodecode/model/repo.py +++ b/rhodecode/model/repo.py @@ -940,7 +940,8 @@ class RepoModel(BaseModel): if landing_rev_name.startswith('branch:'): landing_rev_name = landing_rev_name.split('branch:')[-1] scm_instance = repo.scm_instance() - return scm_instance._remote.set_head_ref(landing_rev_name) + if scm_instance: + return scm_instance._remote.set_head_ref(landing_rev_name) def _create_filesystem_repo(self, repo_name, repo_type, repo_group, clone_uri=None, repo_store_location=None,