Mercurial > kallithea
comparison pylons_app/lib/middleware/simplehg.py @ 503:3d6d548ad3cc
Added user action mapper to map push to changeset.
made exception in simplehg python 2.5 ready
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 24 Sep 2010 18:13:29 +0200 |
parents | 946d8a680a1d |
children | 39203995f2c4 |
comparison
equal
deleted
inserted
replaced
502:ac32a026c306 | 503:3d6d548ad3cc |
---|---|
119 #quick check if that dir exists... | 119 #quick check if that dir exists... |
120 if check_repo_fast(repo_name, self.basepath): | 120 if check_repo_fast(repo_name, self.basepath): |
121 return HTTPNotFound()(environ, start_response) | 121 return HTTPNotFound()(environ, start_response) |
122 try: | 122 try: |
123 app = wsgiapplication(self.__make_app) | 123 app = wsgiapplication(self.__make_app) |
124 except RepoError as e: | 124 except RepoError, e: |
125 if str(e).find('not found') != -1: | 125 if str(e).find('not found') != -1: |
126 return HTTPNotFound()(environ, start_response) | 126 return HTTPNotFound()(environ, start_response) |
127 except Exception: | 127 except Exception: |
128 log.error(traceback.format_exc()) | 128 log.error(traceback.format_exc()) |
129 return HTTPInternalServerError()(environ, start_response) | 129 return HTTPInternalServerError()(environ, start_response) |
193 user_log.user_ip = ipaddr | 193 user_log.user_ip = ipaddr |
194 sa.add(user_log) | 194 sa.add(user_log) |
195 sa.commit() | 195 sa.commit() |
196 log.info('Adding user %s, action %s on %s', | 196 log.info('Adding user %s, action %s on %s', |
197 user.username, action, repo) | 197 user.username, action, repo) |
198 except Exception as e: | 198 except Exception, e: |
199 sa.rollback() | 199 sa.rollback() |
200 log.error('could not log user action:%s', str(e)) | 200 log.error('could not log user action:%s', str(e)) |
201 finally: | 201 finally: |
202 meta.Session.remove() | 202 meta.Session.remove() |
203 | 203 |