diff options
Diffstat (limited to 'manifest_xml.py')
-rw-r--r-- | manifest_xml.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index e1d630b3..9cbdcd18 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
@@ -12,6 +12,7 @@ | |||
12 | # See the License for the specific language governing permissions and | 12 | # See the License for the specific language governing permissions and |
13 | # limitations under the License. | 13 | # limitations under the License. |
14 | 14 | ||
15 | import collections | ||
15 | import itertools | 16 | import itertools |
16 | import os | 17 | import os |
17 | import platform | 18 | import platform |
@@ -27,11 +28,15 @@ import platform_utils | |||
27 | from project import RemoteSpec, Project, MetaProject | 28 | from project import RemoteSpec, Project, MetaProject |
28 | from error import (ManifestParseError, ManifestInvalidPathError, | 29 | from error import (ManifestParseError, ManifestInvalidPathError, |
29 | ManifestInvalidRevisionError) | 30 | ManifestInvalidRevisionError) |
31 | from wrapper import Wrapper | ||
30 | 32 | ||
31 | MANIFEST_FILE_NAME = 'manifest.xml' | 33 | MANIFEST_FILE_NAME = 'manifest.xml' |
32 | LOCAL_MANIFEST_NAME = 'local_manifest.xml' | 34 | LOCAL_MANIFEST_NAME = 'local_manifest.xml' |
33 | LOCAL_MANIFESTS_DIR_NAME = 'local_manifests' | 35 | LOCAL_MANIFESTS_DIR_NAME = 'local_manifests' |
34 | 36 | ||
37 | # ContactInfo has the self-registered bug url, supplied by the manifest authors. | ||
38 | ContactInfo = collections.namedtuple('ContactInfo', 'bugurl') | ||
39 | |||
35 | # urljoin gets confused if the scheme is not known. | 40 | # urljoin gets confused if the scheme is not known. |
36 | urllib.parse.uses_relative.extend([ | 41 | urllib.parse.uses_relative.extend([ |
37 | 'ssh', | 42 | 'ssh', |
@@ -479,10 +484,10 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
479 | e.setAttribute('remote', remoteName) | 484 | e.setAttribute('remote', remoteName) |
480 | root.appendChild(e) | 485 | root.appendChild(e) |
481 | 486 | ||
482 | if self._contactinfo: | 487 | if self._contactinfo.bugurl != Wrapper().BUG_URL: |
483 | root.appendChild(doc.createTextNode('')) | 488 | root.appendChild(doc.createTextNode('')) |
484 | e = doc.createElement('contactinfo') | 489 | e = doc.createElement('contactinfo') |
485 | e.setAttribute('bugurl', self._contactinfo['bugurl']) | 490 | e.setAttribute('bugurl', self._contactinfo.bugurl) |
486 | root.appendChild(e) | 491 | root.appendChild(e) |
487 | 492 | ||
488 | return doc | 493 | return doc |
@@ -646,7 +651,7 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
646 | self._default = None | 651 | self._default = None |
647 | self._repo_hooks_project = None | 652 | self._repo_hooks_project = None |
648 | self._superproject = {} | 653 | self._superproject = {} |
649 | self._contactinfo = {} | 654 | self._contactinfo = ContactInfo(Wrapper().BUG_URL) |
650 | self._notice = None | 655 | self._notice = None |
651 | self.branch = None | 656 | self.branch = None |
652 | self._manifest_server = None | 657 | self._manifest_server = None |
@@ -892,7 +897,8 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
892 | if node.nodeName == 'contactinfo': | 897 | if node.nodeName == 'contactinfo': |
893 | bugurl = self._reqatt(node, 'bugurl') | 898 | bugurl = self._reqatt(node, 'bugurl') |
894 | # This element can be repeated, later entries will clobber earlier ones. | 899 | # This element can be repeated, later entries will clobber earlier ones. |
895 | self._contactinfo['bugurl'] = bugurl | 900 | self._contactinfo = ContactInfo(bugurl) |
901 | |||
896 | if node.nodeName == 'remove-project': | 902 | if node.nodeName == 'remove-project': |
897 | name = self._reqatt(node, 'name') | 903 | name = self._reqatt(node, 'name') |
898 | 904 | ||