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 """Wrapper script around Rietveld's upload.py that groups files into | 6 """Wrapper script around Rietveld's upload.py that groups files into |
7 changelists.""" | 7 changelists.""" |
8 | 8 |
9 import getpass | 9 import getpass |
10 import os | 10 import os |
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 | 1011 |
1012 # Update the Rietveld issue. | 1012 # Update the Rietveld issue. |
1013 if change_info.issue and change_info.NeedsUpload(): | 1013 if change_info.issue and change_info.NeedsUpload(): |
1014 change_info.UpdateRietveldDescription() | 1014 change_info.UpdateRietveldDescription() |
1015 change_info.needs_upload = False | 1015 change_info.needs_upload = False |
1016 change_info.Save() | 1016 change_info.Save() |
1017 | 1017 |
1018 | 1018 |
1019 # Valid extensions for files we want to lint. | 1019 # Valid extensions for files we want to lint. |
1020 DEFAULT_LINT_REGEX = r"(.*\.cpp|.*\.cc|.*\.h)" | 1020 DEFAULT_LINT_REGEX = r"(.*\.cpp|.*\.cc|.*\.h)" |
1021 DEFAULT_LINT_IGNORE_REGEX = r"" | 1021 DEFAULT_LINT_IGNORE_REGEX = r"$^" |
1022 | 1022 |
1023 def Lint(change_info, args): | 1023 def Lint(change_info, args): |
1024 """Runs cpplint.py on all the files in |change_info|""" | 1024 """Runs cpplint.py on all the files in |change_info|""" |
1025 try: | 1025 try: |
1026 import cpplint | 1026 import cpplint |
1027 except ImportError: | 1027 except ImportError: |
1028 ErrorExit("You need to install cpplint.py to lint C++ files.") | 1028 ErrorExit("You need to install cpplint.py to lint C++ files.") |
1029 | 1029 |
1030 # Change the current working directory before calling lint so that it | 1030 # Change the current working directory before calling lint so that it |
1031 # shows the correct base. | 1031 # shows the correct base. |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 return 0 | 1205 return 0 |
1206 args =["svn", command] | 1206 args =["svn", command] |
1207 root = GetRepositoryRoot() | 1207 root = GetRepositoryRoot() |
1208 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) | 1208 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) |
1209 RunShell(args, True) | 1209 RunShell(args, True) |
1210 return 0 | 1210 return 0 |
1211 | 1211 |
1212 | 1212 |
1213 if __name__ == "__main__": | 1213 if __name__ == "__main__": |
1214 sys.exit(main()) | 1214 sys.exit(main()) |
OLD | NEW |