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

Side by Side Diff: chrome/common/extensions/docs/server2/rietveld_patcher.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
« no previous file with comments | « chrome/common/extensions/docs/server2/refresh_servlet.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 json 5 import json
6 import tarfile 6 import tarfile
7 from StringIO import StringIO 7 from StringIO import StringIO
8 8
9 from file_system import FileNotFoundError 9 from file_system import FileNotFoundError
10 from future import Future 10 from future import Future
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 'Failed to fetch information for issue %s.' % self._issue) 45 'Failed to fetch information for issue %s.' % self._issue)
46 46
47 if issue_json.get('closed'): 47 if issue_json.get('closed'):
48 raise RietveldPatcherError('Issue %s has been closed.' % self._issue) 48 raise RietveldPatcherError('Issue %s has been closed.' % self._issue)
49 49
50 patchsets = issue_json.get('patchsets') 50 patchsets = issue_json.get('patchsets')
51 if not isinstance(patchsets, list) or len(patchsets) == 0: 51 if not isinstance(patchsets, list) or len(patchsets) == 0:
52 raise RietveldPatcherError('Cannot parse issue %s.' % self._issue) 52 raise RietveldPatcherError('Cannot parse issue %s.' % self._issue)
53 53
54 if not issue_json.get('base_url') in _CHROMIUM_REPO_BASEURLS: 54 if not issue_json.get('base_url') in _CHROMIUM_REPO_BASEURLS:
55 raise RietveldPatcherError('Issue %s\'s base url is unknown.' % 55 raise RietveldPatcherError('Issue %s\'s base url (%s) is unknown.' %
56 self._issue) 56 (self._issue, issue_json.get('base_url')))
57 57
58 return str(patchsets[-1]) 58 return str(patchsets[-1])
59 59
60 def GetPatchedFiles(self, version=None): 60 def GetPatchedFiles(self, version=None):
61 if version is None: 61 if version is None:
62 patchset = self.GetVersion() 62 patchset = self.GetVersion()
63 else: 63 else:
64 patchset = version 64 patchset = version
65 try: 65 try:
66 patchset_json = json.loads(self._fetcher.Fetch( 66 patchset_json = json.loads(self._fetcher.Fetch(
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 patched_file.close() 133 patched_file.close()
134 134
135 value[path] = data 135 value[path] = data
136 136
137 return value 137 return value
138 return self._fetcher.FetchAsync('tarball/%s/%s' % (self._issue, 138 return self._fetcher.FetchAsync('tarball/%s/%s' % (self._issue,
139 version)).Then(apply_) 139 version)).Then(apply_)
140 140
141 def GetIdentity(self): 141 def GetIdentity(self):
142 return self._issue 142 return self._issue
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/refresh_servlet.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698