summaryrefslogtreecommitdiffstats
path: root/subcmds
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/abandon.py2
-rw-r--r--subcmds/gitc_delete.py2
-rw-r--r--subcmds/init.py10
-rw-r--r--subcmds/sync.py5
4 files changed, 12 insertions, 7 deletions
diff --git a/subcmds/abandon.py b/subcmds/abandon.py
index 6f78da74..be32dc5c 100644
--- a/subcmds/abandon.py
+++ b/subcmds/abandon.py
@@ -81,7 +81,7 @@ It is equivalent to "git branch -D <branchname>".
81 err_msg = "error: cannot abandon %s" %br 81 err_msg = "error: cannot abandon %s" %br
82 print(err_msg, file=sys.stderr) 82 print(err_msg, file=sys.stderr)
83 for proj in err[br]: 83 for proj in err[br]:
84 print(' '*len(err_msg) + " | %s" % p.relpath, file=sys.stderr) 84 print(' '*len(err_msg) + " | %s" % proj.relpath, file=sys.stderr)
85 sys.exit(1) 85 sys.exit(1)
86 elif not success: 86 elif not success:
87 print('error: no project has local branch(es) : %s' % nb, 87 print('error: no project has local branch(es) : %s' % nb,
diff --git a/subcmds/gitc_delete.py b/subcmds/gitc_delete.py
index 7380c352..19caac5a 100644
--- a/subcmds/gitc_delete.py
+++ b/subcmds/gitc_delete.py
@@ -14,12 +14,10 @@
14# limitations under the License. 14# limitations under the License.
15 15
16from __future__ import print_function 16from __future__ import print_function
17import os
18import shutil 17import shutil
19import sys 18import sys
20 19
21from command import Command, GitcClientCommand 20from command import Command, GitcClientCommand
22import gitc_utils
23 21
24from pyversion import is_python3 22from pyversion import is_python3
25if not is_python3(): 23if not is_python3():
diff --git a/subcmds/init.py b/subcmds/init.py
index bb7187d7..b260ec0f 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -111,6 +111,9 @@ to update the working directory files.
111 dest='archive', action='store_true', 111 dest='archive', action='store_true',
112 help='checkout an archive instead of a git repository for ' 112 help='checkout an archive instead of a git repository for '
113 'each project. See git archive.') 113 'each project. See git archive.')
114 g.add_option('--submodules',
115 dest='submodules', action='store_true',
116 help='sync any submodules associated with the manifest repo')
114 g.add_option('-g', '--groups', 117 g.add_option('-g', '--groups',
115 dest='groups', default='default', 118 dest='groups', default='default',
116 help='restrict manifest projects to ones with specified ' 119 help='restrict manifest projects to ones with specified '
@@ -236,10 +239,13 @@ to update the working directory files.
236 'in another location.', file=sys.stderr) 239 'in another location.', file=sys.stderr)
237 sys.exit(1) 240 sys.exit(1)
238 241
242 if opt.submodules:
243 m.config.SetString('repo.submodules', 'true')
244
239 if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet, 245 if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet,
240 clone_bundle=not opt.no_clone_bundle, 246 clone_bundle=not opt.no_clone_bundle,
241 current_branch_only=opt.current_branch_only, 247 current_branch_only=opt.current_branch_only,
242 no_tags=opt.no_tags): 248 no_tags=opt.no_tags, submodules=opt.submodules):
243 r = m.GetRemote(m.remote.name) 249 r = m.GetRemote(m.remote.name)
244 print('fatal: cannot obtain manifest %s' % r.url, file=sys.stderr) 250 print('fatal: cannot obtain manifest %s' % r.url, file=sys.stderr)
245 251
@@ -253,7 +259,7 @@ to update the working directory files.
253 m.MetaBranchSwitch() 259 m.MetaBranchSwitch()
254 260
255 syncbuf = SyncBuffer(m.config) 261 syncbuf = SyncBuffer(m.config)
256 m.Sync_LocalHalf(syncbuf) 262 m.Sync_LocalHalf(syncbuf, submodules=opt.submodules)
257 syncbuf.Finish() 263 syncbuf.Finish()
258 264
259 if is_new or m.CurrentBranch is None: 265 if is_new or m.CurrentBranch is None:
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 8e8529ee..82056f33 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -723,11 +723,12 @@ later is required to fix a server side protocol bug.
723 mp.Sync_NetworkHalf(quiet=opt.quiet, 723 mp.Sync_NetworkHalf(quiet=opt.quiet,
724 current_branch_only=opt.current_branch_only, 724 current_branch_only=opt.current_branch_only,
725 no_tags=opt.no_tags, 725 no_tags=opt.no_tags,
726 optimized_fetch=opt.optimized_fetch) 726 optimized_fetch=opt.optimized_fetch,
727 submodules=self.manifest.HasSubmodules)
727 728
728 if mp.HasChanges: 729 if mp.HasChanges:
729 syncbuf = SyncBuffer(mp.config) 730 syncbuf = SyncBuffer(mp.config)
730 mp.Sync_LocalHalf(syncbuf) 731 mp.Sync_LocalHalf(syncbuf, submodules=self.manifest.HasSubmodules)
731 if not syncbuf.Finish(): 732 if not syncbuf.Finish():
732 sys.exit(1) 733 sys.exit(1)
733 self._ReloadManifest(manifest_name) 734 self._ReloadManifest(manifest_name)