From e4e94d26ae81dbc9eb6e2f345fac7cd8c533cb9a Mon Sep 17 00:00:00 2001 From: Martin Kelly Date: Tue, 21 Mar 2017 16:05:12 -0700 Subject: init: add --submodules to sync manifest submodules repo sync can sync submodules via the --fetch-submodules option. However, if the manifest repo has submodules, those will not be synced. Having submodules in the manifest repo -- while not commonly done -- can be useful for inheriting a manifest from another project using and layering changes on top of it. In this way, you can avoid having to deal with merge conflicts between your own manifests and the other project's manifests (for example, if you're managing an Android fork). Add a --submodule option to init that automatically syncs the submodules in the manifest repo whenever the manifest repo changes. Change-Id: I45d34f04517774c1462d7f233f482d1d81a332a8 Signed-off-by: Martin Kelly --- subcmds/sync.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'subcmds/sync.py') 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. mp.Sync_NetworkHalf(quiet=opt.quiet, current_branch_only=opt.current_branch_only, no_tags=opt.no_tags, - optimized_fetch=opt.optimized_fetch) + optimized_fetch=opt.optimized_fetch, + submodules=self.manifest.HasSubmodules) if mp.HasChanges: syncbuf = SyncBuffer(mp.config) - mp.Sync_LocalHalf(syncbuf) + mp.Sync_LocalHalf(syncbuf, submodules=self.manifest.HasSubmodules) if not syncbuf.Finish(): sys.exit(1) self._ReloadManifest(manifest_name) -- cgit v1.2.3-54-g00ecf