| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 from StringIO import StringIO | 7 from StringIO import StringIO |
| 8 import time |
| 8 import traceback | 9 import traceback |
| 9 | 10 |
| 10 from appengine_wrappers import ( | 11 from appengine_wrappers import ( |
| 11 DeadlineExceededError, IsDevServer, logservice, memcache, urlfetch, webapp) | 12 DeadlineExceededError, IsDevServer, logservice, memcache, urlfetch, webapp) |
| 12 from branch_utility import BranchUtility | 13 from branch_utility import BranchUtility |
| 13 from server_instance import ServerInstance | 14 from server_instance import ServerInstance |
| 14 import svn_constants | 15 import svn_constants |
| 15 import time | |
| 16 | 16 |
| 17 # The default channel to serve docs for if no channel is specified. | 17 # The default channel to serve docs for if no channel is specified. |
| 18 _DEFAULT_CHANNEL = 'stable' | 18 _DEFAULT_CHANNEL = 'stable' |
| 19 | 19 |
| 20 class Handler(webapp.RequestHandler): | 20 class Handler(webapp.RequestHandler): |
| 21 # AppEngine instances should never need to call out to SVN. That should only | 21 # AppEngine instances should never need to call out to SVN. That should only |
| 22 # ever be done by the cronjobs, which then write the result into DataStore, | 22 # ever be done by the cronjobs, which then write the result into DataStore, |
| 23 # which is as far as instances look. | 23 # which is as far as instances look. |
| 24 # | 24 # |
| 25 # Why? SVN is slow and a bit flaky. Cronjobs failing is annoying but | 25 # Why? SVN is slow and a bit flaky. Cronjobs failing is annoying but |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 # file paths will know to treat this as a directory. | 212 # file paths will know to treat this as a directory. |
| 213 if os.path.splitext(path)[1] == '' and path[-1] != '/': | 213 if os.path.splitext(path)[1] == '' and path[-1] != '/': |
| 214 self.redirect(path + '/') | 214 self.redirect(path + '/') |
| 215 return | 215 return |
| 216 | 216 |
| 217 path = path.strip('/') | 217 path = path.strip('/') |
| 218 if self._RedirectFromCodeDotGoogleDotCom(path): | 218 if self._RedirectFromCodeDotGoogleDotCom(path): |
| 219 return | 219 return |
| 220 | 220 |
| 221 self._HandleGet(path) | 221 self._HandleGet(path) |
| OLD | NEW |