| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 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' | 9 __version__ = '1.3' |
| 10 | 10 |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 parser.add_option("-c", "--commit", action="store_true", | 724 parser.add_option("-c", "--commit", action="store_true", |
| 725 help="Use commit instead of upload checks") | 725 help="Use commit instead of upload checks") |
| 726 parser.add_option("-r", "--recursive", action="store_true", | 726 parser.add_option("-r", "--recursive", action="store_true", |
| 727 help="Act recursively") | 727 help="Act recursively") |
| 728 parser.add_option("-v", "--verbose", action="store_true", | 728 parser.add_option("-v", "--verbose", action="store_true", |
| 729 help="Verbose output") | 729 help="Verbose output") |
| 730 options, args = parser.parse_args(argv[1:]) | 730 options, args = parser.parse_args(argv[1:]) |
| 731 files = ParseFiles(args, options.recursive) | 731 files = ParseFiles(args, options.recursive) |
| 732 if options.verbose: | 732 if options.verbose: |
| 733 print "Found %d files." % len(files) | 733 print "Found %d files." % len(files) |
| 734 return not DoPresubmitChecks(gcl.ChangeInfo(name='temp', files=files), | 734 return not DoPresubmitChecks(gcl.ChangeInfo('No name', 0, 0, '', files), |
| 735 options.commit, | 735 options.commit, |
| 736 options.verbose, | 736 options.verbose, |
| 737 sys.stdout, | 737 sys.stdout, |
| 738 sys.stdin, | 738 sys.stdin, |
| 739 default_presubmit=None) | 739 default_presubmit=None) |
| 740 | 740 |
| 741 | 741 |
| 742 if __name__ == '__main__': | 742 if __name__ == '__main__': |
| 743 sys.exit(Main(sys.argv)) | 743 sys.exit(Main(sys.argv)) |
| OLD | NEW |