From 24c130884018364f91baa8de0ff3541f4c32d1bb Mon Sep 17 00:00:00 2001 From: "James W. Mills" Date: Thu, 12 Apr 2012 15:04:13 -0500 Subject: 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 --- project.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'project.py') diff --git a/project.py b/project.py index 49fef2f7..e297926d 100644 --- a/project.py +++ b/project.py @@ -213,6 +213,11 @@ class DiffColoring(Coloring): 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 @@ class Project(object): self.snapshots = {} self.copyfiles = [] + self.annotations = [] self.config = GitConfig.ForRepository( gitdir = self.gitdir, defaults = self.manifest.globalConfig) @@ -1175,6 +1181,9 @@ class Project(object): 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. """ -- cgit v1.2.3-54-g00ecf