comparison pylons_app/lib/utils.py @ 248:fb7f066126cc

Added support for repository located in subdirectories.
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 03 Jun 2010 20:28:46 +0200
parents a83a1799480c
children 3782a6d698af
comparison
equal deleted inserted replaced
247:51434007e21d 248:fb7f066126cc
4 from mercurial.error import RepoError 4 from mercurial.error import RepoError
5 log = logging.getLogger(__name__) 5 log = logging.getLogger(__name__)
6 6
7 7
8 def get_repo_slug(request): 8 def get_repo_slug(request):
9 path_info = request.environ.get('PATH_INFO') 9 return request.environ['pylons.routes_dict'].get('repo_name')
10 uri_lst = path_info.split('/')
11 repo_name = uri_lst[1]
12 return repo_name
13 10
14 def is_mercurial(environ): 11 def is_mercurial(environ):
15 """ 12 """
16 Returns True if request's target is mercurial server - header 13 Returns True if request's target is mercurial server - header
17 ``HTTP_ACCEPT`` of such request would start with ``application/mercurial``. 14 ``HTTP_ACCEPT`` of such request would start with ``application/mercurial``.
129 return '0' * 12 126 return '0' * 12
130 127
131 128
132 def repo2db_mapper(): 129 def repo2db_mapper():
133 """ 130 """
134 put ! 131 scann all dirs for .hgdbid
132 if some dir doesn't have one generate one.
135 """ 133 """
136 pass 134 pass
137 #scann all dirs for .hgdbid
138 #if some dir doesn't have one generate one.
139 #
140
141
142
143
144