summaryrefslogtreecommitdiffstats
path: root/git_superproject.py
diff options
context:
space:
mode:
authorLaMont Jones <lamontjones@google.com>2022-04-14 14:41:13 +0000
committerLaMont Jones <lamontjones@google.com>2022-04-14 22:23:16 +0000
commit5fa912b0d148cf92f72640ac7dcff98c5db11853 (patch)
tree808eea4e1fcf848cd1faa2cb044a1aa86d7ddbf9 /git_superproject.py
parent4ada043dc0045a0e58fcad37e1f50c6b0c9acc61 (diff)
downloadgit-repo-5fa912b0d148cf92f72640ac7dcff98c5db11853.tar.gz
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 <lamontjones@google.com> Reviewed-by: Raman Tenneti <rtenneti@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'git_superproject.py')
-rw-r--r--git_superproject.py24
1 files changed, 17 insertions, 7 deletions
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():
415 return False 415 return False
416 416
417 417
418def PrintMessages(opt, manifest): 418def PrintMessages(use_superproject, manifest):
419 """Returns a boolean if error/warning messages are to be printed.""" 419 """Returns a boolean if error/warning messages are to be printed.
420 return opt.use_superproject is not None or bool(manifest.superproject) 420
421 Args:
422 use_superproject: option value from optparse.
423 manifest: manifest to use.
424 """
425 return use_superproject is not None or bool(manifest.superproject)
421 426
422 427
423def UseSuperproject(opt, manifest): 428def UseSuperproject(use_superproject, manifest):
424 """Returns a boolean if use-superproject option is enabled.""" 429 """Returns a boolean if use-superproject option is enabled.
430
431 Args:
432 use_superproject: option value from optparse.
433 manifest: manifest to use.
434 """
425 435
426 if opt.use_superproject is not None: 436 if use_superproject is not None:
427 return opt.use_superproject 437 return use_superproject
428 else: 438 else:
429 client_value = manifest.manifestProject.use_superproject 439 client_value = manifest.manifestProject.use_superproject
430 if client_value is not None: 440 if client_value is not None: