summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.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 /subcmds/sync.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 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 4d0a5ec6..3451ab6b 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -286,7 +286,7 @@ later is required to fix a server side protocol bug.
286 True if a superproject is requested, otherwise the value of the 286 True if a superproject is requested, otherwise the value of the
287 current_branch option (True, False or None). 287 current_branch option (True, False or None).
288 """ 288 """
289 return git_superproject.UseSuperproject(opt, self.manifest) or opt.current_branch_only 289 return git_superproject.UseSuperproject(opt.use_superproject, self.manifest) or opt.current_branch_only
290 290
291 def _UpdateProjectsRevisionId(self, opt, args, load_local_manifests, superproject_logging_data): 291 def _UpdateProjectsRevisionId(self, opt, args, load_local_manifests, superproject_logging_data):
292 """Update revisionId of every project with the SHA from superproject. 292 """Update revisionId of every project with the SHA from superproject.
@@ -306,7 +306,8 @@ later is required to fix a server side protocol bug.
306 """ 306 """
307 superproject = self.manifest.superproject 307 superproject = self.manifest.superproject
308 superproject.SetQuiet(opt.quiet) 308 superproject.SetQuiet(opt.quiet)
309 print_messages = git_superproject.PrintMessages(opt, self.manifest) 309 print_messages = git_superproject.PrintMessages(opt.use_superproject,
310 self.manifest)
310 superproject.SetPrintMessages(print_messages) 311 superproject.SetPrintMessages(print_messages)
311 if opt.local_only: 312 if opt.local_only:
312 manifest_path = superproject.manifest_path 313 manifest_path = superproject.manifest_path
@@ -993,7 +994,8 @@ later is required to fix a server side protocol bug.
993 self._UpdateManifestProject(opt, mp, manifest_name) 994 self._UpdateManifestProject(opt, mp, manifest_name)
994 995
995 load_local_manifests = not self.manifest.HasLocalManifests 996 load_local_manifests = not self.manifest.HasLocalManifests
996 use_superproject = git_superproject.UseSuperproject(opt, self.manifest) 997 use_superproject = git_superproject.UseSuperproject(opt.use_superproject,
998 self.manifest)
997 if use_superproject and (self.manifest.IsMirror or self.manifest.IsArchive): 999 if use_superproject and (self.manifest.IsMirror or self.manifest.IsArchive):
998 # Don't use superproject, because we have no working tree. 1000 # Don't use superproject, because we have no working tree.
999 use_superproject = False 1001 use_superproject = False