diff options
author | Gavin Mak <gavinmak@google.com> | 2025-05-05 14:13:48 -0700 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2025-05-05 15:10:49 -0700 |
commit | 8d37f6147174fe170cc00a1d82b1cc5fe8ec0a7b (patch) | |
tree | ed1f7413c2e9093243b7f4d83377e2a72d47742e /subcmds | |
parent | 1acbc14c34f264e0158436dc3d0265d500848462 (diff) | |
download | git-repo-8d37f6147174fe170cc00a1d82b1cc5fe8ec0a7b.tar.gz |
upload: Add superproject identifier as push optionmain
When uploading, add the root superproject repo as a push option in the
format `-o custom-keyed-value=rootRepo:$HOST/$PROJECT`.
Bug: b/401147338
Change-Id: I00230256eb7ae307b03840bb4090c28dc8a0505e
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/472601
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Tested-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/upload.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index bac2f8ac..2837ff51 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -628,6 +628,13 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
628 | branch.uploaded = False | 628 | branch.uploaded = False |
629 | return | 629 | return |
630 | 630 | ||
631 | # If using superproject, add the root repo as a push option. | ||
632 | manifest = branch.project.manifest | ||
633 | push_options = list(opt.push_options) | ||
634 | sp = manifest.superproject | ||
635 | if sp and sp.repo_id and manifest.manifestProject.use_superproject: | ||
636 | push_options.append(f"custom-keyed-value=rootRepo:{sp.repo_id}") | ||
637 | |||
631 | branch.UploadForReview( | 638 | branch.UploadForReview( |
632 | people, | 639 | people, |
633 | dryrun=opt.dryrun, | 640 | dryrun=opt.dryrun, |
@@ -640,7 +647,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
640 | ready=opt.ready, | 647 | ready=opt.ready, |
641 | dest_branch=destination, | 648 | dest_branch=destination, |
642 | validate_certs=opt.validate_certs, | 649 | validate_certs=opt.validate_certs, |
643 | push_options=opt.push_options, | 650 | push_options=push_options, |
644 | patchset_description=opt.patchset_description, | 651 | patchset_description=opt.patchset_description, |
645 | ) | 652 | ) |
646 | 653 | ||