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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 def FindGclientRootDir(from_dir): | 874 def FindGclientRootDir(from_dir): |
875 path = os.path.realpath(from_dir) | 875 path = os.path.realpath(from_dir) |
876 while not os.path.exists(os.path.join(path, '.gclient')): | 876 while not os.path.exists(os.path.join(path, '.gclient')): |
877 next = os.path.split(path) | 877 next = os.path.split(path) |
878 if not next[1]: | 878 if not next[1]: |
879 return None | 879 return None |
880 path = next[0] | 880 path = next[0] |
881 return path | 881 return path |
882 | 882 |
883 trychange_args = [] | 883 trychange_args = [] |
| 884 settings = { |
| 885 'port': GetCodeReviewSetting('TRYSERVER_HTTP_PORT'), |
| 886 'host': GetCodeReviewSetting('TRYSERVER_HTTP_HOST'), |
| 887 'svn_repo': GetCodeReviewSetting('TRYSERVER_SVN_URL'), |
| 888 'project': GetCodeReviewSetting('TRYSERVER_PROJECT'), |
| 889 'root': GetCodeReviewSetting('TRYSERVER_ROOT'), |
| 890 'patchlevel': GetCodeReviewSetting('TRYSERVER_PATCHLEVEL'), |
| 891 } |
| 892 for (k, v) in settings.iteritems(): |
| 893 if v: |
| 894 trychange_args.extend(['--' + k, v]) |
| 895 |
884 gclient_root = FindGclientRootDir(GetRepositoryRoot()) | 896 gclient_root = FindGclientRootDir(GetRepositoryRoot()) |
885 if gclient_root: | 897 if gclient_root: |
886 trychange_args.extend(['--root', PathDifference(gclient_root, | 898 trychange_args.extend(['--root', PathDifference(gclient_root, |
887 GetRepositoryRoot())]) | 899 GetRepositoryRoot())]) |
888 if change_info: | 900 if change_info: |
889 trychange_args.extend(['--name', change_info.name]) | 901 trychange_args.extend(['--name', change_info.name]) |
890 if change_info.issue: | 902 if change_info.issue: |
891 trychange_args.extend(["--issue", str(change_info.issue)]) | 903 trychange_args.extend(["--issue", str(change_info.issue)]) |
892 if change_info.patchset: | 904 if change_info.patchset: |
893 trychange_args.extend(["--patchset", str(change_info.patchset)]) | 905 trychange_args.extend(["--patchset", str(change_info.patchset)]) |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 return 0 | 1280 return 0 |
1269 args =["svn", command] | 1281 args =["svn", command] |
1270 root = GetRepositoryRoot() | 1282 root = GetRepositoryRoot() |
1271 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) | 1283 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) |
1272 RunShell(args, True) | 1284 RunShell(args, True) |
1273 return 0 | 1285 return 0 |
1274 | 1286 |
1275 | 1287 |
1276 if __name__ == "__main__": | 1288 if __name__ == "__main__": |
1277 sys.exit(main()) | 1289 sys.exit(main()) |
OLD | NEW |