Chromium Code Reviews| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 329 for (path, dir, files) in os.walk(build_path): | 329 for (path, dir, files) in os.walk(build_path): |
| 330 for cur_file in files: | 330 for cur_file in files: |
| 331 if cur_file.endswith('index.lock'): | 331 if cur_file.endswith('index.lock'): |
| 332 path_to_file = os.path.join(path, cur_file) | 332 path_to_file = os.path.join(path, cur_file) |
| 333 print 'deleting %s' % path_to_file | 333 print 'deleting %s' % path_to_file |
| 334 os.remove(path_to_file) | 334 os.remove(path_to_file) |
| 335 """, | 335 """, |
| 336 args=[self.m.path['slave_build']], | 336 args=[self.m.path['slave_build']], |
| 337 infra_step=True, | 337 infra_step=True, |
| 338 ) | 338 ) |
| 339 | |
| 340 def calculate_patch_root(self, patch_project, gclient_config=None): | |
| 341 """Returns path where a patch should be applied to based patch_project. | |
| 342 | |
| 343 Maps "patch_project" to a path of directories relative to checkout's root, | |
| 344 which describe where to place the patch. | |
| 345 | |
| 346 For now, considers only first solution (c.solutions[0]), but in theory can | |
| 347 be extended to all of them. | |
| 348 | |
| 349 See patch_projects solution config property. | |
| 350 | |
| 351 Returns: | |
| 352 Relative path, including solution's root. | |
| 353 If patch_project is not given or not recognized, it'll be just first | |
| 354 solution root. | |
| 355 """ | |
| 356 cfg = gclient_config or self.c | |
| 357 root, _ = cfg.solutions[0].patch_projects.get(patch_project, ('', '')) | |
|
Michael Achenbach
2016/04/25 09:32:42
solutions[0] goes away when making the dict global
tandrii(chromium)
2016/04/25 11:39:50
Done.
| |
| 358 if root: | |
| 359 # Note, that c.solutions[i].patch_projects contains patch roots as | |
| 360 # /-separated path, which are roots of the respective project repos. | |
| 361 return self.m.path.join(*root.split('/')) | |
| 362 # Default case - assume patch is for first solution. | |
| 363 return cfg.solutions[0].name | |
| OLD | NEW |