Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2016 The LUCI Authors. All rights reserved. | 1 # Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed under the Apache License, Version 2.0 | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # that can be found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Utilities for testing with real repos (e.g. git).""" | 5 """Utilities for testing with real repos (e.g. git).""" |
| 6 | 6 |
| 7 | 7 |
| 8 import contextlib | 8 import contextlib |
| 9 import os | 9 import os |
| 10 import shutil | 10 import shutil |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 'recipe_engine': package_pb2.DepSpec(url="file://"+ROOT_DIR), | 124 'recipe_engine': package_pb2.DepSpec(url="file://"+ROOT_DIR), |
| 125 } | 125 } |
| 126 for d in repo_deps[k]: | 126 for d in repo_deps[k]: |
| 127 deps[d] = package_pb2.DepSpec( | 127 deps[d] = package_pb2.DepSpec( |
| 128 url=repos[d]['root'], | 128 url=repos[d]['root'], |
| 129 branch='master', | 129 branch='master', |
| 130 revision=repos[d]['revision'], | 130 revision=repos[d]['revision'], |
| 131 ) | 131 ) |
| 132 | 132 |
| 133 repos[k] = self.create_repo(k, package_pb2.Package( | 133 repos[k] = self.create_repo(k, package_pb2.Package( |
| 134 api_version=1, | 134 api_version=2, |
|
iannucci
2017/03/29 22:15:08
this makes the autoroll tests emit version 2 json.
dnj
2017/03/29 22:16:15
Acknowledged.
| |
| 135 project_id=k, | 135 project_id=k, |
| 136 recipes_path='', | 136 recipes_path='', |
| 137 deps=deps, | 137 deps=deps, |
| 138 )) | 138 )) |
| 139 return repos | 139 return repos |
| 140 | 140 |
| 141 def updated_package_spec_pb(self, repo, dep_name, dep_revision): | 141 def updated_package_spec_pb(self, repo, dep_name, dep_revision): |
| 142 """Returns package spec for given repo, with specified revision | 142 """Returns package spec for given repo, with specified revision |
| 143 for given dependency. | 143 for given dependency. |
| 144 """ | 144 """ |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 message = ' '.join( | 315 message = ' '.join( |
| 316 ['update %r recipe_module: ' % name] + | 316 ['update %r recipe_module: ' % name] + |
| 317 ['%s(%s)' % t for t in methods.iteritems()] | 317 ['%s(%s)' % t for t in methods.iteritems()] |
| 318 ) | 318 ) |
| 319 return self.commit_in_repo(repo, message) | 319 return self.commit_in_repo(repo, message) |
| 320 | 320 |
| 321 def reset_repo(self, repo, revision): | 321 def reset_repo(self, repo, revision): |
| 322 """Resets repo contents to given revision.""" | 322 """Resets repo contents to given revision.""" |
| 323 with in_directory(repo['root']): | 323 with in_directory(repo['root']): |
| 324 subprocess.check_output(['git', 'reset', '--hard', revision]) | 324 subprocess.check_output(['git', 'reset', '--hard', revision]) |
| OLD | NEW |