diff options
author | Luis Hector Chavez <lhchavez@google.com> | 2018-03-15 09:54:08 -0700 |
---|---|---|
committer | Luis Hector Chavez <lhchavez@google.com> | 2018-03-15 09:55:54 -0700 |
commit | 7d52585ec4719ce0314c6d1a20216fc0128d6883 (patch) | |
tree | 1356e1f9d4b6846cabee9400ca1cf7fedb73c94a | |
parent | 1f365701b32fbf657fc8277d1fee3656f2501383 (diff) | |
download | git-repo-7d52585ec4719ce0314c6d1a20216fc0128d6883.tar.gz |
Add a way to override the revision of an <extend-project>
This change adds support for the 'revision' attribute in
<extend-project>. This avoids the need to perform a <remove-project>
followed by a <project> in local manifests.
Change-Id: Id2834fcfc1ae0d74b3347bed3618f250bf696b1f
-rw-r--r-- | docs/manifest-format.txt | 4 | ||||
-rw-r--r-- | manifest_xml.py | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/docs/manifest-format.txt b/docs/manifest-format.txt index 0e6cbe32..56bdf142 100644 --- a/docs/manifest-format.txt +++ b/docs/manifest-format.txt | |||
@@ -86,6 +86,7 @@ following DTD: | |||
86 | <!ATTLIST extend-project name CDATA #REQUIRED> | 86 | <!ATTLIST extend-project name CDATA #REQUIRED> |
87 | <!ATTLIST extend-project path CDATA #IMPLIED> | 87 | <!ATTLIST extend-project path CDATA #IMPLIED> |
88 | <!ATTLIST extend-project groups CDATA #IMPLIED> | 88 | <!ATTLIST extend-project groups CDATA #IMPLIED> |
89 | <!ATTLIST extend-project revision CDATA #IMPLIED> | ||
89 | 90 | ||
90 | <!ELEMENT remove-project EMPTY> | 91 | <!ELEMENT remove-project EMPTY> |
91 | <!ATTLIST remove-project name CDATA #REQUIRED> | 92 | <!ATTLIST remove-project name CDATA #REQUIRED> |
@@ -300,6 +301,9 @@ at the specified path, rather than all projects with the given name. | |||
300 | Attribute `groups`: List of additional groups to which this project | 301 | Attribute `groups`: List of additional groups to which this project |
301 | belongs. Same syntax as the corresponding element of `project`. | 302 | belongs. Same syntax as the corresponding element of `project`. |
302 | 303 | ||
304 | Attribute `revision`: If specified, overrides the revision of the original | ||
305 | project. Same syntax as the corresponding element of `project`. | ||
306 | |||
303 | Element annotation | 307 | Element annotation |
304 | ------------------ | 308 | ------------------ |
305 | 309 | ||
diff --git a/manifest_xml.py b/manifest_xml.py index 0654222e..60d61168 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
@@ -571,12 +571,15 @@ class XmlManifest(object): | |||
571 | groups = node.getAttribute('groups') | 571 | groups = node.getAttribute('groups') |
572 | if groups: | 572 | if groups: |
573 | groups = self._ParseGroups(groups) | 573 | groups = self._ParseGroups(groups) |
574 | revision = node.getAttribute('revision') | ||
574 | 575 | ||
575 | for p in self._projects[name]: | 576 | for p in self._projects[name]: |
576 | if path and p.relpath != path: | 577 | if path and p.relpath != path: |
577 | continue | 578 | continue |
578 | if groups: | 579 | if groups: |
579 | p.groups.extend(groups) | 580 | p.groups.extend(groups) |
581 | if revision: | ||
582 | p.revisionExpr = revision | ||
580 | if node.nodeName == 'repo-hooks': | 583 | if node.nodeName == 'repo-hooks': |
581 | # Get the name of the project and the (space-separated) list of enabled. | 584 | # Get the name of the project and the (space-separated) list of enabled. |
582 | repo_hooks_project = self._reqatt(node, 'in-project') | 585 | repo_hooks_project = self._reqatt(node, 'in-project') |