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 --- subcmds/forall.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'subcmds/forall.py') diff --git a/subcmds/forall.py b/subcmds/forall.py index d3e70ae1..9436f4e5 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py @@ -82,6 +82,11 @@ revision to a locally executed git command, use REPO_LREV. REPO_RREV is the name of the revision from the manifest, exactly as written in the manifest. +REPO__* are any extra environment variables, specified by the +"annotation" element under any project element. This can be useful +for differentiating trees based on user-specific criteria, or simply +annotating tree details. + shell positional arguments ($1, $2, .., $#) are set to any arguments following . @@ -162,6 +167,8 @@ terminal and are not redirected. setenv('REPO_REMOTE', project.remote.name) setenv('REPO_LREV', project.GetRevisionId()) setenv('REPO_RREV', project.revisionExpr) + for a in project.annotations: + setenv("REPO__%s" % (a.name), a.value) if mirror: setenv('GIT_DIR', project.gitdir) -- cgit v1.2.3-54-g00ecf