Add project annotation handling to repo
Allow the optional addition of "annotation" nodes nested under
projects. Each annotation node must have "name" and "value"
attributes. These name/value pairs will be exported into the
environment during any forall command, prefixed with "REPO__"
In addition, an optional "keep" attribute with case insensitive "true"
or "false" values can be included to determine whether the annotation
will be exported with 'repo manifest'
Change-Id: Icd7540afaae02c958f769ce3d25661aa721a9de8
Signed-off-by: James W. Mills <jameswmills@gmail.com>
diff --git a/project.py b/project.py
index 49fef2f..e297926 100644
--- a/project.py
+++ b/project.py
@@ -213,6 +213,11 @@
Coloring.__init__(self, config, 'diff')
self.project = self.printer('header', attr = 'bold')
+class _Annotation:
+ def __init__(self, name, value, keep):
+ self.name = name
+ self.value = value
+ self.keep = keep
class _CopyFile:
def __init__(self, src, dest, abssrc, absdest):
@@ -529,6 +534,7 @@
self.snapshots = {}
self.copyfiles = []
+ self.annotations = []
self.config = GitConfig.ForRepository(
gitdir = self.gitdir,
defaults = self.manifest.globalConfig)
@@ -1175,6 +1181,9 @@
abssrc = os.path.join(self.worktree, src)
self.copyfiles.append(_CopyFile(src, dest, abssrc, absdest))
+ def AddAnnotation(self, name, value, keep):
+ self.annotations.append(_Annotation(name, value, keep))
+
def DownloadPatchSet(self, change_id, patch_id):
"""Download a single patch set of a single change to FETCH_HEAD.
"""