 Chromium Code Reviews
 Chromium Code Reviews Issue 7493050:
  Do not interfere with git cl patch <issue>  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
    
  
    Issue 7493050:
  Do not interfere with git cl patch <issue>  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools| OLD | NEW | 
|---|---|
| 1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2010 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 """Generic presubmit checks that can be reused by other presubmit checks.""" | 5 """Generic presubmit checks that can be reused by other presubmit checks.""" | 
| 6 | 6 | 
| 7 | 7 | 
| 8 ### Description checks | 8 ### Description checks | 
| 9 | 9 | 
| 10 def CheckChangeHasTestField(input_api, output_api): | 10 def CheckChangeHasTestField(input_api, output_api): | 
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 if text.strip() == '': | 59 if text.strip() == '': | 
| 60 if input_api.is_committing: | 60 if input_api.is_committing: | 
| 61 return [output_api.PresubmitError('Add a description.')] | 61 return [output_api.PresubmitError('Add a description.')] | 
| 62 else: | 62 else: | 
| 63 return [output_api.PresubmitNotifyResult('Add a description.')] | 63 return [output_api.PresubmitNotifyResult('Add a description.')] | 
| 64 return [] | 64 return [] | 
| 65 | 65 | 
| 66 | 66 | 
| 67 def CheckChangeWasUploaded(input_api, output_api): | 67 def CheckChangeWasUploaded(input_api, output_api): | 
| 68 """Checks that the issue was uploaded before committing.""" | 68 """Checks that the issue was uploaded before committing.""" | 
| 69 if (input_api.is_committing and | 69 if input_api.is_committing and not input_api.change.issue: | 
| 70 (not input_api.change.issue or not input_api.change.patchset)): | 70 # If patchset is None, it's likely a patchset in issue. | 
| 
Dirk Pranke
2011/07/25 19:06:54
I don't follow this comment?
 
M-A Ruel
2011/07/25 19:10:01
That's normal, it didn't make sense either. Fixed.
 | |
| 71 return [output_api.PresubmitError( | 71 return [output_api.PresubmitError( | 
| 72 'Issue wasn\'t uploaded. Please upload first.')] | 72 'Issue wasn\'t uploaded. Please upload first.')] | 
| 73 return [] | 73 return [] | 
| 74 | 74 | 
| 75 | 75 | 
| 76 ### Content checks | 76 ### Content checks | 
| 77 | 77 | 
| 78 def CheckDoNotSubmitInFiles(input_api, output_api): | 78 def CheckDoNotSubmitInFiles(input_api, output_api): | 
| 79 """Checks that the user didn't add 'DO NOT ' + 'SUBMIT' to any files.""" | 79 """Checks that the user didn't add 'DO NOT ' + 'SUBMIT' to any files.""" | 
| 80 # We want to check every text file, not just source files. | 80 # We want to check every text file, not just source files. | 
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 937 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( | 937 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( | 
| 938 input_api, output_api)) | 938 input_api, output_api)) | 
| 939 snapshot("checking license") | 939 snapshot("checking license") | 
| 940 results.extend(input_api.canned_checks.CheckLicense( | 940 results.extend(input_api.canned_checks.CheckLicense( | 
| 941 input_api, output_api, license_header, source_file_filter=sources)) | 941 input_api, output_api, license_header, source_file_filter=sources)) | 
| 942 snapshot("checking was uploaded") | 942 snapshot("checking was uploaded") | 
| 943 results.extend(input_api.canned_checks.CheckChangeWasUploaded( | 943 results.extend(input_api.canned_checks.CheckChangeWasUploaded( | 
| 944 input_api, output_api)) | 944 input_api, output_api)) | 
| 945 snapshot("done") | 945 snapshot("done") | 
| 946 return results | 946 return results | 
| OLD | NEW |