| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 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 | 6 |
| 7 """rebase.py: standalone script to batch update bench expectations. | 7 """rebase.py: standalone script to batch update bench expectations. |
| 8 | 8 |
| 9 Requires gsutil to access gs://chromium-skia-gm and Rietveld credentials. | 9 Requires gsutil to access gs://chromium-skia-gm and Rietveld credentials. |
| 10 | 10 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 os.chdir(repo_dir) | 119 os.chdir(repo_dir) |
| 120 if subprocess.call(['git', 'clone', '-q', '--depth=50', '--single-branch', | 120 if subprocess.call(['git', 'clone', '-q', '--depth=50', '--single-branch', |
| 121 'https://skia.googlesource.com/skia.git', '.']): | 121 'https://skia.googlesource.com/skia.git', '.']): |
| 122 status = False | 122 status = False |
| 123 subprocess.call(['git', 'checkout', 'master']) | 123 subprocess.call(['git', 'checkout', 'master']) |
| 124 subprocess.call(['git', 'pull']) | 124 subprocess.call(['git', 'pull']) |
| 125 os.chdir(old_cwd) | 125 os.chdir(old_cwd) |
| 126 return status | 126 return status |
| 127 | 127 |
| 128 def git_commit_expectations(repo_dir, exp_dir, update_li, h, commit): | 128 def git_commit_expectations(repo_dir, exp_dir, update_li, h, commit): |
| 129 commit_msg = """bench rebase after %s | 129 commit_msg = """manual bench rebase after %s |
| 130 | 130 |
| 131 TBR=robertphillips@google.com | 131 TBR=robertphillips@google.com |
| 132 | 132 |
| 133 Bypassing trybots: | 133 Bypassing trybots: |
| 134 NOTRY=true""" % h | 134 NOTRY=true""" % h |
| 135 old_cwd = os.getcwd() | 135 old_cwd = os.getcwd() |
| 136 os.chdir(repo_dir) | 136 os.chdir(repo_dir) |
| 137 upload = ['git', 'cl', 'upload', '-f', '--bypass-hooks', | 137 upload = ['git', 'cl', 'upload', '-f', '--bypass-hooks', |
| 138 '--bypass-watchlists', '-m', commit_msg] | 138 '--bypass-watchlists', '-m', commit_msg] |
| 139 branch = exp_dir.split('/')[-1] | 139 branch = exp_dir.split('/')[-1] |
| 140 if commit: | 140 if commit: |
| 141 upload.append('--use-commit-queue') | 141 upload.append('--use-commit-queue') |
| 142 cmds = ([['git', 'checkout', 'master'], | 142 cmds = ([['git', 'checkout', 'master'], |
| 143 ['git', 'pull'], | 143 ['git', 'pull'], |
| 144 ['git', 'checkout', '-b', branch, '-t', 'origin/master']] + | 144 ['git', 'checkout', '-b', branch, '-t', 'origin/master']] + |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 print 'ERROR uploading expectations using git.' | 239 print 'ERROR uploading expectations using git.' |
| 240 elif not commit: | 240 elif not commit: |
| 241 print 'CL created. Please take a look at the link above.' | 241 print 'CL created. Please take a look at the link above.' |
| 242 else: | 242 else: |
| 243 print 'New bench baselines should be in CQ now.' | 243 print 'New bench baselines should be in CQ now.' |
| 244 delete_dirs([gs_dir, exp_dir]) | 244 delete_dirs([gs_dir, exp_dir]) |
| 245 | 245 |
| 246 | 246 |
| 247 if __name__ == "__main__": | 247 if __name__ == "__main__": |
| 248 main() | 248 main() |
| OLD | NEW |