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 27 matching lines...) Expand all Loading... |
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.step( |
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', 'win_tools.bat')], |
47 infra_step=True, | 47 infra_step=True, |
48 cwd=self.package_repo_resource()) | 48 cwd=self.package_repo_resource(), |
| 49 timeout=300) |
49 self.initialized_win_git = True | 50 self.initialized_win_git = True |
50 | 51 |
51 def fetch_tags(self, remote_name=None, **kwargs): | 52 def fetch_tags(self, remote_name=None, **kwargs): |
52 """Fetches all tags from the remote.""" | 53 """Fetches all tags from the remote.""" |
53 kwargs.setdefault('name', 'git fetch tags') | 54 kwargs.setdefault('name', 'git fetch tags') |
54 remote_name = remote_name or 'origin' | 55 remote_name = remote_name or 'origin' |
55 return self('fetch', remote_name, '--tags', **kwargs) | 56 return self('fetch', remote_name, '--tags', **kwargs) |
56 | 57 |
57 def cat_file_at_commit(self, file_path, commit_hash, remote_name=None, | 58 def cat_file_at_commit(self, file_path, commit_hash, remote_name=None, |
58 **kwargs): | 59 **kwargs): |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 369 |
369 Args: | 370 Args: |
370 bundle_path (Path): The path of the output bundle. | 371 bundle_path (Path): The path of the output bundle. |
371 refs (list): The list of refs to include in the bundle. If None, all | 372 refs (list): The list of refs to include in the bundle. If None, all |
372 refs in the Git checkout will be bundled. | 373 refs in the Git checkout will be bundled. |
373 kwargs: Forwarded to '__call__'. | 374 kwargs: Forwarded to '__call__'. |
374 """ | 375 """ |
375 if not rev_list_args: | 376 if not rev_list_args: |
376 rev_list_args = ['--all'] | 377 rev_list_args = ['--all'] |
377 self('bundle', 'create', bundle_path, *rev_list_args, **kwargs) | 378 self('bundle', 'create', bundle_path, *rev_list_args, **kwargs) |
OLD | NEW |