Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: chrome/common/extensions/docs/server2/refresh_servlet.py

Issue 684113003: Docserver: Default to master commit ID on refresh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oops Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/cron.yaml ('k') | chrome/common/extensions/docs/server2/rietveld_patcher.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698