summaryrefslogtreecommitdiffstats
path: root/subcmds/init.py
diff options
context:
space:
mode:
authorDavid Holmer <odinguru@gmail.com>2012-11-14 19:19:00 -0500
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-04-03 22:27:45 +0000
commit0a1c6a1c16e2c89f98158cb2f79dda1583a8fac4 (patch)
tree2446c673c4eddf2a499e36b4e898ea258a6d3c7a /subcmds/init.py
parent33e045673786f3477e805ade0f337de08e89a7a8 (diff)
downloadgit-repo-0a1c6a1c16e2c89f98158cb2f79dda1583a8fac4.tar.gz
Special handling for manifest group "default"
Change Details: * Make "default" a special manifest group that matches any project that does not have the special project group "notdefault" * Use "default" instead of "all,-notdefault" when user does not specify manifest group * Expand -g option help to include example usage of manifest groups Change Benefits: * Allow a more intuitive and expressive manifest groups specification: * "default" instead of "all,-notdefault" * "default,foo" instead of "all,-notdefault,foo" * "default,-foo" instead of "all,-notdefault,-foo" * "foo,-default" which has no equivalent * Default manifest groups behavior can be restored by the command 'repo init -g default'. This is significantly more intuitive than the current equivalent command 'repo init -g all,-notdefault'. Change-Id: I6d0673791d64a650110a917c248bcebb23b279d3
Diffstat (limited to 'subcmds/init.py')
-rw-r--r--subcmds/init.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/subcmds/init.py b/subcmds/init.py
index 11312601..29730cc4 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -91,8 +91,9 @@ to update the working directory files.
91 dest='depth', 91 dest='depth',
92 help='create a shallow clone with given depth; see git clone') 92 help='create a shallow clone with given depth; see git clone')
93 g.add_option('-g', '--groups', 93 g.add_option('-g', '--groups',
94 dest='groups', default='all,-notdefault', 94 dest='groups', default='default',
95 help='restrict manifest projects to ones with a specified group', 95 help='restrict manifest projects to ones with specified '
96 'group(s) [default|all|G1,G2,G3|G4,-G5,-G6]',
96 metavar='GROUP') 97 metavar='GROUP')
97 g.add_option('-p', '--platform', 98 g.add_option('-p', '--platform',
98 dest='platform', default='auto', 99 dest='platform', default='auto',
@@ -169,7 +170,7 @@ to update the working directory files.
169 170
170 groups = [x for x in groups if x] 171 groups = [x for x in groups if x]
171 groupstr = ','.join(groups) 172 groupstr = ','.join(groups)
172 if opt.platform == 'auto' and groupstr == 'all,-notdefault,platform-' + platform.system().lower(): 173 if opt.platform == 'auto' and groupstr == 'default,platform-' + platform.system().lower():
173 groupstr = None 174 groupstr = None
174 m.config.SetString('manifest.groups', groupstr) 175 m.config.SetString('manifest.groups', groupstr)
175 176