sync: added --no-use-superproject to disable superproject.

Tested the code with the following commands.

$ ./run_tests -v

$ repo_dev sync -c -j8 --no-use-superproject
Fetching: 100% (1041/1041), done in 1m22.743s

$ repo_dev sync -c -j8 --use-superproject
WARNING: --use-superproject is experimental and not for general use
..

Bug: [google internal] b/187459275
Change-Id: I3f4269df38cd24a21723e8b2be5a1f013e7b5a91
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305682
Tested-by: Raman Tenneti <rtenneti@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Raman Tenneti 2021-05-07 14:01:54 -07:00
parent f907ced0fe
commit 23ea754524

View File

@ -235,6 +235,9 @@ later is required to fix a server side protocol bug.
help='fetch submodules from server')
p.add_option('--use-superproject', action='store_true',
help='use the manifest superproject to sync projects')
p.add_option('--no-use-superproject', action='store_false',
dest='use_superproject',
help='disable use of manifest superprojects')
p.add_option('--tags',
action='store_false',
help='fetch tags')
@ -276,9 +279,10 @@ later is required to fix a server side protocol bug.
def _UseSuperproject(self, opt):
"""Returns True if use-superproject option is enabled"""
return (opt.use_superproject or
self.manifest.manifestProject.config.GetBoolean(
'repo.superproject'))
if opt.use_superproject is not None:
return opt.use_superproject
else:
return self.manifest.manifestProject.config.GetBoolean('repo.superproject')
def _GetCurrentBranchOnly(self, opt):
"""Returns True if current-branch or use-superproject options are enabled."""