| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Enables directory-specific presubmit checks to run at upload and/or commit. | 6 """Enables directory-specific presubmit checks to run at upload and/or commit. |
| 7 """ | 7 """ |
| 8 | 8 |
| 9 __version__ = '1.3.5' | 9 __version__ = '1.3.5' |
| 10 | 10 |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 | 639 |
| 640 def __init__(self, name, description, local_root, files, issue, patchset): | 640 def __init__(self, name, description, local_root, files, issue, patchset): |
| 641 if files is None: | 641 if files is None: |
| 642 files = [] | 642 files = [] |
| 643 self._name = name | 643 self._name = name |
| 644 self._full_description = description | 644 self._full_description = description |
| 645 # Convert root into an absolute path. | 645 # Convert root into an absolute path. |
| 646 self._local_root = os.path.abspath(local_root) | 646 self._local_root = os.path.abspath(local_root) |
| 647 self.issue = issue | 647 self.issue = issue |
| 648 self.patchset = patchset | 648 self.patchset = patchset |
| 649 | |
| 650 # TODO(dpranke): implement - get from the patchset? | |
| 651 self.approvers = set() | |
| 652 | |
| 653 self.scm = '' | 649 self.scm = '' |
| 654 | 650 |
| 655 # From the description text, build up a dictionary of key/value pairs | 651 # From the description text, build up a dictionary of key/value pairs |
| 656 # plus the description minus all key/value or "tag" lines. | 652 # plus the description minus all key/value or "tag" lines. |
| 657 description_without_tags = [] | 653 description_without_tags = [] |
| 658 self.tags = {} | 654 self.tags = {} |
| 659 for line in self._full_description.splitlines(): | 655 for line in self._full_description.splitlines(): |
| 660 m = self._TAG_LINE_RE.match(line) | 656 m = self._TAG_LINE_RE.match(line) |
| 661 if m: | 657 if m: |
| 662 self.tags[m.group('key')] = m.group('value') | 658 self.tags[m.group('key')] = m.group('value') |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 options.commit, | 1170 options.commit, |
| 1175 options.verbose, | 1171 options.verbose, |
| 1176 sys.stdout, | 1172 sys.stdout, |
| 1177 sys.stdin, | 1173 sys.stdin, |
| 1178 options.default_presubmit, | 1174 options.default_presubmit, |
| 1179 options.may_prompt) | 1175 options.may_prompt) |
| 1180 | 1176 |
| 1181 | 1177 |
| 1182 if __name__ == '__main__': | 1178 if __name__ == '__main__': |
| 1183 sys.exit(Main(sys.argv)) | 1179 sys.exit(Main(sys.argv)) |
| OLD | NEW |