diff options
author | Raman Tenneti <rtenneti@google.com> | 2021-03-09 15:19:06 -0800 |
---|---|---|
committer | Raman Tenneti <rtenneti@google.com> | 2021-03-11 01:24:52 +0000 |
commit | 080877e41347b8987977fc8cc3ec90dcd149651a (patch) | |
tree | 57a8c76bd02da5f9400cdec5da6a75f4e4f2d3f2 /git_superproject.py | |
parent | 9888accb0cf2c17e0f4bbc399782ccd2a4be0196 (diff) | |
download | git-repo-080877e41347b8987977fc8cc3ec90dcd149651a.tar.gz |
superproject: pass groups to ToXml method.
Added the following methods to XmlManifest class.
+ GetDefaultGroupsStr() - return 'default,platform-' + platform.system().lower()
+ GetGroupsStr() - Same as gitc_utils.py's _manifest_groups func.
+ Replaced gitc_utils.py's_manifest_groups calls with GetGroupsStr.
+ Used the above methods to get groups in command.py::GetProjects
and part of init.py.
TODO: clean up these funcs to take structured group data more instead
of passing strings around everywhere that need parsing.
Tested the code with the following commands.
$ ./run_tests -v
Tested the sync code by using repo_dev alias and pointing to this CL
and verified prebuilts/fullsdk-linux directory has all the folders.
Tested repo init and repo sync with --use-superproject and without
--use-superproject argument.
$ repo_dev init -u sso://android.git.corp.google.com/platform/manifest -b androidx-main --partial-clone --clone-filter=blob:limit=10M --repo-rev=main --use-superproject
$ repo_dev sync -c -j32
Bug: [google internal] b/181804931
Bug: https://crbug.com/gerrit/13707
Change-Id: Ia98585cbfa3a1449710655af55d56241794242b6
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/299422
Reviewed-by: Jonathan Nieder <jrn@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Raman Tenneti <rtenneti@google.com>
Diffstat (limited to 'git_superproject.py')
-rw-r--r-- | git_superproject.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/git_superproject.py b/git_superproject.py index 651da48a..7f0582cb 100644 --- a/git_superproject.py +++ b/git_superproject.py | |||
@@ -235,7 +235,7 @@ class Superproject(object): | |||
235 | self._superproject_path, | 235 | self._superproject_path, |
236 | file=sys.stderr) | 236 | file=sys.stderr) |
237 | return None | 237 | return None |
238 | manifest_str = self._manifest.ToXml().toxml() | 238 | manifest_str = self._manifest.ToXml(groups=self._manifest.GetGroupsStr()).toxml() |
239 | manifest_path = self._manifest_path | 239 | manifest_path = self._manifest_path |
240 | try: | 240 | try: |
241 | with open(manifest_path, 'w', encoding='utf-8') as fp: | 241 | with open(manifest_path, 'w', encoding='utf-8') as fp: |