OLD | NEW |
1 # Copyright 2015 The LUCI Authors. All rights reserved. | 1 # Copyright 2015 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 import copy | 5 import copy |
6 import errno | 6 import errno |
7 import logging | 7 import logging |
8 import operator | 8 import operator |
9 import os | 9 import os |
10 import subprocess | 10 import subprocess |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 def current(self): | 203 def current(self): |
204 return self.backend.commit_metadata(self.revision) | 204 return self.backend.commit_metadata(self.revision) |
205 | 205 |
206 def updates(self): | 206 def updates(self): |
207 """Returns a list of revisions on the branch between the pinned revision | 207 """Returns a list of revisions on the branch between the pinned revision |
208 and the tracked branch. | 208 and the tracked branch. |
209 | 209 |
210 Returns list(CommitMetadata) | 210 Returns list(CommitMetadata) |
211 """ | 211 """ |
212 spec = self.spec_pb() | 212 return self.backend.updates( |
213 | 213 self.revision, self.backend.resolve_refspec(self._branch_for_remote)) |
214 paths = [] | |
215 subdir = spec.recipes_path | |
216 if subdir: | |
217 # We add package_file to the list of paths to check because it might | |
218 # contain other upstream rolls, which we want. | |
219 paths.extend([subdir + os.path.sep, | |
220 InfraRepoConfig().relative_recipes_cfg]) | |
221 | |
222 other_revision = self.backend.resolve_refspec(self._branch_for_remote) | |
223 return self.backend.updates(self.revision, other_revision, paths) | |
224 | 214 |
225 def _components(self): | 215 def _components(self): |
226 return (self.project_id, self.repo, self.revision, self.path) | 216 return (self.project_id, self.repo, self.revision, self.path) |
227 | 217 |
228 def __eq__(self, other): | 218 def __eq__(self, other): |
229 if not isinstance(other, type(self)): | 219 if not isinstance(other, type(self)): |
230 return False | 220 return False |
231 return self._components() == other._components() | 221 return self._components() == other._components() |
232 | 222 |
233 | 223 |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 | 501 |
512 @property | 502 @property |
513 def packages(self): | 503 def packages(self): |
514 for p in self._packages.values(): | 504 for p in self._packages.values(): |
515 yield p | 505 yield p |
516 | 506 |
517 @property | 507 @property |
518 def engine_recipes_py(self): | 508 def engine_recipes_py(self): |
519 return os.path.join( | 509 return os.path.join( |
520 self._packages['recipe_engine'].repo_root, 'recipes.py') | 510 self._packages['recipe_engine'].repo_root, 'recipes.py') |
OLD | NEW |