diff 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
line wrap: on
line diff
--- a/pylons_app/lib/middleware/simplehg.py	Thu Jun 03 16:01:47 2010 +0200
+++ b/pylons_app/lib/middleware/simplehg.py	Thu Jun 03 20:28:46 2010 +0200
@@ -50,8 +50,9 @@
                     return result.wsgi_application(environ, start_response)
             
             try:
-                repo_name = environ['PATH_INFO'].split('/')[1]
-            except:
+                repo_name = '/'.join(environ['PATH_INFO'].split('/')[1:])
+            except Exception as e:
+                log.error(e)
                 return HTTPNotFound()(environ, start_response)
             
             #since we wrap into hgweb, just reset the path
@@ -63,6 +64,7 @@
             try:
                 app = wsgiapplication(self.__make_app)
             except Exception as e:
+                log.error(e)
                 return HTTPNotFound()(environ, start_response)
             action = self.__get_action(environ)            
             #invalidate cache on push