Mercurial > kallithea
changeset 690:4685f3eafd35 beta
Fixed sumamry page description bug
Some internal changes into repository building.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 14 Nov 2010 22:18:51 +0100 |
parents | ecc566f8b69f |
children | 7486da5f0628 |
files | rhodecode/model/hg.py rhodecode/templates/summary/summary.html |
diffstat | 2 files changed, 20 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/model/hg.py Sun Nov 14 19:57:14 2010 +0100 +++ b/rhodecode/model/hg.py Sun Nov 14 22:18:51 2010 +0100 @@ -28,11 +28,10 @@ from rhodecode.lib.auth import HasRepoPermissionAny from rhodecode.lib.utils import get_repos from rhodecode.model import meta -from rhodecode.model.caching_query import FromCache from rhodecode.model.db import Repository, User, RhodeCodeUi from sqlalchemy.orm import joinedload -from vcs import get_repo as vcs_get_repo, get_backend -from vcs.backends.hg import MercurialRepository +from vcs import get_backend +from vcs.utils.helpers import get_scm from vcs.exceptions import RepositoryError, VCSError from vcs.utils.lazy import LazyProperty import logging @@ -76,6 +75,7 @@ if not isinstance(baseui, ui.ui): baseui = ui.ui() repos_list = {} + for name, path in get_repos(repos_path): try: if repos_list.has_key(name): @@ -97,8 +97,10 @@ def get_repos(self, all_repos=None): """ - Get all repos from db and for each such repo make backend and - fetch dependent data from db + Get all repos from db and for each repo create it's backend instance. + and fill that backed with information from database + + :param all_repos: give specific repositories list, good for filtering """ if not all_repos: all_repos = self.sa.query(Repository).all() @@ -144,12 +146,19 @@ @cache_region('long_term', 'get_repo_cached_%s' % repo_name) def _get_repo(repo_name): - repo = vcs_get_repo(os.path.join(self.repos_path, repo_name), - alias=None, create=False) + repo_path = os.path.join(self.repos_path, repo_name) + alias = get_scm(repo_path)[0] + + log.debug('Creating instance of %s repository', alias) + backend = get_backend(alias) - #skip hidden web repository - if isinstance(repo, MercurialRepository) and repo._get_hidden(): - return + if alias == 'hg': + repo = backend(repo_path, create=False, baseui=None) + #skip hidden web repository + if repo._get_hidden(): + return + else: + repo = backend(repo_path, create=False) dbrepo = self.sa.query(Repository)\ .options(joinedload(Repository.fork))\
--- a/rhodecode/templates/summary/summary.html Sun Nov 14 19:57:14 2010 +0100 +++ b/rhodecode/templates/summary/summary.html Sun Nov 14 22:18:51 2010 +0100 @@ -75,7 +75,7 @@ <label>${_('Description')}:</label> </div> <div class="input-short"> - ${c.repo_info.description} + ${c.repo_info.dbrepo.description} </div> </div>