OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 DEPS = [ | 5 DEPS = [ |
6 'depot_tools/bot_update', | 6 'depot_tools/bot_update', |
7 'depot_tools/gclient', | 7 'depot_tools/gclient', |
8 'depot_tools/git', | 8 'depot_tools/git', |
9 'depot_tools/presubmit', | 9 'depot_tools/presubmit', |
10 'recipe_engine/json', | 10 'recipe_engine/json', |
(...skipping 17 matching lines...) Expand all Loading... |
28 api.gclient.set_config(repo_name) | 28 api.gclient.set_config(repo_name) |
29 | 29 |
30 bot_update_step = api.bot_update.ensure_checkout( | 30 bot_update_step = api.bot_update.ensure_checkout( |
31 force=force_checkout, patch_project_roots={'v8': []}, | 31 force=force_checkout, patch_project_roots={'v8': []}, |
32 patch_oauth2=codereview_auth) | 32 patch_oauth2=codereview_auth) |
33 relative_root = '%s/%s' % (api.gclient.c.solutions[0].name, root) | 33 relative_root = '%s/%s' % (api.gclient.c.solutions[0].name, root) |
34 relative_root = relative_root.strip('/') | 34 relative_root = relative_root.strip('/') |
35 got_revision_property = api.gclient.c.got_revision_mapping[relative_root] | 35 got_revision_property = api.gclient.c.got_revision_mapping[relative_root] |
36 upstream = bot_update_step.json.output['properties'].get( | 36 upstream = bot_update_step.json.output['properties'].get( |
37 got_revision_property) | 37 got_revision_property) |
38 if (not upstream or | |
39 isinstance(upstream, int) or | |
40 (upstream.isdigit() and len(upstream) < 40)): | |
41 # If got_revision is an svn revision, then use got_revision_git. | |
42 upstream = bot_update_step.json.output['properties'].get( | |
43 '%s_git' % got_revision_property) or '' | |
44 | 38 |
45 # TODO(hinoka): Extract email/name from issue? | 39 # TODO(hinoka): Extract email/name from issue? |
46 api.git('-c', 'user.email=commit-bot@chromium.org', | 40 api.git('-c', 'user.email=commit-bot@chromium.org', |
47 '-c', 'user.name=The Commit Bot', | 41 '-c', 'user.name=The Commit Bot', |
48 'commit', '-a', '-m', 'Committed patch', | 42 'commit', '-a', '-m', 'Committed patch', |
49 name='commit git patch', cwd=api.path['checkout'].join(root)) | 43 name='commit git patch', cwd=api.path['checkout'].join(root)) |
50 | 44 |
51 if api.properties.get('runhooks'): | 45 if api.properties.get('runhooks'): |
52 api.gclient.runhooks() | 46 api.gclient.runhooks() |
53 | 47 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 api.test('recipes-py') + | 142 api.test('recipes-py') + |
149 api.properties.tryserver( | 143 api.properties.tryserver( |
150 mastername='tryserver.infra', | 144 mastername='tryserver.infra', |
151 buildername='infra_presubmit', | 145 buildername='infra_presubmit', |
152 repo_name='recipes_py', | 146 repo_name='recipes_py', |
153 patch_project='recipes-py', | 147 patch_project='recipes-py', |
154 runhooks=True) + | 148 runhooks=True) + |
155 api.step_data('presubmit', api.json.output([['infra_presubmit', | 149 api.step_data('presubmit', api.json.output([['infra_presubmit', |
156 ['compile']]])) | 150 ['compile']]])) |
157 ) | 151 ) |
OLD | NEW |