summaryrefslogtreecommitdiffstats
path: root/manifest_xml.py
diff options
context:
space:
mode:
authorRaman Tenneti <rtenneti@google.com>2021-03-09 15:19:06 -0800
committerRaman Tenneti <rtenneti@google.com>2021-03-11 01:24:52 +0000
commit080877e41347b8987977fc8cc3ec90dcd149651a (patch)
tree57a8c76bd02da5f9400cdec5da6a75f4e4f2d3f2 /manifest_xml.py
parent9888accb0cf2c17e0f4bbc399782ccd2a4be0196 (diff)
downloadgit-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 'manifest_xml.py')
-rw-r--r--manifest_xml.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/manifest_xml.py b/manifest_xml.py
index e96e0620..6d8fca1d 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -14,6 +14,7 @@
14 14
15import itertools 15import itertools
16import os 16import os
17import platform
17import re 18import re
18import sys 19import sys
19import xml.dom.minidom 20import xml.dom.minidom
@@ -604,6 +605,17 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
604 def HasSubmodules(self): 605 def HasSubmodules(self):
605 return self.manifestProject.config.GetBoolean('repo.submodules') 606 return self.manifestProject.config.GetBoolean('repo.submodules')
606 607
608 def GetDefaultGroupsStr(self):
609 """Returns the default group string for the platform."""
610 return 'default,platform-' + platform.system().lower()
611
612 def GetGroupsStr(self):
613 """Returns the manifest group string that should be synced."""
614 groups = self.manifestProject.config.GetString('manifest.groups')
615 if not groups:
616 groups = self.GetDefaultGroupsStr()
617 return groups
618
607 def _Unload(self): 619 def _Unload(self):
608 self._loaded = False 620 self._loaded = False
609 self._projects = {} 621 self._projects = {}