OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 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 from recipe_engine import recipe_api | 5 from recipe_engine import recipe_api |
6 | 6 |
7 | 7 |
8 class RevisionResolver(object): | 8 class RevisionResolver(object): |
9 """Resolves the revision based on build properties.""" | 9 """Resolves the revision based on build properties.""" |
10 | 10 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 self.m.path['build'].join('scripts', 'slave', 'gclient_safe_revert.py'), | 293 self.m.path['build'].join('scripts', 'slave', 'gclient_safe_revert.py'), |
294 ['.', self.m.path['depot_tools'].join('gclient', | 294 ['.', self.m.path['depot_tools'].join('gclient', |
295 platform_ext={'win': '.bat'})], | 295 platform_ext={'win': '.bat'})], |
296 infra_step=True, | 296 infra_step=True, |
297 **kwargs | 297 **kwargs |
298 ) | 298 ) |
299 | 299 |
300 def runhooks(self, args=None, name='runhooks', **kwargs): | 300 def runhooks(self, args=None, name='runhooks', **kwargs): |
301 args = args or [] | 301 args = args or [] |
302 assert isinstance(args, (list, tuple)) | 302 assert isinstance(args, (list, tuple)) |
| 303 kwargs.setdefault('cwd', self.m.path['checkout']) |
303 return self( | 304 return self( |
304 name, ['runhooks'] + list(args), infra_step=False, **kwargs) | 305 name, ['runhooks'] + list(args), infra_step=False, **kwargs) |
305 | 306 |
306 @property | 307 @property |
307 def is_blink_mode(self): | 308 def is_blink_mode(self): |
308 """ Indicates wether the caller is to use the Blink config rather than the | 309 """ Indicates wether the caller is to use the Blink config rather than the |
309 Chromium config. This may happen for one of two reasons: | 310 Chromium config. This may happen for one of two reasons: |
310 1. The builder is configured to always use TOT Blink. (factory property | 311 1. The builder is configured to always use TOT Blink. (factory property |
311 top_of_tree_blink=True) | 312 top_of_tree_blink=True) |
312 2. A try job comes in that applies to the Blink tree. (patch_project is | 313 2. A try job comes in that applies to the Blink tree. (patch_project is |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 """Updates config revision corresponding to patch_project. | 370 """Updates config revision corresponding to patch_project. |
370 | 371 |
371 Useful for bot_update only, as this is the only consumer of gclient's config | 372 Useful for bot_update only, as this is the only consumer of gclient's config |
372 revision map. This doesn't overwrite the revision if it was already set. | 373 revision map. This doesn't overwrite the revision if it was already set. |
373 """ | 374 """ |
374 assert patch_project is None or isinstance(patch_project, basestring) | 375 assert patch_project is None or isinstance(patch_project, basestring) |
375 cfg = gclient_config or self.c | 376 cfg = gclient_config or self.c |
376 path, revision = cfg.patch_projects.get(patch_project, (None, None)) | 377 path, revision = cfg.patch_projects.get(patch_project, (None, None)) |
377 if path and revision and path not in cfg.revisions: | 378 if path and revision and path not in cfg.revisions: |
378 cfg.revisions[path] = revision | 379 cfg.revisions[path] = revision |
OLD | NEW |