Mercurial > kallithea
comparison rhodecode/lib/base.py @ 659:758f64f3fbda beta
extended repo creation by repo type. fixed fork creation to maintain repo type.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 05 Nov 2010 21:55:30 +0100 |
parents | 7e536d1af60d |
children | 070f32743632 |
comparison
equal
deleted
inserted
replaced
658:4ecb2ffcc110 | 659:758f64f3fbda |
---|---|
9 from rhodecode.lib import auth | 9 from rhodecode.lib import auth |
10 from rhodecode.lib.utils import get_repo_slug | 10 from rhodecode.lib.utils import get_repo_slug |
11 from rhodecode.model import meta | 11 from rhodecode.model import meta |
12 from rhodecode.model.hg import _get_repos_cached, \ | 12 from rhodecode.model.hg import _get_repos_cached, \ |
13 _get_repos_switcher_cached | 13 _get_repos_switcher_cached |
14 from vcs import BACKENDS | |
15 class BaseController(WSGIController): | |
14 | 16 |
15 class BaseController(WSGIController): | |
16 | |
17 def __before__(self): | 17 def __before__(self): |
18 c.rhodecode_version = __version__ | 18 c.rhodecode_version = __version__ |
19 c.rhodecode_name = config['rhodecode_title'] | 19 c.rhodecode_name = config['rhodecode_title'] |
20 c.repo_name = get_repo_slug(request) | 20 c.repo_name = get_repo_slug(request) |
21 c.cached_repo_list = _get_repos_cached() | 21 c.cached_repo_list = _get_repos_cached() |
22 c.repo_switcher_list = _get_repos_switcher_cached(c.cached_repo_list) | 22 c.repo_switcher_list = _get_repos_switcher_cached(c.cached_repo_list) |
23 | 23 c.backends = BACKENDS.keys() |
24 if c.repo_name: | 24 if c.repo_name: |
25 cached_repo = c.cached_repo_list.get(c.repo_name) | 25 cached_repo = c.cached_repo_list.get(c.repo_name) |
26 | 26 |
27 if cached_repo: | 27 if cached_repo: |
28 c.repository_tags = cached_repo.tags | 28 c.repository_tags = cached_repo.tags |
29 c.repository_branches = cached_repo.branches | 29 c.repository_branches = cached_repo.branches |
30 else: | 30 else: |
31 c.repository_tags = {} | 31 c.repository_tags = {} |
32 c.repository_branches = {} | 32 c.repository_branches = {} |
33 | 33 |
34 self.sa = meta.Session() | 34 self.sa = meta.Session() |
35 | 35 |
36 def __call__(self, environ, start_response): | 36 def __call__(self, environ, start_response): |
37 """Invoke the Controller""" | 37 """Invoke the Controller""" |
38 # WSGIController.__call__ dispatches to the Controller method | 38 # WSGIController.__call__ dispatches to the Controller method |
39 # the request is routed to. This routing information is | 39 # the request is routed to. This routing information is |
40 # available in environ['pylons.routes_dict'] | 40 # available in environ['pylons.routes_dict'] |