| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 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 import argparse | 6 import argparse |
| 7 import collections | 7 import collections |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| 11 import subprocess | 11 import subprocess |
| 12 import sys | 12 import sys |
| 13 import time | 13 import time |
| 14 | 14 |
| 15 | 15 |
| 16 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) | 16 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) |
| 17 SRC_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir)) | 17 SRC_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir)) |
| 18 import find_depot_tools | 18 import find_depot_tools |
| 19 find_depot_tools.add_depot_tools_to_path() | 19 find_depot_tools.add_depot_tools_to_path() |
| 20 import rietveld | 20 import rietveld |
| 21 import roll_dep | 21 import roll_dep_svn |
| 22 from gclient import GClientKeywords | 22 from gclient import GClientKeywords |
| 23 from third_party import upload | 23 from third_party import upload |
| 24 | 24 |
| 25 # Avoid depot_tools/third_party/upload.py print verbose messages. | 25 # Avoid depot_tools/third_party/upload.py print verbose messages. |
| 26 upload.verbosity = 0 # Errors only. | 26 upload.verbosity = 0 # Errors only. |
| 27 | 27 |
| 28 CHROMIUM_GIT_URL = 'https://chromium.googlesource.com/chromium/src.git' | 28 CHROMIUM_GIT_URL = 'https://chromium.googlesource.com/chromium/src.git' |
| 29 COMMIT_POSITION_RE = re.compile('^Cr-Original-Commit-Position: .*#([0-9]+).*$') | 29 COMMIT_POSITION_RE = re.compile('^Cr-Original-Commit-Position: .*#([0-9]+).*$') |
| 30 CL_ISSUE_RE = re.compile('^Issue number: ([0-9]+) \((.*)\)$') | 30 CL_ISSUE_RE = re.compile('^Issue number: ([0-9]+) \((.*)\)$') |
| 31 RIETVELD_URL_RE = re.compile('^https?://(.*)/(.*)') | 31 RIETVELD_URL_RE = re.compile('^https?://(.*)/(.*)') |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 self._RunCommand(['git', 'cl', 'set_commit']) | 322 self._RunCommand(['git', 'cl', 'set_commit']) |
| 323 logging.debug('Sent the CL to the CQ. Monitor here: %s', cl_info.url) | 323 logging.debug('Sent the CL to the CQ. Monitor here: %s', cl_info.url) |
| 324 | 324 |
| 325 # TODO(kjellander): Checkout masters/previous branches again. | 325 # TODO(kjellander): Checkout masters/previous branches again. |
| 326 return 0 | 326 return 0 |
| 327 | 327 |
| 328 def _UpdateDep(self, deps_filename, dep_relative_to_src, commit_info): | 328 def _UpdateDep(self, deps_filename, dep_relative_to_src, commit_info): |
| 329 dep_name = os.path.join('src', dep_relative_to_src) | 329 dep_name = os.path.join('src', dep_relative_to_src) |
| 330 comment = 'commit position %s' % commit_info.commit_position | 330 comment = 'commit position %s' % commit_info.commit_position |
| 331 | 331 |
| 332 # roll_dep.py relies on cwd being the Chromium checkout, so let's | 332 # roll_dep_svn.py relies on cwd being the Chromium checkout, so let's |
| 333 # temporarily change the working directory and then change back. | 333 # temporarily change the working directory and then change back. |
| 334 cwd = os.getcwd() | 334 cwd = os.getcwd() |
| 335 os.chdir(os.path.dirname(deps_filename)) | 335 os.chdir(os.path.dirname(deps_filename)) |
| 336 roll_dep.update_deps(deps_filename, dep_relative_to_src, dep_name, | 336 roll_dep_svn.update_deps(deps_filename, dep_relative_to_src, dep_name, |
| 337 commit_info.git_commit, comment) | 337 commit_info.git_commit, comment) |
| 338 os.chdir(cwd) | 338 os.chdir(cwd) |
| 339 | 339 |
| 340 def _DeleteRollBranch(self): | 340 def _DeleteRollBranch(self): |
| 341 self._RunCommand(['git', 'checkout', 'master']) | 341 self._RunCommand(['git', 'checkout', 'master']) |
| 342 self._RunCommand(['git', 'branch', '-D', ROLL_BRANCH_NAME]) | 342 self._RunCommand(['git', 'branch', '-D', ROLL_BRANCH_NAME]) |
| 343 logging.debug('Deleted the local roll branch (%s)', ROLL_BRANCH_NAME) | 343 logging.debug('Deleted the local roll branch (%s)', ROLL_BRANCH_NAME) |
| 344 | 344 |
| 345 | 345 |
| 346 def _GetBranches(self): | 346 def _GetBranches(self): |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 if args.abort: | 426 if args.abort: |
| 427 return autoroller.Abort() | 427 return autoroller.Abort() |
| 428 elif args.wait_for_trybots: | 428 elif args.wait_for_trybots: |
| 429 return autoroller.WaitForTrybots() | 429 return autoroller.WaitForTrybots() |
| 430 else: | 430 else: |
| 431 return autoroller.PrepareRoll(args.dry_run, args.ignore_checks, | 431 return autoroller.PrepareRoll(args.dry_run, args.ignore_checks, |
| 432 args.no_commit, args.close_previous_roll) | 432 args.no_commit, args.close_previous_roll) |
| 433 | 433 |
| 434 if __name__ == '__main__': | 434 if __name__ == '__main__': |
| 435 sys.exit(main()) | 435 sys.exit(main()) |
| OLD | NEW |