diff options
| author | LaMont Jones <lamontjones@google.com> | 2022-04-11 22:50:11 +0000 |
|---|---|---|
| committer | LaMont Jones <lamontjones@google.com> | 2022-05-26 00:03:37 +0000 |
| commit | bdcba7dc36f1c8e6041681eb5b3b5229c93c7c5c (patch) | |
| tree | ef0dbd149d7e5cd35c4d007a5052ba42bcc1c881 /command.py | |
| parent | 1d00a7e2ae64b6c08aff60c2e7ed5c2d89caf8d6 (diff) | |
| download | git-repo-bdcba7dc36f1c8e6041681eb5b3b5229c93c7c5c.tar.gz git-repo-bdcba7dc36f1c8e6041681eb5b3b5229c93c7c5c.zip | |
sync: add multi-manifest supportv2.26
With this change, partial syncs (sync with a project list) are again
supported.
If the updated manifest includes new sub manifests, download them
inheriting options from the parent manifestProject.
Change-Id: Id952f85df2e26d34e38b251973be26434443ff56
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/334819
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: LaMont Jones <lamontjones@google.com>
Diffstat (limited to 'command.py')
| -rw-r--r-- | command.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/command.py b/command.py index 12fe4172b..bd6d08177 100644 --- a/command.py +++ b/command.py @@ -144,11 +144,10 @@ class Command(object): help=f'number of jobs to run in parallel (default: {default})') m = p.add_option_group('Multi-manifest options') - m.add_option('--outer-manifest', action='store_true', + m.add_option('--outer-manifest', action='store_true', default=None, help='operate starting at the outermost manifest') m.add_option('--no-outer-manifest', dest='outer_manifest', - action='store_false', default=None, - help='do not operate on outer manifests') + action='store_false', help='do not operate on outer manifests') m.add_option('--this-manifest-only', action='store_true', default=None, help='only operate on this (sub)manifest') m.add_option('--no-this-manifest-only', '--all-manifests', @@ -186,6 +185,10 @@ class Command(object): """Validate common options.""" opt.quiet = opt.output_mode is False opt.verbose = opt.output_mode is True + if opt.outer_manifest is None: + # By default, treat multi-manifest instances as a single manifest from + # the user's perspective. + opt.outer_manifest = True def ValidateOptions(self, opt, args): """Validate the user options & arguments before executing. @@ -385,7 +388,7 @@ class Command(object): opt: The command options. """ top = self.outer_manifest - if opt.outer_manifest is False or opt.this_manifest_only: + if not opt.outer_manifest or opt.this_manifest_only: top = self.manifest yield top if not opt.this_manifest_only: |
