Make apply_issue fail if the content of a large file is missing.

Currently apply_issue fail if the content of a newly added file is
missing (because of the 900ko threshold in upload.py). But this doesn't
apply to the large file that get modified (instead of being added). This
is wrong because apply_issue will indicates a success without really
applying the patch.

It looks like the patch content is set to "None" in this cases (the string
value, not the empty value None).

Review URL: https://codereview.chromium.org/1612323004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298366 0039d316-1c4b-4281-b951-d872f2087c98
parent c0ff2f64
......@@ -148,7 +148,7 @@ class Rietveld(object):
out.append(patch.FilePatchDelete(filename, state['is_binary']))
else:
content = self.get_file_content(issue, patchset, state['id'])
if not content:
if not content or content == 'None':
# As a precaution due to a bug in upload.py for git checkout, refuse
# empty files. If it's empty, it's not a binary file.
raise patch.UnsupportedPatchFormat(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment