| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 traceback | 5 import traceback |
| 6 | 6 |
| 7 from app_yaml_helper import AppYamlHelper | 7 from app_yaml_helper import AppYamlHelper |
| 8 from appengine_wrappers import IsDeadlineExceededError, logservice, taskqueue | 8 from appengine_wrappers import IsDeadlineExceededError, logservice, taskqueue |
| 9 from branch_utility import BranchUtility | 9 from branch_utility import BranchUtility |
| 10 from commit_tracker import CommitTracker | 10 from commit_tracker import CommitTracker |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 commit = self._request.arguments['commit'] | 83 commit = self._request.arguments['commit'] |
| 84 else: | 84 else: |
| 85 _log.warning('No commit given; refreshing from master. ' | 85 _log.warning('No commit given; refreshing from master. ' |
| 86 'This is probably NOT what you want.') | 86 'This is probably NOT what you want.') |
| 87 commit = None | 87 commit = None |
| 88 | 88 |
| 89 server_instance = self._CreateServerInstance(commit) | 89 server_instance = self._CreateServerInstance(commit) |
| 90 commit_tracker = CommitTracker(server_instance.object_store_creator) | 90 commit_tracker = CommitTracker(server_instance.object_store_creator) |
| 91 refresh_tracker = RefreshTracker(server_instance.object_store_creator) | 91 refresh_tracker = RefreshTracker(server_instance.object_store_creator) |
| 92 | 92 |
| 93 # If no commit was given, use the ID of the last cached master commit. |
| 94 # This allows sources external to the chromium repository to be updated |
| 95 # independently from individual refresh cycles. |
| 96 if commit is None: |
| 97 commit = commit_tracker.Get('master').Get() |
| 98 |
| 93 success = True | 99 success = True |
| 94 try: | 100 try: |
| 95 if source_name == 'platform_bundle': | 101 if source_name == 'platform_bundle': |
| 96 data_source = server_instance.platform_bundle | 102 data_source = server_instance.platform_bundle |
| 97 elif source_name == 'content_providers': | 103 elif source_name == 'content_providers': |
| 98 data_source = server_instance.content_providers | 104 data_source = server_instance.content_providers |
| 99 else: | 105 else: |
| 100 data_source = CreateDataSource(source_name, server_instance) | 106 data_source = CreateDataSource(source_name, server_instance) |
| 101 | 107 |
| 102 class_name = data_source.__class__.__name__ | 108 class_name = data_source.__class__.__name__ |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 github_file_system_provider = self._delegate.CreateGithubFileSystemProvider( | 154 github_file_system_provider = self._delegate.CreateGithubFileSystemProvider( |
| 149 object_store_creator) | 155 object_store_creator) |
| 150 gcs_file_system_provider = self._delegate.CreateGCSFileSystemProvider( | 156 gcs_file_system_provider = self._delegate.CreateGCSFileSystemProvider( |
| 151 object_store_creator) | 157 object_store_creator) |
| 152 return ServerInstance(object_store_creator, | 158 return ServerInstance(object_store_creator, |
| 153 CompiledFileSystem.Factory(object_store_creator), | 159 CompiledFileSystem.Factory(object_store_creator), |
| 154 branch_utility, | 160 branch_utility, |
| 155 host_file_system_provider, | 161 host_file_system_provider, |
| 156 github_file_system_provider, | 162 github_file_system_provider, |
| 157 gcs_file_system_provider) | 163 gcs_file_system_provider) |
| OLD | NEW |