kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 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 |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | import argparse |
| 7 | import collections |
| 8 | import logging |
| 9 | import os |
| 10 | import re |
| 11 | import subprocess |
| 12 | import sys |
| 13 | import time |
| 14 | |
| 15 | extra_trybots = [ |
| 16 | { |
Corentin Wallez | b78c44a | 2018-04-12 14:29:47 | [diff] [blame^] | 17 | "mastername": "luci.chromium.try", |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 18 | "buildernames": ["win_optional_gpu_tests_rel"] |
zmo | fb33cbfb | 2016-02-23 00:41:35 | [diff] [blame] | 19 | }, |
| 20 | { |
Corentin Wallez | 5ba00895 | 2018-03-20 19:16:06 | [diff] [blame] | 21 | "mastername": "luci.chromium.try", |
zmo | fb33cbfb | 2016-02-23 00:41:35 | [diff] [blame] | 22 | "buildernames": ["mac_optional_gpu_tests_rel"] |
zmo | 3eaa091 | 2016-04-16 00:03:05 | [diff] [blame] | 23 | }, |
| 24 | { |
Corentin Wallez | 5ba00895 | 2018-03-20 19:16:06 | [diff] [blame] | 25 | "mastername": "luci.chromium.try", |
zmo | 3eaa091 | 2016-04-16 00:03:05 | [diff] [blame] | 26 | "buildernames": ["linux_optional_gpu_tests_rel"] |
| 27 | }, |
ynovikov | cc292fc | 2016-09-01 21:58:46 | [diff] [blame] | 28 | { |
Yuly Novikov | 129c328 | 2018-03-21 05:07:29 | [diff] [blame] | 29 | "mastername": "luci.chromium.try", |
ynovikov | cc292fc | 2016-09-01 21:58:46 | [diff] [blame] | 30 | "buildernames": ["android_optional_gpu_tests_rel"] |
| 31 | }, |
Kenneth Russell | 220f23b0 | 2017-12-05 09:02:28 | [diff] [blame] | 32 | # Include the ANGLE tryservers which run the WebGL conformance tests |
| 33 | # in some non-default configurations. |
| 34 | { |
Corentin Wallez | 5ba00895 | 2018-03-20 19:16:06 | [diff] [blame] | 35 | "mastername": "luci.chromium.try", |
Kenneth Russell | 220f23b0 | 2017-12-05 09:02:28 | [diff] [blame] | 36 | "buildernames": ["linux_angle_rel_ng"] |
| 37 | }, |
| 38 | { |
Corentin Wallez | b78c44a | 2018-04-12 14:29:47 | [diff] [blame^] | 39 | "mastername": "luci.chromium.try", |
Kenneth Russell | 220f23b0 | 2017-12-05 09:02:28 | [diff] [blame] | 40 | "buildernames": ["win_angle_rel_ng"] |
| 41 | }, |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 42 | ] |
| 43 | |
| 44 | SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) |
| 45 | SRC_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir)) |
| 46 | sys.path.insert(0, os.path.join(SRC_DIR, 'build')) |
| 47 | import find_depot_tools |
| 48 | find_depot_tools.add_depot_tools_to_path() |
| 49 | import roll_dep_svn |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 50 | from third_party import upload |
| 51 | |
| 52 | # Avoid depot_tools/third_party/upload.py print verbose messages. |
| 53 | upload.verbosity = 0 # Errors only. |
| 54 | |
| 55 | CHROMIUM_GIT_URL = 'https://chromium.googlesource.com/chromium/src.git' |
| 56 | CL_ISSUE_RE = re.compile('^Issue number: ([0-9]+) \((.*)\)$') |
Aaron Gable | 8a89972 | 2017-10-11 21:49:15 | [diff] [blame] | 57 | REVIEW_URL_RE = re.compile('^https?://(.*)/(.*)') |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 58 | ROLL_BRANCH_NAME = 'special_webgl_roll_branch' |
| 59 | TRYJOB_STATUS_SLEEP_SECONDS = 30 |
| 60 | |
| 61 | # Use a shell for subcommands on Windows to get a PATH search. |
| 62 | IS_WIN = sys.platform.startswith('win') |
| 63 | WEBGL_PATH = os.path.join('third_party', 'webgl', 'src') |
kbr | 0ea13b4c | 2017-02-16 20:01:50 | [diff] [blame] | 64 | WEBGL_REVISION_TEXT_FILE = os.path.join( |
| 65 | 'content', 'test', 'gpu', 'gpu_tests', 'webgl_conformance_revision.txt') |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 66 | |
| 67 | CommitInfo = collections.namedtuple('CommitInfo', ['git_commit', |
| 68 | 'git_repo_url']) |
Aaron Gable | 8a89972 | 2017-10-11 21:49:15 | [diff] [blame] | 69 | CLInfo = collections.namedtuple('CLInfo', ['issue', 'url', 'review_server']) |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 70 | |
Kenneth Russell | 3c5f925 | 2017-08-18 21:49:54 | [diff] [blame] | 71 | |
| 72 | def _VarLookup(local_scope): |
| 73 | return lambda var_name: local_scope['vars'][var_name] |
| 74 | |
| 75 | |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 76 | def _PosixPath(path): |
| 77 | """Convert a possibly-Windows path to a posix-style path.""" |
| 78 | (_, path) = os.path.splitdrive(path) |
| 79 | return path.replace(os.sep, '/') |
| 80 | |
| 81 | def _ParseGitCommitHash(description): |
| 82 | for line in description.splitlines(): |
| 83 | if line.startswith('commit '): |
| 84 | return line.split()[1] |
| 85 | logging.error('Failed to parse git commit id from:\n%s\n', description) |
| 86 | sys.exit(-1) |
| 87 | return None |
| 88 | |
| 89 | |
| 90 | def _ParseDepsFile(filename): |
| 91 | with open(filename, 'rb') as f: |
| 92 | deps_content = f.read() |
| 93 | return _ParseDepsDict(deps_content) |
| 94 | |
| 95 | |
| 96 | def _ParseDepsDict(deps_content): |
| 97 | local_scope = {} |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 98 | global_scope = { |
Kenneth Russell | 3c5f925 | 2017-08-18 21:49:54 | [diff] [blame] | 99 | 'Var': _VarLookup(local_scope), |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 100 | 'deps_os': {}, |
| 101 | } |
| 102 | exec(deps_content, global_scope, local_scope) |
| 103 | return local_scope |
| 104 | |
| 105 | |
| 106 | def _GenerateCLDescriptionCommand(webgl_current, webgl_new, bugs): |
| 107 | def GetChangeString(current_hash, new_hash): |
| 108 | return '%s..%s' % (current_hash[0:7], new_hash[0:7]); |
| 109 | |
| 110 | def GetChangeLogURL(git_repo_url, change_string): |
| 111 | return '%s/+log/%s' % (git_repo_url, change_string) |
| 112 | |
| 113 | def GetBugString(bugs): |
Kenneth Russell | 6792e64 | 2017-12-19 03:23:08 | [diff] [blame] | 114 | bug_str = 'Bug: ' |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 115 | for bug in bugs: |
| 116 | bug_str += str(bug) + ',' |
| 117 | return bug_str.rstrip(',') |
| 118 | |
kbr | 0ea13b4c | 2017-02-16 20:01:50 | [diff] [blame] | 119 | change_str = GetChangeString(webgl_current.git_commit, |
| 120 | webgl_new.git_commit) |
| 121 | changelog_url = GetChangeLogURL(webgl_current.git_repo_url, |
| 122 | change_str) |
| 123 | if webgl_current.git_commit == webgl_new.git_commit: |
| 124 | print 'WARNING: WebGL repository is unchanged; proceeding with no-op roll' |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 125 | |
| 126 | def GetExtraTrybotString(): |
| 127 | s = '' |
| 128 | for t in extra_trybots: |
| 129 | if s: |
| 130 | s += ';' |
| 131 | s += t['mastername'] + ':' + ','.join(t['buildernames']) |
| 132 | return s |
| 133 | |
Kenneth Russell | 6792e64 | 2017-12-19 03:23:08 | [diff] [blame] | 134 | return ('Roll WebGL %s\n\n' |
| 135 | '%s\n\n' |
| 136 | '%s\n' |
| 137 | 'Cq-Include-Trybots: %s\n') % ( |
| 138 | change_str, |
| 139 | changelog_url, |
| 140 | GetBugString(bugs), |
| 141 | GetExtraTrybotString()) |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 142 | |
| 143 | |
| 144 | class AutoRoller(object): |
| 145 | def __init__(self, chromium_src): |
| 146 | self._chromium_src = chromium_src |
| 147 | |
| 148 | def _RunCommand(self, command, working_dir=None, ignore_exit_code=False, |
| 149 | extra_env=None): |
| 150 | """Runs a command and returns the stdout from that command. |
| 151 | |
| 152 | If the command fails (exit code != 0), the function will exit the process. |
| 153 | """ |
| 154 | working_dir = working_dir or self._chromium_src |
| 155 | logging.debug('cmd: %s cwd: %s', ' '.join(command), working_dir) |
| 156 | env = os.environ.copy() |
| 157 | if extra_env: |
| 158 | logging.debug('extra env: %s', extra_env) |
| 159 | env.update(extra_env) |
| 160 | p = subprocess.Popen(command, stdout=subprocess.PIPE, |
| 161 | stderr=subprocess.PIPE, shell=IS_WIN, env=env, |
| 162 | cwd=working_dir, universal_newlines=True) |
| 163 | output = p.stdout.read() |
| 164 | p.wait() |
| 165 | p.stdout.close() |
| 166 | p.stderr.close() |
| 167 | |
| 168 | if not ignore_exit_code and p.returncode != 0: |
| 169 | logging.error('Command failed: %s\n%s', str(command), output) |
| 170 | sys.exit(p.returncode) |
| 171 | return output |
| 172 | |
| 173 | def _GetCommitInfo(self, path_below_src, git_hash=None, git_repo_url=None): |
| 174 | working_dir = os.path.join(self._chromium_src, path_below_src) |
| 175 | self._RunCommand(['git', 'fetch', 'origin'], working_dir=working_dir) |
| 176 | revision_range = git_hash or 'origin' |
| 177 | ret = self._RunCommand( |
agable | 2e9de0e8 | 2016-10-20 01:03:18 | [diff] [blame] | 178 | ['git', '--no-pager', 'log', revision_range, |
| 179 | '--no-abbrev-commit', '--pretty=full', '-1'], |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 180 | working_dir=working_dir) |
| 181 | return CommitInfo(_ParseGitCommitHash(ret), git_repo_url) |
| 182 | |
| 183 | def _GetDepsCommitInfo(self, deps_dict, path_below_src): |
| 184 | entry = deps_dict['deps'][_PosixPath('src/%s' % path_below_src)] |
| 185 | at_index = entry.find('@') |
| 186 | git_repo_url = entry[:at_index] |
| 187 | git_hash = entry[at_index + 1:] |
| 188 | return self._GetCommitInfo(path_below_src, git_hash, git_repo_url) |
| 189 | |
| 190 | def _GetCLInfo(self): |
| 191 | cl_output = self._RunCommand(['git', 'cl', 'issue']) |
| 192 | m = CL_ISSUE_RE.match(cl_output.strip()) |
| 193 | if not m: |
| 194 | logging.error('Cannot find any CL info. Output was:\n%s', cl_output) |
| 195 | sys.exit(-1) |
| 196 | issue_number = int(m.group(1)) |
| 197 | url = m.group(2) |
| 198 | |
Aaron Gable | 8a89972 | 2017-10-11 21:49:15 | [diff] [blame] | 199 | # Parse the codereview host from the URL. |
| 200 | m = REVIEW_URL_RE.match(url) |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 201 | if not m: |
Aaron Gable | 8a89972 | 2017-10-11 21:49:15 | [diff] [blame] | 202 | logging.error('Cannot parse codereview host from URL: %s', url) |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 203 | sys.exit(-1) |
Aaron Gable | 8a89972 | 2017-10-11 21:49:15 | [diff] [blame] | 204 | review_server = m.group(1) |
| 205 | return CLInfo(issue_number, url, review_server) |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 206 | |
| 207 | def _GetCurrentBranchName(self): |
| 208 | return self._RunCommand( |
| 209 | ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).splitlines()[0] |
| 210 | |
| 211 | def _IsTreeClean(self): |
| 212 | lines = self._RunCommand( |
| 213 | ['git', 'status', '--porcelain', '-uno']).splitlines() |
| 214 | if len(lines) == 0: |
| 215 | return True |
| 216 | |
| 217 | logging.debug('Dirty/unversioned files:\n%s', '\n'.join(lines)) |
| 218 | return False |
| 219 | |
| 220 | def _GetBugList(self, path_below_src, webgl_current, webgl_new): |
| 221 | # TODO(kbr): this isn't useful, at least not yet, when run against |
| 222 | # the WebGL Github repository. |
| 223 | working_dir = os.path.join(self._chromium_src, path_below_src) |
| 224 | lines = self._RunCommand( |
| 225 | ['git','log', |
| 226 | '%s..%s' % (webgl_current.git_commit, webgl_new.git_commit)], |
| 227 | working_dir=working_dir).split('\n') |
| 228 | bugs = set() |
| 229 | for line in lines: |
| 230 | line = line.strip() |
| 231 | bug_prefix = 'BUG=' |
| 232 | if line.startswith(bug_prefix): |
| 233 | bugs_strings = line[len(bug_prefix):].split(',') |
| 234 | for bug_string in bugs_strings: |
| 235 | try: |
| 236 | bugs.add(int(bug_string)) |
| 237 | except: |
| 238 | # skip this, it may be a project specific bug such as |
| 239 | # "angleproject:X" or an ill-formed BUG= message |
| 240 | pass |
| 241 | return bugs |
| 242 | |
| 243 | def _UpdateReadmeFile(self, readme_path, new_revision): |
| 244 | readme = open(os.path.join(self._chromium_src, readme_path), 'r+') |
| 245 | txt = readme.read() |
| 246 | m = re.sub(re.compile('.*^Revision\: ([0-9]*).*', re.MULTILINE), |
| 247 | ('Revision: %s' % new_revision), txt) |
| 248 | readme.seek(0) |
| 249 | readme.write(m) |
| 250 | readme.truncate() |
| 251 | |
zmo | 3eaa091 | 2016-04-16 00:03:05 | [diff] [blame] | 252 | def PrepareRoll(self, ignore_checks, run_tryjobs): |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 253 | # TODO(kjellander): use os.path.normcase, os.path.join etc for all paths for |
| 254 | # cross platform compatibility. |
| 255 | |
| 256 | if not ignore_checks: |
| 257 | if self._GetCurrentBranchName() != 'master': |
| 258 | logging.error('Please checkout the master branch.') |
| 259 | return -1 |
| 260 | if not self._IsTreeClean(): |
| 261 | logging.error('Please make sure you don\'t have any modified files.') |
| 262 | return -1 |
| 263 | |
| 264 | # Always clean up any previous roll. |
| 265 | self.Abort() |
| 266 | |
| 267 | logging.debug('Pulling latest changes') |
| 268 | if not ignore_checks: |
| 269 | self._RunCommand(['git', 'pull']) |
| 270 | |
| 271 | self._RunCommand(['git', 'checkout', '-b', ROLL_BRANCH_NAME]) |
| 272 | |
| 273 | # Modify Chromium's DEPS file. |
| 274 | |
| 275 | # Parse current hashes. |
| 276 | deps_filename = os.path.join(self._chromium_src, 'DEPS') |
| 277 | deps = _ParseDepsFile(deps_filename) |
| 278 | webgl_current = self._GetDepsCommitInfo(deps, WEBGL_PATH) |
| 279 | |
| 280 | # Find ToT revisions. |
| 281 | webgl_latest = self._GetCommitInfo(WEBGL_PATH) |
| 282 | |
| 283 | if IS_WIN: |
| 284 | # Make sure the roll script doesn't use windows line endings |
| 285 | self._RunCommand(['git', 'config', 'core.autocrlf', 'true']) |
| 286 | |
| 287 | self._UpdateDep(deps_filename, WEBGL_PATH, webgl_latest) |
kbr | 0ea13b4c | 2017-02-16 20:01:50 | [diff] [blame] | 288 | self._UpdateWebGLRevTextFile(WEBGL_REVISION_TEXT_FILE, webgl_latest) |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 289 | |
| 290 | if self._IsTreeClean(): |
| 291 | logging.debug('Tree is clean - no changes detected.') |
| 292 | self._DeleteRollBranch() |
| 293 | else: |
| 294 | bugs = self._GetBugList(WEBGL_PATH, webgl_current, webgl_latest) |
| 295 | description = _GenerateCLDescriptionCommand( |
| 296 | webgl_current, webgl_latest, bugs) |
| 297 | logging.debug('Committing changes locally.') |
| 298 | self._RunCommand(['git', 'add', '--update', '.']) |
Kenneth Russell | 6792e64 | 2017-12-19 03:23:08 | [diff] [blame] | 299 | self._RunCommand(['git', 'commit', '-m', description]) |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 300 | logging.debug('Uploading changes...') |
| 301 | self._RunCommand(['git', 'cl', 'upload'], |
| 302 | extra_env={'EDITOR': 'true'}) |
| 303 | |
zmo | 3eaa091 | 2016-04-16 00:03:05 | [diff] [blame] | 304 | if run_tryjobs: |
kbr | b292131 | 2016-04-06 20:52:10 | [diff] [blame] | 305 | # Kick off tryjobs. |
| 306 | base_try_cmd = ['git', 'cl', 'try'] |
| 307 | self._RunCommand(base_try_cmd) |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 308 | |
| 309 | cl_info = self._GetCLInfo() |
| 310 | print 'Issue: %d URL: %s' % (cl_info.issue, cl_info.url) |
| 311 | |
| 312 | # Checkout master again. |
| 313 | self._RunCommand(['git', 'checkout', 'master']) |
| 314 | print 'Roll branch left as ' + ROLL_BRANCH_NAME |
| 315 | return 0 |
| 316 | |
| 317 | def _UpdateDep(self, deps_filename, dep_relative_to_src, commit_info): |
| 318 | dep_name = _PosixPath(os.path.join('src', dep_relative_to_src)) |
| 319 | |
| 320 | # roll_dep_svn.py relies on cwd being the Chromium checkout, so let's |
| 321 | # temporarily change the working directory and then change back. |
| 322 | cwd = os.getcwd() |
| 323 | os.chdir(os.path.dirname(deps_filename)) |
| 324 | roll_dep_svn.update_deps(deps_filename, dep_relative_to_src, dep_name, |
| 325 | commit_info.git_commit, '') |
| 326 | os.chdir(cwd) |
| 327 | |
kbr | 0ea13b4c | 2017-02-16 20:01:50 | [diff] [blame] | 328 | def _UpdateWebGLRevTextFile(self, txt_filename, commit_info): |
| 329 | # Rolling the WebGL conformance tests must cause at least all of |
| 330 | # the WebGL tests to run. There are already exclusions in |
| 331 | # trybot_analyze_config.json which force all tests to run if |
| 332 | # changes under src/content/test/gpu are made. (This rule |
| 333 | # typically only takes effect on the GPU bots.) To make sure this |
| 334 | # happens all the time, update an autogenerated text file in this |
| 335 | # directory. |
| 336 | with open(txt_filename, 'w') as fh: |
| 337 | print >> fh, '# AUTOGENERATED FILE - DO NOT EDIT' |
| 338 | print >> fh, '# SEE roll_webgl_conformance.py' |
| 339 | print >> fh, 'Current webgl revision %s' % commit_info.git_commit |
| 340 | |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 341 | def _DeleteRollBranch(self): |
| 342 | self._RunCommand(['git', 'checkout', 'master']) |
| 343 | self._RunCommand(['git', 'branch', '-D', ROLL_BRANCH_NAME]) |
| 344 | logging.debug('Deleted the local roll branch (%s)', ROLL_BRANCH_NAME) |
| 345 | |
| 346 | |
| 347 | def _GetBranches(self): |
| 348 | """Returns a tuple of active,branches. |
| 349 | |
| 350 | The 'active' is the name of the currently active branch and 'branches' is a |
| 351 | list of all branches. |
| 352 | """ |
| 353 | lines = self._RunCommand(['git', 'branch']).split('\n') |
| 354 | branches = [] |
| 355 | active = '' |
| 356 | for l in lines: |
| 357 | if '*' in l: |
| 358 | # The assumption is that the first char will always be the '*'. |
| 359 | active = l[1:].strip() |
| 360 | branches.append(active) |
| 361 | else: |
| 362 | b = l.strip() |
| 363 | if b: |
| 364 | branches.append(b) |
| 365 | return (active, branches) |
| 366 | |
| 367 | def Abort(self): |
| 368 | active_branch, branches = self._GetBranches() |
| 369 | if active_branch == ROLL_BRANCH_NAME: |
| 370 | active_branch = 'master' |
| 371 | if ROLL_BRANCH_NAME in branches: |
| 372 | print 'Aborting pending roll.' |
| 373 | self._RunCommand(['git', 'checkout', ROLL_BRANCH_NAME]) |
| 374 | # Ignore an error here in case an issue wasn't created for some reason. |
| 375 | self._RunCommand(['git', 'cl', 'set_close'], ignore_exit_code=True) |
| 376 | self._RunCommand(['git', 'checkout', active_branch]) |
| 377 | self._RunCommand(['git', 'branch', '-D', ROLL_BRANCH_NAME]) |
| 378 | return 0 |
| 379 | |
| 380 | |
| 381 | def main(): |
| 382 | parser = argparse.ArgumentParser( |
| 383 | description='Auto-generates a CL containing a WebGL conformance roll.') |
| 384 | parser.add_argument('--abort', |
| 385 | help=('Aborts a previously prepared roll. ' |
| 386 | 'Closes any associated issues and deletes the roll branches'), |
| 387 | action='store_true') |
| 388 | parser.add_argument('--ignore-checks', action='store_true', default=False, |
| 389 | help=('Skips checks for being on the master branch, dirty workspaces and ' |
| 390 | 'the updating of the checkout. Will still delete and create local ' |
| 391 | 'Git branches.')) |
zmo | 3eaa091 | 2016-04-16 00:03:05 | [diff] [blame] | 392 | parser.add_argument('--run-tryjobs', action='store_true', default=False, |
| 393 | help=('Start the dry-run tryjobs for the newly generated CL. Use this ' |
| 394 | 'when you have no need to make changes to the WebGL conformance ' |
| 395 | 'test expectations in the same CL and want to avoid.')) |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 396 | parser.add_argument('-v', '--verbose', action='store_true', default=False, |
| 397 | help='Be extra verbose in printing of log messages.') |
| 398 | args = parser.parse_args() |
| 399 | |
| 400 | if args.verbose: |
| 401 | logging.basicConfig(level=logging.DEBUG) |
| 402 | else: |
| 403 | logging.basicConfig(level=logging.ERROR) |
| 404 | |
| 405 | autoroller = AutoRoller(SRC_DIR) |
| 406 | if args.abort: |
| 407 | return autoroller.Abort() |
| 408 | else: |
zmo | 3eaa091 | 2016-04-16 00:03:05 | [diff] [blame] | 409 | return autoroller.PrepareRoll(args.ignore_checks, args.run_tryjobs) |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 410 | |
| 411 | if __name__ == '__main__': |
| 412 | sys.exit(main()) |