Mercurial > hg
diff tests/test-cat.t @ 30833:bd5e9647f646
templater: add '{envvars}' to access environment variables
Since the option for ui.exportableenviron is experimental, so is this template
until the underlying API is sorted out.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 17 Jan 2017 23:12:54 -0500 |
parents | c560d8c68791 |
children | 746e12a767b3 |
line wrap: on
line diff
--- a/tests/test-cat.t Tue Jan 17 23:05:12 2017 -0500 +++ b/tests/test-cat.t Tue Jan 17 23:12:54 2017 -0500 @@ -68,3 +68,14 @@ $ echo b-wdir > b $ hg cat -r 'wdir()' b b-wdir + +Environment variables are not visible by default + + $ PATTERN='t4' hg log -r '.' -T "{ifcontains('PATTERN', envvars, 'yes', 'no')}\n" + no + +Environment variable visibility can be explicit + + $ PATTERN='t4' hg log -r '.' -T "{envvars % '{key} -> {value}\n'}" \ + > --config "experimental.exportableenviron=PATTERN" + PATTERN -> t4