Mercurial > kallithea
comparison pylons_app/lib/middleware/simplehg.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 | 48727add84c9 |
children | 3782a6d698af |
comparison
equal
deleted
inserted
replaced
247:51434007e21d | 248:fb7f066126cc |
---|---|
48 REMOTE_USER.update(environ, result) | 48 REMOTE_USER.update(environ, result) |
49 else: | 49 else: |
50 return result.wsgi_application(environ, start_response) | 50 return result.wsgi_application(environ, start_response) |
51 | 51 |
52 try: | 52 try: |
53 repo_name = environ['PATH_INFO'].split('/')[1] | 53 repo_name = '/'.join(environ['PATH_INFO'].split('/')[1:]) |
54 except: | 54 except Exception as e: |
55 log.error(e) | |
55 return HTTPNotFound()(environ, start_response) | 56 return HTTPNotFound()(environ, start_response) |
56 | 57 |
57 #since we wrap into hgweb, just reset the path | 58 #since we wrap into hgweb, just reset the path |
58 environ['PATH_INFO'] = '/' | 59 environ['PATH_INFO'] = '/' |
59 self.baseui = make_ui(self.config['hg_app_repo_conf']) | 60 self.baseui = make_ui(self.config['hg_app_repo_conf']) |
61 .replace('*', '') | 62 .replace('*', '') |
62 self.repo_path = os.path.join(self.basepath, repo_name) | 63 self.repo_path = os.path.join(self.basepath, repo_name) |
63 try: | 64 try: |
64 app = wsgiapplication(self.__make_app) | 65 app = wsgiapplication(self.__make_app) |
65 except Exception as e: | 66 except Exception as e: |
67 log.error(e) | |
66 return HTTPNotFound()(environ, start_response) | 68 return HTTPNotFound()(environ, start_response) |
67 action = self.__get_action(environ) | 69 action = self.__get_action(environ) |
68 #invalidate cache on push | 70 #invalidate cache on push |
69 if action == 'push': | 71 if action == 'push': |
70 self.__invalidate_cache(repo_name) | 72 self.__invalidate_cache(repo_name) |