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

Side by Side Diff: rietveld.py

Issue 1612323004: Make apply_issue fail if the content of a large file is missing. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 11 months 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 | « no previous file | 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 # coding: utf-8 1 # coding: utf-8
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 """Defines class Rietveld to easily access a rietveld instance. 5 """Defines class Rietveld to easily access a rietveld instance.
6 6
7 Security implications: 7 Security implications:
8 8
9 The following hypothesis are made: 9 The following hypothesis are made:
10 - Rietveld enforces: 10 - Rietveld enforces:
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 state.get('property_changes', ''), filename) 141 state.get('property_changes', ''), filename)
142 142
143 if state.get('is_binary'): 143 if state.get('is_binary'):
144 if status[0] == 'D': 144 if status[0] == 'D':
145 if status[0] != status.strip(): 145 if status[0] != status.strip():
146 raise patch.UnsupportedPatchFormat( 146 raise patch.UnsupportedPatchFormat(
147 filename, 'Deleted file shouldn\'t have property change.') 147 filename, 'Deleted file shouldn\'t have property change.')
148 out.append(patch.FilePatchDelete(filename, state['is_binary'])) 148 out.append(patch.FilePatchDelete(filename, state['is_binary']))
149 else: 149 else:
150 content = self.get_file_content(issue, patchset, state['id']) 150 content = self.get_file_content(issue, patchset, state['id'])
151 if not content: 151 if not content or content == 'None':
tandrii(chromium) 2016/01/22 21:08:25 ugh, but whatever works.
Sébastien Marchand 2016/01/22 21:11:20 Yeah, this is ugly and it took me quite some time
152 # As a precaution due to a bug in upload.py for git checkout, refuse 152 # As a precaution due to a bug in upload.py for git checkout, refuse
153 # empty files. If it's empty, it's not a binary file. 153 # empty files. If it's empty, it's not a binary file.
154 raise patch.UnsupportedPatchFormat( 154 raise patch.UnsupportedPatchFormat(
155 filename, 155 filename,
156 'Binary file is empty. Maybe the file wasn\'t uploaded in the ' 156 'Binary file is empty. Maybe the file wasn\'t uploaded in the '
157 'first place?') 157 'first place?')
158 out.append(patch.FilePatchBinary( 158 out.append(patch.FilePatchBinary(
159 filename, 159 filename,
160 content, 160 content,
161 svn_props, 161 svn_props,
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 self, issue, patchset, reason, clobber, revision, builders_and_tests, 737 self, issue, patchset, reason, clobber, revision, builders_and_tests,
738 master=None, category='cq'): 738 master=None, category='cq'):
739 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % 739 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' %
740 (builders_and_tests, issue)) 740 (builders_and_tests, issue))
741 741
742 def trigger_distributed_try_jobs( # pylint:disable=R0201 742 def trigger_distributed_try_jobs( # pylint:disable=R0201
743 self, issue, patchset, reason, clobber, revision, masters, 743 self, issue, patchset, reason, clobber, revision, masters,
744 category='cq'): 744 category='cq'):
745 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % 745 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' %
746 (masters, issue)) 746 (masters, issue))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698