# HG changeset patch # User Marcin Kuzminski # Date 2013-03-24 18:58:24 # Node ID 11feddcd75bb636731e1280a61847a4ebb1c1540 # Parent f3283898d431a52244c549a440eec8a975f9f828 after hooks cleanup we don't need to have ui injections into repo so we don't need to cache git repos - change to @property fixes all odd concurrency issues with zlib decompressions diff --git a/rhodecode/lib/middleware/simplegit.py b/rhodecode/lib/middleware/simplegit.py --- a/rhodecode/lib/middleware/simplegit.py +++ b/rhodecode/lib/middleware/simplegit.py @@ -317,7 +317,6 @@ class SimpleGit(BaseVCSController): from rhodecode.model.db import Repository _repo = Repository.get_by_repo_name(repo_name) _repo = _repo.scm_instance - _repo._repo.ui = baseui _hooks = dict(baseui.configitems('hooks')) or {} if action == 'pull': diff --git a/rhodecode/lib/vcs/backends/git/repository.py b/rhodecode/lib/vcs/backends/git/repository.py --- a/rhodecode/lib/vcs/backends/git/repository.py +++ b/rhodecode/lib/vcs/backends/git/repository.py @@ -64,7 +64,7 @@ class GitRepository(BaseRepository): abspath(get_user_home(), '.gitconfig'), ] - @ThreadLocalLazyProperty + @property def _repo(self): return Repo(self.path) @@ -419,7 +419,9 @@ class GitRepository(BaseRepository): return self._get_parsed_refs() def _get_parsed_refs(self): - refs = self._repo.get_refs() + # cache the property + _repo = self._repo + refs = _repo.get_refs() keys = [('refs/heads/', 'H'), ('refs/remotes/origin/', 'RH'), ('refs/tags/', 'T')] @@ -429,9 +431,9 @@ class GitRepository(BaseRepository): if ref.startswith(k): _key = ref[len(k):] if type_ == 'T': - obj = self._repo.get_object(sha) + obj = _repo.get_object(sha) if isinstance(obj, Tag): - sha = self._repo.get_object(sha).object[1] + sha = _repo.get_object(sha).object[1] _refs[_key] = [sha, type_] break return _refs