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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 file_list = change_info.GetFileNames() | 910 file_list = change_info.GetFileNames() |
911 else: | 911 else: |
912 trychange_args.extend(args) | 912 trychange_args.extend(args) |
913 file_list = None | 913 file_list = None |
914 return trychange.TryChange(trychange_args, | 914 return trychange.TryChange(trychange_args, |
915 file_list=file_list, | 915 file_list=file_list, |
916 swallow_exception=swallow_exception, | 916 swallow_exception=swallow_exception, |
917 prog='gcl try') | 917 prog='gcl try') |
918 | 918 |
919 | 919 |
920 @need_change | 920 def CMDcommit(args): |
921 def CMDcommit(change_info): | 921 if not args: |
| 922 ErrorExit("You need to pass a change list name") |
| 923 change_info = ChangeInfo.Load(args.pop(0), GetRepositoryRoot(), True, True) |
922 if not change_info.GetFiles(): | 924 if not change_info.GetFiles(): |
923 print "Nothing to commit, changelist is empty." | 925 print "Nothing to commit, changelist is empty." |
924 return 1 | 926 return 1 |
925 if not OptionallyDoPresubmitChecks(change_info, True, args): | 927 if not OptionallyDoPresubmitChecks(change_info, True, args): |
926 return 1 | 928 return 1 |
927 | 929 |
928 # We face a problem with svn here: Let's say change 'bleh' modifies | 930 # We face a problem with svn here: Let's say change 'bleh' modifies |
929 # svn:ignore on dir1\. but another unrelated change 'pouet' modifies | 931 # svn:ignore on dir1\. but another unrelated change 'pouet' modifies |
930 # dir1\foo.cc. When the user `gcl commit bleh`, foo.cc is *also committed*. | 932 # dir1\foo.cc. When the user `gcl commit bleh`, foo.cc is *also committed*. |
931 # The only fix is to use --non-recursive but that has its issues too: | 933 # The only fix is to use --non-recursive but that has its issues too: |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 elif command == "delete": | 1335 elif command == "delete": |
1334 return CMDdelete(argv[1:]) | 1336 return CMDdelete(argv[1:]) |
1335 elif command == "try": | 1337 elif command == "try": |
1336 return CMDtry(argv[1:]) | 1338 return CMDtry(argv[1:]) |
1337 else: | 1339 else: |
1338 return CMDpassthru(argv) | 1340 return CMDpassthru(argv) |
1339 | 1341 |
1340 | 1342 |
1341 if __name__ == "__main__": | 1343 if __name__ == "__main__": |
1342 sys.exit(main(sys.argv[1:])) | 1344 sys.exit(main(sys.argv[1:])) |
OLD | NEW |