| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 | 5 |
| 6 # TODO(hinoka): Use logging. | 6 # TODO(hinoka): Use logging. |
| 7 | 7 |
| 8 import cStringIO | 8 import cStringIO |
| 9 import codecs | 9 import codecs |
| 10 import collections | 10 import collections |
| (...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 if patchset: | 1120 if patchset: |
| 1121 cmd.extend(['--patchset', patchset]) | 1121 cmd.extend(['--patchset', patchset]) |
| 1122 if whitelist: | 1122 if whitelist: |
| 1123 for item in whitelist: | 1123 for item in whitelist: |
| 1124 cmd.extend(['--whitelist', item]) | 1124 cmd.extend(['--whitelist', item]) |
| 1125 elif blacklist: | 1125 elif blacklist: |
| 1126 for item in blacklist: | 1126 for item in blacklist: |
| 1127 cmd.extend(['--blacklist', item]) | 1127 cmd.extend(['--blacklist', item]) |
| 1128 | 1128 |
| 1129 # TODO(kjellander): Remove this hack when http://crbug.com/611808 is fixed. | 1129 # TODO(kjellander): Remove this hack when http://crbug.com/611808 is fixed. |
| 1130 if root == 'src/third_party/webrtc': | 1130 if root == path.join('src', 'third_party', 'webrtc'): |
| 1131 cmd.extend(['--extra_patchlevel=1']) | 1131 cmd.extend(['--extra_patchlevel=1']) |
| 1132 | 1132 |
| 1133 # Only try once, since subsequent failures hide the real failure. | 1133 # Only try once, since subsequent failures hide the real failure. |
| 1134 try: | 1134 try: |
| 1135 call(*cmd, tries=1) | 1135 call(*cmd, tries=1) |
| 1136 except SubprocessFailed as e: | 1136 except SubprocessFailed as e: |
| 1137 raise PatchFailed(e.message, e.code, e.output) | 1137 raise PatchFailed(e.message, e.code, e.output) |
| 1138 | 1138 |
| 1139 def apply_gerrit_ref(gerrit_repo, gerrit_ref, root, gerrit_reset): | 1139 def apply_gerrit_ref(gerrit_repo, gerrit_ref, root, gerrit_reset): |
| 1140 gerrit_repo = gerrit_repo or 'origin' | 1140 gerrit_repo = gerrit_repo or 'origin' |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1772 except Exception: | 1772 except Exception: |
| 1773 # Unexpected failure. | 1773 # Unexpected failure. |
| 1774 emit_flag(options.flag_file) | 1774 emit_flag(options.flag_file) |
| 1775 raise | 1775 raise |
| 1776 else: | 1776 else: |
| 1777 emit_flag(options.flag_file) | 1777 emit_flag(options.flag_file) |
| 1778 | 1778 |
| 1779 | 1779 |
| 1780 if __name__ == '__main__': | 1780 if __name__ == '__main__': |
| 1781 sys.exit(main()) | 1781 sys.exit(main()) |
| OLD | NEW |