diff options
| -rw-r--r-- | docs/manifest-format.md | 6 | ||||
| -rw-r--r-- | tests/test_manifest_xml.py | 21 |
2 files changed, 27 insertions, 0 deletions
diff --git a/docs/manifest-format.md b/docs/manifest-format.md index 8e5e2874..6156333a 100644 --- a/docs/manifest-format.md +++ b/docs/manifest-format.md | |||
| @@ -109,6 +109,12 @@ following DTD: | |||
| 109 | ]> | 109 | ]> |
| 110 | ``` | 110 | ``` |
| 111 | 111 | ||
| 112 | For compatibility purposes across repo releases, all unknown elements are | ||
| 113 | silently ignored. However, repo reserves all possible names for itself for | ||
| 114 | future use. If you want to use custom elements, the `x-*` namespace is | ||
| 115 | reserved for that purpose, and repo guarantees to never allocate any | ||
| 116 | corresponding names. | ||
| 117 | |||
| 112 | A description of the elements and their attributes follows. | 118 | A description of the elements and their attributes follows. |
| 113 | 119 | ||
| 114 | 120 | ||
diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py index e4adf3c9..e2c83af9 100644 --- a/tests/test_manifest_xml.py +++ b/tests/test_manifest_xml.py | |||
| @@ -280,6 +280,27 @@ class XmlManifestTests(unittest.TestCase): | |||
| 280 | '<superproject name="superproject"/>' + | 280 | '<superproject name="superproject"/>' + |
| 281 | '</manifest>') | 281 | '</manifest>') |
| 282 | 282 | ||
| 283 | def test_unknown_tags(self): | ||
| 284 | """Check superproject settings.""" | ||
| 285 | manifest = self.getXmlManifest(""" | ||
| 286 | <manifest> | ||
| 287 | <remote name="test-remote" fetch="http://localhost" /> | ||
| 288 | <default remote="test-remote" revision="refs/heads/main" /> | ||
| 289 | <superproject name="superproject"/> | ||
| 290 | <iankaz value="unknown (possible) future tags are ignored"/> | ||
| 291 | <x-custom-tag>X tags are always ignored</x-custom-tag> | ||
| 292 | </manifest> | ||
| 293 | """) | ||
| 294 | self.assertEqual(manifest.superproject['name'], 'superproject') | ||
| 295 | self.assertEqual(manifest.superproject['remote'].name, 'test-remote') | ||
| 296 | self.assertEqual( | ||
| 297 | manifest.ToXml().toxml(), | ||
| 298 | '<?xml version="1.0" ?><manifest>' + | ||
| 299 | '<remote name="test-remote" fetch="http://localhost"/>' + | ||
| 300 | '<default remote="test-remote" revision="refs/heads/main"/>' + | ||
| 301 | '<superproject name="superproject"/>' + | ||
| 302 | '</manifest>') | ||
| 303 | |||
| 283 | def test_project_group(self): | 304 | def test_project_group(self): |
| 284 | """Check project group settings.""" | 305 | """Check project group settings.""" |
| 285 | manifest = self.getXmlManifest(""" | 306 | manifest = self.getXmlManifest(""" |
