Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: gclient.py

Issue 7104009: Modify "gclient config url" to act a little bit more like "git clone url". If the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 if os.path.exists(options.config_filename): 983 if os.path.exists(options.config_filename):
984 raise gclient_utils.Error('%s file already exists in the current directory' 984 raise gclient_utils.Error('%s file already exists in the current directory'
985 % options.config_filename) 985 % options.config_filename)
986 client = GClient('.', options) 986 client = GClient('.', options)
987 if options.spec: 987 if options.spec:
988 client.SetConfig(options.spec) 988 client.SetConfig(options.spec)
989 else: 989 else:
990 base_url = args[0].rstrip('/') 990 base_url = args[0].rstrip('/')
991 if not options.name: 991 if not options.name:
992 name = base_url.split('/')[-1] 992 name = base_url.split('/')[-1]
993 if name.endswith('.git'):
994 name = name[:-4]
993 else: 995 else:
994 # specify an alternate relpath for the given URL. 996 # specify an alternate relpath for the given URL.
995 name = options.name 997 name = options.name
996 deps_file = options.deps_file 998 deps_file = options.deps_file
997 if options.git_deps: 999 if options.git_deps:
998 deps_file = '.DEPS.git' 1000 deps_file = '.DEPS.git'
999 safesync_url = '' 1001 safesync_url = ''
1000 if len(args) > 1: 1002 if len(args) > 1:
1001 safesync_url = args[1] 1003 safesync_url = args[1]
1002 client.SetDefaultConfig(name, deps_file, base_url, safesync_url) 1004 client.SetDefaultConfig(name, deps_file, base_url, safesync_url)
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 except (gclient_utils.Error, subprocess2.CalledProcessError), e: 1301 except (gclient_utils.Error, subprocess2.CalledProcessError), e:
1300 print >> sys.stderr, 'Error: %s' % str(e) 1302 print >> sys.stderr, 'Error: %s' % str(e)
1301 return 1 1303 return 1
1302 1304
1303 1305
1304 if '__main__' == __name__: 1306 if '__main__' == __name__:
1305 fix_encoding.fix_encoding() 1307 fix_encoding.fix_encoding()
1306 sys.exit(Main(sys.argv[1:])) 1308 sys.exit(Main(sys.argv[1:]))
1307 1309
1308 # vim: ts=2:sw=2:tw=80:et: 1310 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698