| 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 """Generate a CL to roll a DEPS entry to the specified revision number and post | 6 """Generate a CL to roll a DEPS entry to the specified revision number and post |
| 7 it to Rietveld so that the CL will land automatically if it passes the | 7 it to Rietveld so that the CL will land automatically if it passes the |
| 8 commit-queue's checks. | 8 commit-queue's checks. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import logging | 11 import logging |
| 12 import optparse | 12 import optparse |
| 13 import os | 13 import os |
| 14 import re | 14 import re |
| 15 import sys | 15 import sys |
| 16 | 16 |
| 17 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) |
| 18 SRC_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir)) |
| 19 sys.path.insert(0, os.path.join(SRC_DIR, 'build')) |
| 17 import find_depot_tools | 20 import find_depot_tools |
| 18 import scm | 21 import scm |
| 19 import subprocess2 | 22 import subprocess2 |
| 20 | 23 |
| 21 | 24 |
| 22 def die_with_error(msg): | 25 def die_with_error(msg): |
| 23 print >> sys.stderr, msg | 26 print >> sys.stderr, msg |
| 24 sys.exit(1) | 27 sys.exit(1) |
| 25 | 28 |
| 26 | 29 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 prnt_subprocess.check_call(upload_cmd) | 155 prnt_subprocess.check_call(upload_cmd) |
| 153 finally: | 156 finally: |
| 154 if not options.dry_run: | 157 if not options.dry_run: |
| 155 prnt_subprocess.check_output(['git', 'checkout', old_branch]) | 158 prnt_subprocess.check_output(['git', 'checkout', old_branch]) |
| 156 prnt_subprocess.check_output(['git', 'branch', '-D', new_branch]) | 159 prnt_subprocess.check_output(['git', 'branch', '-D', new_branch]) |
| 157 return 0 | 160 return 0 |
| 158 | 161 |
| 159 | 162 |
| 160 if __name__ == '__main__': | 163 if __name__ == '__main__': |
| 161 sys.exit(main()) | 164 sys.exit(main()) |
| OLD | NEW |