|
@@ -637,7 +637,7 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
|
|
|
|
|
|
|
|
self._loaded = True
|
|
self._loaded = True
|
|
|
|
|
|
|
|
- def _ParseManifestXml(self, path, include_root):
|
|
|
|
|
|
|
+ def _ParseManifestXml(self, path, include_root, parent_groups=''):
|
|
|
try:
|
|
try:
|
|
|
root = xml.dom.minidom.parse(path)
|
|
root = xml.dom.minidom.parse(path)
|
|
|
except (OSError, xml.parsers.expat.ExpatError) as e:
|
|
except (OSError, xml.parsers.expat.ExpatError) as e:
|
|
@@ -656,12 +656,17 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
|
|
|
for node in manifest.childNodes:
|
|
for node in manifest.childNodes:
|
|
|
if node.nodeName == 'include':
|
|
if node.nodeName == 'include':
|
|
|
name = self._reqatt(node, 'name')
|
|
name = self._reqatt(node, 'name')
|
|
|
|
|
+ include_groups = ''
|
|
|
|
|
+ if parent_groups:
|
|
|
|
|
+ include_groups = parent_groups
|
|
|
|
|
+ if node.hasAttribute('groups'):
|
|
|
|
|
+ include_groups = node.getAttribute('groups') + ',' + include_groups
|
|
|
fp = os.path.join(include_root, name)
|
|
fp = os.path.join(include_root, name)
|
|
|
if not os.path.isfile(fp):
|
|
if not os.path.isfile(fp):
|
|
|
raise ManifestParseError("include %s doesn't exist or isn't a file"
|
|
raise ManifestParseError("include %s doesn't exist or isn't a file"
|
|
|
% (name,))
|
|
% (name,))
|
|
|
try:
|
|
try:
|
|
|
- nodes.extend(self._ParseManifestXml(fp, include_root))
|
|
|
|
|
|
|
+ nodes.extend(self._ParseManifestXml(fp, include_root, include_groups))
|
|
|
# should isolate this to the exact exception, but that's
|
|
# should isolate this to the exact exception, but that's
|
|
|
# tricky. actual parsing implementation may vary.
|
|
# tricky. actual parsing implementation may vary.
|
|
|
except (KeyboardInterrupt, RuntimeError, SystemExit):
|
|
except (KeyboardInterrupt, RuntimeError, SystemExit):
|
|
@@ -670,6 +675,11 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
|
|
|
raise ManifestParseError(
|
|
raise ManifestParseError(
|
|
|
"failed parsing included manifest %s: %s" % (name, e))
|
|
"failed parsing included manifest %s: %s" % (name, e))
|
|
|
else:
|
|
else:
|
|
|
|
|
+ if parent_groups and node.nodeName == 'project':
|
|
|
|
|
+ nodeGroups = parent_groups
|
|
|
|
|
+ if node.hasAttribute('groups'):
|
|
|
|
|
+ nodeGroups = node.getAttribute('groups') + ',' + nodeGroups
|
|
|
|
|
+ node.setAttribute('groups', nodeGroups)
|
|
|
nodes.append(node)
|
|
nodes.append(node)
|
|
|
return nodes
|
|
return nodes
|
|
|
|
|
|