| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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.6.1' | 9 __version__ = '1.6.1' |
| 10 | 10 |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 | 666 |
| 667 Instance members: | 667 Instance members: |
| 668 tags: Dictionnary of KEY=VALUE pairs found in the change description. | 668 tags: Dictionnary of KEY=VALUE pairs found in the change description. |
| 669 self.KEY: equivalent to tags['KEY'] | 669 self.KEY: equivalent to tags['KEY'] |
| 670 """ | 670 """ |
| 671 | 671 |
| 672 _AFFECTED_FILES = AffectedFile | 672 _AFFECTED_FILES = AffectedFile |
| 673 | 673 |
| 674 # Matches key/value (or "tag") lines in changelist descriptions. | 674 # Matches key/value (or "tag") lines in changelist descriptions. |
| 675 TAG_LINE_RE = re.compile( | 675 TAG_LINE_RE = re.compile( |
| 676 '^\s*(?P<key>[A-Z][A-Z_0-9]*)\s*=\s*(?P<value>.*?)\s*$') | 676 '^[ \t]*(?P<key>[A-Z][A-Z_0-9]*)[ \t]*=[ \t]*(?P<value>.*?)[ \t]*$') |
| 677 scm = '' | 677 scm = '' |
| 678 | 678 |
| 679 def __init__( | 679 def __init__( |
| 680 self, name, description, local_root, files, issue, patchset, author): | 680 self, name, description, local_root, files, issue, patchset, author): |
| 681 if files is None: | 681 if files is None: |
| 682 files = [] | 682 files = [] |
| 683 self._name = name | 683 self._name = name |
| 684 self._full_description = description | 684 self._full_description = description |
| 685 # Convert root into an absolute path. | 685 # Convert root into an absolute path. |
| 686 self._local_root = os.path.abspath(local_root) | 686 self._local_root = os.path.abspath(local_root) |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1299 except PresubmitFailure, e: | 1299 except PresubmitFailure, e: |
| 1300 print >> sys.stderr, e | 1300 print >> sys.stderr, e |
| 1301 print >> sys.stderr, 'Maybe your depot_tools is out of date?' | 1301 print >> sys.stderr, 'Maybe your depot_tools is out of date?' |
| 1302 print >> sys.stderr, 'If all fails, contact maruel@' | 1302 print >> sys.stderr, 'If all fails, contact maruel@' |
| 1303 return 2 | 1303 return 2 |
| 1304 | 1304 |
| 1305 | 1305 |
| 1306 if __name__ == '__main__': | 1306 if __name__ == '__main__': |
| 1307 fix_encoding.fix_encoding() | 1307 fix_encoding.fix_encoding() |
| 1308 sys.exit(Main(None)) | 1308 sys.exit(Main(None)) |
| OLD | NEW |