From 7d52585ec4719ce0314c6d1a20216fc0128d6883 Mon Sep 17 00:00:00 2001 From: Luis Hector Chavez Date: Thu, 15 Mar 2018 09:54:08 -0700 Subject: Add a way to override the revision of an This change adds support for the 'revision' attribute in . This avoids the need to perform a followed by a in local manifests. Change-Id: Id2834fcfc1ae0d74b3347bed3618f250bf696b1f --- docs/manifest-format.txt | 4 ++++ manifest_xml.py | 3 +++ 2 files changed, 7 insertions(+) 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: + @@ -300,6 +301,9 @@ at the specified path, rather than all projects with the given name. Attribute `groups`: List of additional groups to which this project belongs. Same syntax as the corresponding element of `project`. +Attribute `revision`: If specified, overrides the revision of the original +project. Same syntax as the corresponding element of `project`. + Element annotation ------------------ 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): groups = node.getAttribute('groups') if groups: groups = self._ParseGroups(groups) + revision = node.getAttribute('revision') for p in self._projects[name]: if path and p.relpath != path: continue if groups: p.groups.extend(groups) + if revision: + p.revisionExpr = revision if node.nodeName == 'repo-hooks': # Get the name of the project and the (space-separated) list of enabled. repo_hooks_project = self._reqatt(node, 'in-project') -- cgit v1.2.3-54-g00ecf