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

Unified Diff: gclient.py

Issue 1611009: Provide a way to name a solution as part of the config command. (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: Committed Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/gclient_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
===================================================================
--- gclient.py (revision 43846)
+++ gclient.py (working copy)
@@ -153,11 +153,13 @@
top-level DEPS files in each module are read to determine dependent
modules to operate on as well. If optional [url] parameter is
provided, then configuration is read from a specified Subversion server
-URL. Otherwise, a --spec option must be provided.
+URL. Otherwise, a --spec option must be provided. A --name option overrides
+the default name for the solutions.
usage: config [option | url] [safesync url]
Valid options:
+ --name path : alternate relative path for the solution
--spec=GCLIENT_SPEC : contents of .gclient are read from string parameter.
*Note that due to Cygwin/Python brokenness, it
probably can't contain any newlines.*
@@ -165,6 +167,7 @@
Examples:
gclient config https://gclient.googlecode.com/svn/trunk/gclient
configure a new client to check out gclient.py tool sources
+ gclient config --name tools https://gclient.googlecode.com/svn/trunk/gclient
gclient config --spec='solutions=[{"name":"gclient","""
'"url":"https://gclient.googlecode.com/svn/trunk/gclient",'
'"custom_deps":{}}]',
@@ -959,10 +962,12 @@
if options.spec:
client.SetConfig(options.spec)
else:
- # TODO(darin): it would be nice to be able to specify an alternate relpath
- # for the given URL.
base_url = args[0].rstrip('/')
- name = base_url.split("/")[-1]
+ if not options.name:
+ name = base_url.split("/")[-1]
+ else:
+ # specify an alternate relpath for the given URL.
+ name = options.name
safesync_url = ""
if len(args) > 1:
safesync_url = args[1]
@@ -1204,6 +1209,8 @@
option_parser.add_option("", "--snapshot", action="store_true", default=False,
help=("(revinfo only), create a snapshot file "
"of the current version of all repositories"))
+ option_parser.add_option("", "--name",
+ help="specify alternate relative solution path")
option_parser.add_option("", "--gclientfile", default=None,
metavar="FILENAME",
help=("specify an alternate .gclient file"))
« no previous file with comments | « no previous file | tests/gclient_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698