diff options
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/init.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index 6cf39d14..d1c497c1 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -14,6 +14,7 @@ | |||
14 | # limitations under the License. | 14 | # limitations under the License. |
15 | 15 | ||
16 | import os | 16 | import os |
17 | import re | ||
17 | import shutil | 18 | import shutil |
18 | import sys | 19 | import sys |
19 | 20 | ||
@@ -87,7 +88,7 @@ to update the working directory files. | |||
87 | dest='depth', | 88 | dest='depth', |
88 | help='create a shallow clone with given depth; see git clone') | 89 | help='create a shallow clone with given depth; see git clone') |
89 | g.add_option('-g', '--groups', | 90 | g.add_option('-g', '--groups', |
90 | dest='groups', default="", | 91 | dest='groups', default='default', |
91 | help='restrict manifest projects to ones with a specified group', | 92 | help='restrict manifest projects to ones with a specified group', |
92 | metavar='GROUP') | 93 | metavar='GROUP') |
93 | 94 | ||
@@ -139,7 +140,12 @@ to update the working directory files. | |||
139 | r.ResetFetch() | 140 | r.ResetFetch() |
140 | r.Save() | 141 | r.Save() |
141 | 142 | ||
142 | m.config.SetString('manifest.groups', opt.groups) | 143 | groups = re.split('[,\s]+', opt.groups) |
144 | groups = [x for x in groups if x] | ||
145 | groupstr = ','.join(groups) | ||
146 | if groupstr == 'default': | ||
147 | groupstr = None | ||
148 | m.config.SetString('manifest.groups', groupstr) | ||
143 | 149 | ||
144 | if opt.reference: | 150 | if opt.reference: |
145 | m.config.SetString('repo.reference', opt.reference) | 151 | m.config.SetString('repo.reference', opt.reference) |