Mercurial > kallithea
comparison rhodecode/model/scm.py @ 792:4c16ed1eb699 beta
fixed bug introduced in latest commit
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 29 Nov 2010 22:40:54 +0100 |
parents | 06a98912325c |
children | bb35ad076e2f |
comparison
equal
deleted
inserted
replaced
791:06a98912325c | 792:4c16ed1eb699 |
---|---|
168 """ | 168 """ |
169 if not HasRepoPermissionAny('repository.read', 'repository.write', | 169 if not HasRepoPermissionAny('repository.read', 'repository.write', |
170 'repository.admin')(repo_name, 'get repo check'): | 170 'repository.admin')(repo_name, 'get repo check'): |
171 return | 171 return |
172 | 172 |
173 pre_invalidate = True | |
174 if invalidation_list is not None: | |
175 pre_invalidate = repo_name in invalidation_list | |
176 | |
177 if pre_invalidate: | |
178 invalidate = self._should_invalidate(repo_name) | |
179 | |
180 if invalidate: | |
181 log.info('invalidating cache for repository %s', repo_name) | |
182 region_invalidate(_get_repo, None, repo_name) | |
183 self._mark_invalidated(invalidate) | |
184 | |
185 | |
186 #====================================================================== | 173 #====================================================================== |
187 # CACHE FUNCTION | 174 # CACHE FUNCTION |
188 #====================================================================== | 175 #====================================================================== |
189 @cache_region('long_term') | 176 @cache_region('long_term') |
190 def _get_repo(repo_name): | 177 def _get_repo(repo_name): |
221 if dbrepo.fork: | 208 if dbrepo.fork: |
222 make_transient(dbrepo.fork) | 209 make_transient(dbrepo.fork) |
223 | 210 |
224 repo.dbrepo = dbrepo | 211 repo.dbrepo = dbrepo |
225 return repo | 212 return repo |
213 | |
214 pre_invalidate = True | |
215 if invalidation_list is not None: | |
216 pre_invalidate = repo_name in invalidation_list | |
217 | |
218 if pre_invalidate: | |
219 invalidate = self._should_invalidate(repo_name) | |
220 | |
221 if invalidate: | |
222 log.info('invalidating cache for repository %s', repo_name) | |
223 region_invalidate(_get_repo, None, repo_name) | |
224 self._mark_invalidated(invalidate) | |
226 | 225 |
227 return _get_repo(repo_name) | 226 return _get_repo(repo_name) |
228 | 227 |
229 | 228 |
230 | 229 |