diff options
| author | Andrew Chant <achant@google.com> | 2026-07-17 15:09:06 -0700 |
|---|---|---|
| committer | gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2026-07-21 13:42:38 -0700 |
| commit | 0b82311632d14d3f49675fb6a017c20f7a7dee37 (patch) | |
| tree | 265e41f241585ae11afd6f4b12dfa0e9a60ef726 /subcmds/sync.py | |
| parent | 06c4f9e1cca33a51b5396de2d1d975648e9f2ce4 (diff) | |
| download | git-repo-0b82311632d14d3f49675fb6a017c20f7a7dee37.tar.gz | |
sync: allow syncing groups with repo sync -g group
Similar to how repo init -g can restrict repo syncs to
a subset of the manifest globally, allow "repo sync -g" to only sync a
subset of projects from the manifest when running that specific
sync command.
Change-Id: I4929aad109de05c73a7db42bb27fd8d47eea32fc
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/609481
Reviewed-by: Mike Frysinger <vapier@google.com>
Commit-Queue: Andrew Chant <achant@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Tested-by: Andrew Chant <achant@google.com>
Diffstat (limited to 'subcmds/sync.py')
| -rw-r--r-- | subcmds/sync.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 3fdb36afa..573c3444b 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -559,6 +559,13 @@ later is required to fix a server side protocol bug. | |||
| 559 | metavar="NAME.xml", | 559 | metavar="NAME.xml", |
| 560 | ) | 560 | ) |
| 561 | p.add_option( | 561 | p.add_option( |
| 562 | "-g", | ||
| 563 | "--groups", | ||
| 564 | help="sync projects matching the specific groups. Not persistent " | ||
| 565 | "unlike when used on init", | ||
| 566 | metavar="GROUP", | ||
| 567 | ) | ||
| 568 | p.add_option( | ||
| 562 | "--clone-bundle", | 569 | "--clone-bundle", |
| 563 | action="store_true", | 570 | action="store_true", |
| 564 | help="enable use of /clone.bundle on HTTP/HTTPS", | 571 | help="enable use of /clone.bundle on HTTP/HTTPS", |
| @@ -774,6 +781,7 @@ later is required to fix a server side protocol bug. | |||
| 774 | 781 | ||
| 775 | all_projects = self.GetProjects( | 782 | all_projects = self.GetProjects( |
| 776 | args, | 783 | args, |
| 784 | groups=opt.groups, | ||
| 777 | missing_ok=True, | 785 | missing_ok=True, |
| 778 | submodules_ok=opt.recurse_submodules, | 786 | submodules_ok=opt.recurse_submodules, |
| 779 | manifest=manifest, | 787 | manifest=manifest, |
| @@ -1103,6 +1111,7 @@ later is required to fix a server side protocol bug. | |||
| 1103 | self._ReloadManifest(None, manifest) | 1111 | self._ReloadManifest(None, manifest) |
| 1104 | all_projects = self.GetProjects( | 1112 | all_projects = self.GetProjects( |
| 1105 | args, | 1113 | args, |
| 1114 | groups=opt.groups, | ||
| 1106 | missing_ok=True, | 1115 | missing_ok=True, |
| 1107 | submodules_ok=opt.recurse_submodules, | 1116 | submodules_ok=opt.recurse_submodules, |
| 1108 | manifest=manifest, | 1117 | manifest=manifest, |
| @@ -2350,6 +2359,7 @@ later is required to fix a server side protocol bug. | |||
| 2350 | 2359 | ||
| 2351 | all_projects = self.GetProjects( | 2360 | all_projects = self.GetProjects( |
| 2352 | args, | 2361 | args, |
| 2362 | groups=opt.groups, | ||
| 2353 | missing_ok=True, | 2363 | missing_ok=True, |
| 2354 | submodules_ok=opt.recurse_submodules, | 2364 | submodules_ok=opt.recurse_submodules, |
| 2355 | manifest=manifest, | 2365 | manifest=manifest, |
| @@ -3013,6 +3023,7 @@ later is required to fix a server side protocol bug. | |||
| 3013 | self._ReloadManifest(None, manifest) | 3023 | self._ReloadManifest(None, manifest) |
| 3014 | project_list = self.GetProjects( | 3024 | project_list = self.GetProjects( |
| 3015 | args, | 3025 | args, |
| 3026 | groups=opt.groups, | ||
| 3016 | missing_ok=True, | 3027 | missing_ok=True, |
| 3017 | submodules_ok=opt.recurse_submodules, | 3028 | submodules_ok=opt.recurse_submodules, |
| 3018 | manifest=manifest, | 3029 | manifest=manifest, |
