summaryrefslogtreecommitdiffstats
path: root/subcmds/forall.py
diff options
context:
space:
mode:
authorJames W. Mills <jameswmills@gmail.com>2012-04-12 15:04:13 -0500
committerShawn O. Pearce <sop@google.com>2012-04-23 12:35:08 -0700
commit24c130884018364f91baa8de0ff3541f4c32d1bb (patch)
tree213b269d05e2a5f2b70d895325301a9a9f30e4a2 /subcmds/forall.py
parentb962a1f5e0daad323bdd66fad93f00a3738cc255 (diff)
downloadgit-repo-24c130884018364f91baa8de0ff3541f4c32d1bb.tar.gz
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>
Diffstat (limited to 'subcmds/forall.py')
-rw-r--r--subcmds/forall.py7
1 files changed, 7 insertions, 0 deletions
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.
82REPO_RREV is the name of the revision from the manifest, exactly 82REPO_RREV is the name of the revision from the manifest, exactly
83as written in the manifest. 83as written in the manifest.
84 84
85REPO__* are any extra environment variables, specified by the
86"annotation" element under any project element. This can be useful
87for differentiating trees based on user-specific criteria, or simply
88annotating tree details.
89
85shell positional arguments ($1, $2, .., $#) are set to any arguments 90shell positional arguments ($1, $2, .., $#) are set to any arguments
86following <command>. 91following <command>.
87 92
@@ -162,6 +167,8 @@ terminal and are not redirected.
162 setenv('REPO_REMOTE', project.remote.name) 167 setenv('REPO_REMOTE', project.remote.name)
163 setenv('REPO_LREV', project.GetRevisionId()) 168 setenv('REPO_LREV', project.GetRevisionId())
164 setenv('REPO_RREV', project.revisionExpr) 169 setenv('REPO_RREV', project.revisionExpr)
170 for a in project.annotations:
171 setenv("REPO__%s" % (a.name), a.value)
165 172
166 if mirror: 173 if mirror:
167 setenv('GIT_DIR', project.gitdir) 174 setenv('GIT_DIR', project.gitdir)