| 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 re | 5 import re |
| 6 | 6 |
| 7 from slave import recipe_api | 7 from recipe_engine import recipe_api |
| 8 | 8 |
| 9 class GitApi(recipe_api.RecipeApi): | 9 class GitApi(recipe_api.RecipeApi): |
| 10 _GIT_HASH_RE = re.compile('[0-9a-f]{40}', re.IGNORECASE) | 10 _GIT_HASH_RE = re.compile('[0-9a-f]{40}', re.IGNORECASE) |
| 11 | 11 |
| 12 def __call__(self, *args, **kwargs): | 12 def __call__(self, *args, **kwargs): |
| 13 """Return a git command step.""" | 13 """Return a git command step.""" |
| 14 name = kwargs.pop('name', 'git '+args[0]) | 14 name = kwargs.pop('name', 'git '+args[0]) |
| 15 if 'cwd' not in kwargs: | 15 if 'cwd' not in kwargs: |
| 16 kwargs.setdefault('cwd', self.m.path['checkout']) | 16 kwargs.setdefault('cwd', self.m.path['checkout']) |
| 17 git_cmd = 'git' | 17 git_cmd = 'git' |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 337 |
| 338 Args: | 338 Args: |
| 339 bundle_path (Path): The path of the output bundle. | 339 bundle_path (Path): The path of the output bundle. |
| 340 refs (list): The list of refs to include in the bundle. If None, all | 340 refs (list): The list of refs to include in the bundle. If None, all |
| 341 refs in the Git checkout will be bundled. | 341 refs in the Git checkout will be bundled. |
| 342 kwargs: Forwarded to '__call__'. | 342 kwargs: Forwarded to '__call__'. |
| 343 """ | 343 """ |
| 344 if not rev_list_args: | 344 if not rev_list_args: |
| 345 rev_list_args = ['--all'] | 345 rev_list_args = ['--all'] |
| 346 self('bundle', 'create', bundle_path, *rev_list_args, **kwargs) | 346 self('bundle', 'create', bundle_path, *rev_list_args, **kwargs) |
| OLD | NEW |