| 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 """Common steps for recipes that use repo for source control.""" | 5 """Common steps for recipes that use repo for source control.""" |
| 6 | 6 |
| 7 import re | 7 import re |
| 8 | 8 |
| 9 from slave import recipe_api | 9 from recipe_engine import recipe_api |
| 10 | 10 |
| 11 class RepoApi(recipe_api.RecipeApi): | 11 class RepoApi(recipe_api.RecipeApi): |
| 12 """Provides methods to encapsulate repo operations.""" | 12 """Provides methods to encapsulate repo operations.""" |
| 13 | 13 |
| 14 _REPO_LIST_RE = re.compile(r'^(.+) : (.+)$') | 14 _REPO_LIST_RE = re.compile(r'^(.+) : (.+)$') |
| 15 | 15 |
| 16 # WARNING: The version of repo checked into depot_tools doesn't support | 16 # WARNING: The version of repo checked into depot_tools doesn't support |
| 17 # switching between branches correctly due to | 17 # switching between branches correctly due to |
| 18 # https://code.google.com/p/git-repo/issues/detail?id=46 | 18 # https://code.google.com/p/git-repo/issues/detail?id=46 |
| 19 | 19 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 match = self._REPO_LIST_RE.match(line) | 88 match = self._REPO_LIST_RE.match(line) |
| 89 if match: | 89 if match: |
| 90 result.append(match.groups()) | 90 result.append(match.groups()) |
| 91 | 91 |
| 92 # Display the result in the step text. | 92 # Display the result in the step text. |
| 93 if result: | 93 if result: |
| 94 step_result.presentation.step_text = '</br></br>' | 94 step_result.presentation.step_text = '</br></br>' |
| 95 step_result.presentation.step_text += '</br>'.join( | 95 step_result.presentation.step_text += '</br>'.join( |
| 96 '%s : %s' % (path, name) for path, name in result) | 96 '%s : %s' % (path, name) for path, name in result) |
| 97 return result | 97 return result |
| OLD | NEW |