| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 collections | 5 import collections |
| 6 import contextlib | 6 import contextlib |
| 7 import hashlib | 7 import hashlib |
| 8 | 8 |
| 9 from recipe_engine import recipe_api | 9 from recipe_engine import recipe_api |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 @property | 34 @property |
| 35 def can_apply_issue(self): | 35 def can_apply_issue(self): |
| 36 """Returns true iff the properties exist to apply_issue from rietveld.""" | 36 """Returns true iff the properties exist to apply_issue from rietveld.""" |
| 37 return (self.m.properties.get('rietveld') | 37 return (self.m.properties.get('rietveld') |
| 38 and 'issue' in self.m.properties | 38 and 'issue' in self.m.properties |
| 39 and 'patchset' in self.m.properties) | 39 and 'patchset' in self.m.properties) |
| 40 | 40 |
| 41 @property | 41 @property |
| 42 def is_gerrit_issue(self): | 42 def is_gerrit_issue(self): |
| 43 """Returns true iff the properties exist to match a Gerrit issue.""" | 43 """Returns true iff the properties exist to match a Gerrit issue.""" |
| 44 if self.m.properties.get('patch_storage') == 'gerrit': |
| 45 return True |
| 46 # TODO(tandrii): remove this, once nobody is using buildbot Gerrit Poller. |
| 44 return ('event.patchSet.ref' in self.m.properties and | 47 return ('event.patchSet.ref' in self.m.properties and |
| 45 'event.change.url' in self.m.properties and | 48 'event.change.url' in self.m.properties and |
| 46 'event.change.id' in self.m.properties) | 49 'event.change.id' in self.m.properties) |
| 47 | 50 |
| 48 @property | 51 @property |
| 49 def is_patch_in_svn(self): | 52 def is_patch_in_svn(self): |
| 50 """Returns true iff the properties exist to patch from a patch URL.""" | 53 """Returns true iff the properties exist to patch from a patch URL.""" |
| 51 return self.patch_url | 54 return self.patch_url |
| 52 | 55 |
| 53 @property | 56 @property |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 result = self.m.python( | 307 result = self.m.python( |
| 305 'parse description', self.package_repo_resource('git_footers.py'), | 308 'parse description', self.package_repo_resource('git_footers.py'), |
| 306 args=['--json', self.m.json.output()], | 309 args=['--json', self.m.json.output()], |
| 307 stdin=self.m.raw_io.input(data=patch_text)) | 310 stdin=self.m.raw_io.input(data=patch_text)) |
| 308 return result.json.output | 311 return result.json.output |
| 309 | 312 |
| 310 def get_footer(self, tag, patch_text=None): | 313 def get_footer(self, tag, patch_text=None): |
| 311 """Gets a specific tag from a CL description""" | 314 """Gets a specific tag from a CL description""" |
| 312 return self.get_footers(patch_text).get(tag, []) | 315 return self.get_footers(patch_text).get(tag, []) |
| 313 | 316 |
| OLD | NEW |