| OLD | NEW |
| (Empty) |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 """Create a CL to update the SKP version.""" | |
| 6 | |
| 7 | |
| 8 import argparse | |
| 9 import os | |
| 10 import subprocess | |
| 11 import sys | |
| 12 | |
| 13 sys.path.insert(0, os.path.join(os.getcwd(), 'common')) | |
| 14 # pylint:disable=F0401 | |
| 15 from py.utils import git_utils | |
| 16 | |
| 17 | |
| 18 | |
| 19 CHROMIUM_SKIA = 'https://chromium.googlesource.com/skia.git' | |
| 20 COMMIT_MSG = '''Update SKP version | |
| 21 | |
| 22 Automatic commit by the RecreateSKPs bot. | |
| 23 | |
| 24 TBR= | |
| 25 NO_MERGE_BUILDS | |
| 26 ''' | |
| 27 SKIA_COMMITTER_EMAIL = 'skia.buildbots@gmail.com' | |
| 28 SKIA_COMMITTER_NAME = 'skia.buildbots' | |
| 29 SKIA_REPO = 'https://skia.googlesource.com/skia.git' | |
| 30 | |
| 31 | |
| 32 def main(chrome_src_path, browser_executable, dry_run=False): | |
| 33 if dry_run: | |
| 34 print 'Not committing results since --dry-run was provided' | |
| 35 | |
| 36 subprocess.check_call(['git', 'config', '--local', 'user.name', | |
| 37 SKIA_COMMITTER_NAME]) | |
| 38 subprocess.check_call(['git', 'config', '--local', 'user.email', | |
| 39 SKIA_COMMITTER_EMAIL]) | |
| 40 if CHROMIUM_SKIA in subprocess.check_output(['git', 'remote', '-v']): | |
| 41 subprocess.check_call(['git', 'remote', 'set-url', 'origin', SKIA_REPO, | |
| 42 CHROMIUM_SKIA]) | |
| 43 | |
| 44 with git_utils.GitBranch(branch_name='update_skp_version', | |
| 45 commit_msg=COMMIT_MSG, | |
| 46 commit_queue=not dry_run): | |
| 47 subprocess.check_call(['python', os.path.join('tools', 'skp', | |
| 48 'recreate_skps.py'), | |
| 49 chrome_src_path, browser_executable, str(dry_run)]) | |
| 50 | |
| 51 | |
| 52 if '__main__' == __name__: | |
| 53 parser = argparse.ArgumentParser() | |
| 54 parser.add_argument("chrome_src_path") | |
| 55 parser.add_argument("browser_executable") | |
| 56 parser.add_argument("--dry-run", action="store_true") | |
| 57 args = parser.parse_args() | |
| 58 main(args.chrome_src_path, args.browser_executable, args.dry_run) | |
| OLD | NEW |