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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 if gclient_root: | 858 if gclient_root: |
859 trychange_args.extend(['--root', PathDifference(gclient_root, | 859 trychange_args.extend(['--root', PathDifference(gclient_root, |
860 GetRepositoryRoot())]) | 860 GetRepositoryRoot())]) |
861 if change_info: | 861 if change_info: |
862 trychange_args.extend(['--name', change_info.name]) | 862 trychange_args.extend(['--name', change_info.name]) |
863 if change_info.issue: | 863 if change_info.issue: |
864 trychange_args.extend(["--issue", str(change_info.issue)]) | 864 trychange_args.extend(["--issue", str(change_info.issue)]) |
865 if change_info.patchset: | 865 if change_info.patchset: |
866 trychange_args.extend(["--patchset", str(change_info.patchset)]) | 866 trychange_args.extend(["--patchset", str(change_info.patchset)]) |
867 trychange_args.extend(args) | 867 trychange_args.extend(args) |
868 trychange.TryChange(trychange_args, | 868 file_list = change_info.GetFileNames() |
869 file_list=change_info.GetFileNames(), | |
870 swallow_exception=swallow_exception, | |
871 prog='gcl try') | |
872 else: | 869 else: |
873 trychange_args.extend(args) | 870 trychange_args.extend(args) |
874 trychange.TryChange(trychange_args, | 871 file_list = None |
875 file_list=None, | 872 trychange.TryChange(trychange_args, |
876 swallow_exception=swallow_exception, | 873 file_list=file_list, |
877 prog='gcl try') | 874 swallow_exception=swallow_exception, |
| 875 prog='gcl try') |
878 | 876 |
879 | 877 |
880 def Commit(change_info, args): | 878 def Commit(change_info, args): |
881 if not change_info.GetFiles(): | 879 if not change_info.GetFiles(): |
882 print "Nothing to commit, changelist is empty." | 880 print "Nothing to commit, changelist is empty." |
883 return | 881 return |
884 if not OptionallyDoPresubmitChecks(change_info, True, args): | 882 if not OptionallyDoPresubmitChecks(change_info, True, args): |
885 return | 883 return |
886 | 884 |
887 # We face a problem with svn here: Let's say change 'bleh' modifies | 885 # We face a problem with svn here: Let's say change 'bleh' modifies |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 return 0 | 1239 return 0 |
1242 args =["svn", command] | 1240 args =["svn", command] |
1243 root = GetRepositoryRoot() | 1241 root = GetRepositoryRoot() |
1244 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) | 1242 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) |
1245 RunShell(args, True) | 1243 RunShell(args, True) |
1246 return 0 | 1244 return 0 |
1247 | 1245 |
1248 | 1246 |
1249 if __name__ == "__main__": | 1247 if __name__ == "__main__": |
1250 sys.exit(main()) | 1248 sys.exit(main()) |
OLD | NEW |