Mercurial > hg-stable
changeset 2288:dfa17bd1d45e
remove non-prefixed environment variables from hooks.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Mon, 15 May 2006 09:13:00 -0700 |
parents | 3f18d1eea370 |
children | 1cad19678b4c |
files | doc/hgrc.5.txt mercurial/localrepo.py |
diffstat | 2 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/hgrc.5.txt Mon May 15 08:53:32 2006 -0700 +++ b/doc/hgrc.5.txt Mon May 15 09:13:00 2006 -0700 @@ -234,10 +234,9 @@ is in $HG_PARENT2. If update succeeded, $HG_ERROR=0. If update failed (e.g. because conflicts not resolved), $HG_ERROR=1. - In earlier releases, the names of hook environment variables did not - have a "HG_" prefix. These unprefixed names are still provided in - the environment for backwards compatibility, but their use is - deprecated, and they will be removed in a future release. + Note: In earlier releases, the names of hook environment variables + did not have a "HG_" prefix. The old unprefixed names are no longer + provided in the environment. The syntax for Python hooks is as follows:
--- a/mercurial/localrepo.py Mon May 15 08:53:32 2006 -0700 +++ b/mercurial/localrepo.py Mon May 15 09:13:00 2006 -0700 @@ -136,8 +136,7 @@ def runhook(name, cmd): self.ui.note(_("running hook %s: %s\n") % (name, cmd)) - env = dict([('HG_' + k.upper(), v) for k, v in args.iteritems()] + - [(k.upper(), v) for k, v in args.iteritems()]) + env = dict([('HG_' + k.upper(), v) for k, v in args.iteritems()]) r = util.system(cmd, environ=env, cwd=self.root) if r: desc, r = util.explain_exit(r)