Show More
@@ -28,11 +28,10 b' from rhodecode.lib import helpers as h' | |||||
28 | from rhodecode.lib.auth import HasRepoPermissionAny |
|
28 | from rhodecode.lib.auth import HasRepoPermissionAny | |
29 | from rhodecode.lib.utils import get_repos |
|
29 | from rhodecode.lib.utils import get_repos | |
30 | from rhodecode.model import meta |
|
30 | from rhodecode.model import meta | |
31 | from rhodecode.model.caching_query import FromCache |
|
|||
32 | from rhodecode.model.db import Repository, User, RhodeCodeUi |
|
31 | from rhodecode.model.db import Repository, User, RhodeCodeUi | |
33 | from sqlalchemy.orm import joinedload |
|
32 | from sqlalchemy.orm import joinedload | |
34 |
from vcs import |
|
33 | from vcs import get_backend | |
35 | from vcs.backends.hg import MercurialRepository |
|
34 | from vcs.utils.helpers import get_scm | |
36 | from vcs.exceptions import RepositoryError, VCSError |
|
35 | from vcs.exceptions import RepositoryError, VCSError | |
37 | from vcs.utils.lazy import LazyProperty |
|
36 | from vcs.utils.lazy import LazyProperty | |
38 | import logging |
|
37 | import logging | |
@@ -76,6 +75,7 b' class HgModel(object):' | |||||
76 | if not isinstance(baseui, ui.ui): |
|
75 | if not isinstance(baseui, ui.ui): | |
77 | baseui = ui.ui() |
|
76 | baseui = ui.ui() | |
78 | repos_list = {} |
|
77 | repos_list = {} | |
|
78 | ||||
79 | for name, path in get_repos(repos_path): |
|
79 | for name, path in get_repos(repos_path): | |
80 | try: |
|
80 | try: | |
81 | if repos_list.has_key(name): |
|
81 | if repos_list.has_key(name): | |
@@ -97,8 +97,10 b' class HgModel(object):' | |||||
97 |
|
97 | |||
98 | def get_repos(self, all_repos=None): |
|
98 | def get_repos(self, all_repos=None): | |
99 | """ |
|
99 | """ | |
100 |
Get all repos from db and for each |
|
100 | Get all repos from db and for each repo create it's backend instance. | |
101 | fetch dependent data from db |
|
101 | and fill that backed with information from database | |
|
102 | ||||
|
103 | :param all_repos: give specific repositories list, good for filtering | |||
102 | """ |
|
104 | """ | |
103 | if not all_repos: |
|
105 | if not all_repos: | |
104 | all_repos = self.sa.query(Repository).all() |
|
106 | all_repos = self.sa.query(Repository).all() | |
@@ -144,12 +146,19 b' class HgModel(object):' | |||||
144 | @cache_region('long_term', 'get_repo_cached_%s' % repo_name) |
|
146 | @cache_region('long_term', 'get_repo_cached_%s' % repo_name) | |
145 | def _get_repo(repo_name): |
|
147 | def _get_repo(repo_name): | |
146 |
|
148 | |||
147 |
repo = |
|
149 | repo_path = os.path.join(self.repos_path, repo_name) | |
148 | alias=None, create=False) |
|
150 | alias = get_scm(repo_path)[0] | |
|
151 | ||||
|
152 | log.debug('Creating instance of %s repository', alias) | |||
|
153 | backend = get_backend(alias) | |||
149 |
|
154 | |||
150 | #skip hidden web repository |
|
155 | if alias == 'hg': | |
151 | if isinstance(repo, MercurialRepository) and repo._get_hidden(): |
|
156 | repo = backend(repo_path, create=False, baseui=None) | |
152 |
|
|
157 | #skip hidden web repository | |
|
158 | if repo._get_hidden(): | |||
|
159 | return | |||
|
160 | else: | |||
|
161 | repo = backend(repo_path, create=False) | |||
153 |
|
162 | |||
154 | dbrepo = self.sa.query(Repository)\ |
|
163 | dbrepo = self.sa.query(Repository)\ | |
155 | .options(joinedload(Repository.fork))\ |
|
164 | .options(joinedload(Repository.fork))\ |
@@ -75,7 +75,7 b' E.onDOMReady(function(e){' | |||||
75 | <label>${_('Description')}:</label> |
|
75 | <label>${_('Description')}:</label> | |
76 | </div> |
|
76 | </div> | |
77 | <div class="input-short"> |
|
77 | <div class="input-short"> | |
78 | ${c.repo_info.description} |
|
78 | ${c.repo_info.dbrepo.description} | |
79 | </div> |
|
79 | </div> | |
80 | </div> |
|
80 | </div> | |
81 |
|
81 |
General Comments 0
You need to be logged in to leave comments.
Login now