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 import itertools | 5 import itertools |
6 import re | 6 import re |
7 | 7 |
8 from recipe_engine import recipe_api | 8 from recipe_engine import recipe_api |
9 | 9 |
10 class GitApi(recipe_api.RecipeApi): | 10 class GitApi(recipe_api.RecipeApi): |
(...skipping 23 matching lines...) Expand all Loading... |
34 except self.m.step.StepFailure as f: | 34 except self.m.step.StepFailure as f: |
35 if can_fail_build: | 35 if can_fail_build: |
36 raise | 36 raise |
37 else: | 37 else: |
38 return f.result | 38 return f.result |
39 | 39 |
40 def ensure_win_git_tooling(self): | 40 def ensure_win_git_tooling(self): |
41 """Ensures that depot_tools/git.bat actually exists.""" | 41 """Ensures that depot_tools/git.bat actually exists.""" |
42 if not self.m.platform.is_win or self.initialized_win_git: | 42 if not self.m.platform.is_win or self.initialized_win_git: |
43 return | 43 return |
44 self.m.step( | 44 self.m.python( |
45 'ensure git tooling on windows', | 45 'ensure git tooling on windows', |
46 [self.package_repo_resource('bootstrap', 'win', 'win_tools.bat')], | 46 self.package_repo_resource('bootstrap', 'win', 'git_bootstrap.py'), |
| 47 ['--verbose'], |
47 infra_step=True, | 48 infra_step=True, |
48 cwd=self.package_repo_resource(), | 49 cwd=self.package_repo_resource(), |
49 timeout=300) | 50 timeout=300) |
50 self.initialized_win_git = True | 51 self.initialized_win_git = True |
51 | 52 |
52 def fetch_tags(self, remote_name=None, **kwargs): | 53 def fetch_tags(self, remote_name=None, **kwargs): |
53 """Fetches all tags from the remote.""" | 54 """Fetches all tags from the remote.""" |
54 kwargs.setdefault('name', 'git fetch tags') | 55 kwargs.setdefault('name', 'git fetch tags') |
55 remote_name = remote_name or 'origin' | 56 remote_name = remote_name or 'origin' |
56 return self('fetch', remote_name, '--tags', **kwargs) | 57 return self('fetch', remote_name, '--tags', **kwargs) |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 | 402 |
402 Args: | 403 Args: |
403 bundle_path (Path): The path of the output bundle. | 404 bundle_path (Path): The path of the output bundle. |
404 refs (list): The list of refs to include in the bundle. If None, all | 405 refs (list): The list of refs to include in the bundle. If None, all |
405 refs in the Git checkout will be bundled. | 406 refs in the Git checkout will be bundled. |
406 kwargs: Forwarded to '__call__'. | 407 kwargs: Forwarded to '__call__'. |
407 """ | 408 """ |
408 if not rev_list_args: | 409 if not rev_list_args: |
409 rev_list_args = ['--all'] | 410 rev_list_args = ['--all'] |
410 self('bundle', 'create', bundle_path, *rev_list_args, **kwargs) | 411 self('bundle', 'create', bundle_path, *rev_list_args, **kwargs) |
OLD | NEW |