Changeset - e4a4006faceb
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2013-03-19 23:43:40
marcin@python-works.com
no_cache version of scm is now a function
2 files changed with 2 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/hooks.py
Show inline comments
 
@@ -416,13 +416,13 @@ def handle_git_receive(repo_path, revs, 
 
    for k, v in extras.items():
 
        baseui.setconfig('rhodecode_extras', k, v)
 
    if hook_type == 'pre':
 
        repo = repo.scm_instance
 
    else:
 
        #post push shouldn't use the cached instance never
 
        repo = repo.scm_instance_no_cache
 
        repo = repo.scm_instance_no_cache()
 

	
 
    repo.ui = baseui
 

	
 
    if hook_type == 'pre':
 
        pre_push(baseui, repo)
 

	
rhodecode/model/db.py
Show inline comments
 
@@ -1053,13 +1053,13 @@ class Repository(Base, BaseModel):
 
        :param cs_cache:
 
        """
 
        from rhodecode.lib.vcs.backends.base import BaseChangeset
 
        if cs_cache is None:
 
            cs_cache = EmptyChangeset()
 
            # use no-cache version here
 
            scm_repo = self.scm_instance_no_cache
 
            scm_repo = self.scm_instance_no_cache()
 
            if scm_repo:
 
                cs_cache = scm_repo.get_changeset()
 

	
 
        if isinstance(cs_cache, BaseChangeset):
 
            cs_cache = cs_cache.__json__()
 

	
 
@@ -1150,13 +1150,12 @@ class Repository(Base, BaseModel):
 
    def set_invalidate(self):
 
        """
 
        set a cache for invalidation for this instance
 
        """
 
        CacheInvalidation.set_invalidate(repo_name=self.repo_name)
 

	
 
    @LazyProperty
 
    def scm_instance_no_cache(self):
 
        return self.__get_instance()
 

	
 
    @LazyProperty
 
    def scm_instance(self):
 
        import rhodecode
0 comments (0 inline, 0 general)