| 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 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 | 1119 |
| 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. |
| 1130 if root == 'src/third_party/webrtc': |
| 1131 cmd.extend(['--extra_patchlevel=1']) |
| 1132 |
| 1129 # Only try once, since subsequent failures hide the real failure. | 1133 # Only try once, since subsequent failures hide the real failure. |
| 1130 try: | 1134 try: |
| 1131 call(*cmd, tries=1) | 1135 call(*cmd, tries=1) |
| 1132 except SubprocessFailed as e: | 1136 except SubprocessFailed as e: |
| 1133 raise PatchFailed(e.message, e.code, e.output) | 1137 raise PatchFailed(e.message, e.code, e.output) |
| 1134 | 1138 |
| 1135 def apply_gerrit_ref(gerrit_repo, gerrit_ref, root, gerrit_reset): | 1139 def apply_gerrit_ref(gerrit_repo, gerrit_ref, root, gerrit_reset): |
| 1136 gerrit_repo = gerrit_repo or 'origin' | 1140 gerrit_repo = gerrit_repo or 'origin' |
| 1137 assert gerrit_ref | 1141 assert gerrit_ref |
| 1138 print '===Applying gerrit ref===' | 1142 print '===Applying gerrit ref===' |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1761 except Exception: | 1765 except Exception: |
| 1762 # Unexpected failure. | 1766 # Unexpected failure. |
| 1763 emit_flag(options.flag_file) | 1767 emit_flag(options.flag_file) |
| 1764 raise | 1768 raise |
| 1765 else: | 1769 else: |
| 1766 emit_flag(options.flag_file) | 1770 emit_flag(options.flag_file) |
| 1767 | 1771 |
| 1768 | 1772 |
| 1769 if __name__ == '__main__': | 1773 if __name__ == '__main__': |
| 1770 sys.exit(main()) | 1774 sys.exit(main()) |
| OLD | NEW |