OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 """Meta checkout manager supporting both Subversion and GIT. | 6 """Meta checkout manager supporting both Subversion and GIT. |
7 | 7 |
8 Files | 8 Files |
9 .gclient : Current client configuration, written by 'config' command. | 9 .gclient : Current client configuration, written by 'config' command. |
10 Format is a Python script defining 'solutions', a list whose | 10 Format is a Python script defining 'solutions', a list whose |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 scm_set.update(scm.split(',')) | 881 scm_set.update(scm.split(',')) |
882 | 882 |
883 # Pass in the SCM type as an env variable | 883 # Pass in the SCM type as an env variable |
884 env = os.environ.copy() | 884 env = os.environ.copy() |
885 | 885 |
886 for path, url in entries.iteritems(): | 886 for path, url in entries.iteritems(): |
887 scm = gclient_scm.GetScmName(url) | 887 scm = gclient_scm.GetScmName(url) |
888 if scm_set and scm not in scm_set: | 888 if scm_set and scm not in scm_set: |
889 continue | 889 continue |
890 cwd = os.path.normpath(os.path.join(root, path)) | 890 cwd = os.path.normpath(os.path.join(root, path)) |
891 env['GCLIENT_SCM'] = scm | 891 if scm: |
892 env['GCLIENT_URL'] = url | 892 env['GCLIENT_SCM'] = scm |
893 subprocess.Popen(args, cwd=cwd, env=env).communicate() | 893 if url: |
| 894 env['GCLIENT_URL'] = url |
| 895 gclient_utils.Popen(args, cwd=cwd, env=env).communicate() |
| 896 return 0 |
894 | 897 |
895 | 898 |
896 @attr('usage', '[url] [safesync url]') | 899 @attr('usage', '[url] [safesync url]') |
897 def CMDconfig(parser, args): | 900 def CMDconfig(parser, args): |
898 """Create a .gclient file in the current directory. | 901 """Create a .gclient file in the current directory. |
899 | 902 |
900 This specifies the configuration for further commands. After update/sync, | 903 This specifies the configuration for further commands. After update/sync, |
901 top-level DEPS files in each module are read to determine dependent | 904 top-level DEPS files in each module are read to determine dependent |
902 modules to operate on as well. If optional [url] parameter is | 905 modules to operate on as well. If optional [url] parameter is |
903 provided, then configuration is read from a specified Subversion server | 906 provided, then configuration is read from a specified Subversion server |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 return CMDhelp(parser, argv) | 1237 return CMDhelp(parser, argv) |
1235 except gclient_utils.Error, e: | 1238 except gclient_utils.Error, e: |
1236 print >> sys.stderr, 'Error: %s' % str(e) | 1239 print >> sys.stderr, 'Error: %s' % str(e) |
1237 return 1 | 1240 return 1 |
1238 | 1241 |
1239 | 1242 |
1240 if '__main__' == __name__: | 1243 if '__main__' == __name__: |
1241 sys.exit(Main(sys.argv[1:])) | 1244 sys.exit(Main(sys.argv[1:])) |
1242 | 1245 |
1243 # vim: ts=2:sw=2:tw=80:et: | 1246 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |