From 5fa912b0d148cf92f72640ac7dcff98c5db11853 Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Thu, 14 Apr 2022 14:41:13 +0000 Subject: Stop passing optparse.Values to git_superproject Make git_superproject independent of the command line by passing the specific value instead of requiring the caller to have an optparse.Values object to pass in. Flag --use-superproject and --archive as incompatible in subcmds/init.py Change-Id: Ied7c874b312e151038df903c8af4328f070f387c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/335135 Tested-by: LaMont Jones Reviewed-by: Raman Tenneti Reviewed-by: Mike Frysinger --- git_superproject.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'git_superproject.py') diff --git a/git_superproject.py b/git_superproject.py index 1293f352..07bc2645 100644 --- a/git_superproject.py +++ b/git_superproject.py @@ -415,16 +415,26 @@ def _UseSuperprojectFromConfiguration(): return False -def PrintMessages(opt, manifest): - """Returns a boolean if error/warning messages are to be printed.""" - return opt.use_superproject is not None or bool(manifest.superproject) +def PrintMessages(use_superproject, manifest): + """Returns a boolean if error/warning messages are to be printed. + + Args: + use_superproject: option value from optparse. + manifest: manifest to use. + """ + return use_superproject is not None or bool(manifest.superproject) -def UseSuperproject(opt, manifest): - """Returns a boolean if use-superproject option is enabled.""" +def UseSuperproject(use_superproject, manifest): + """Returns a boolean if use-superproject option is enabled. + + Args: + use_superproject: option value from optparse. + manifest: manifest to use. + """ - if opt.use_superproject is not None: - return opt.use_superproject + if use_superproject is not None: + return use_superproject else: client_value = manifest.manifestProject.use_superproject if client_value is not None: -- cgit v1.2.3-54-g00ecf