OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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)) |
OLD | NEW |