# HG changeset patch # User Vadim Gelfer # Date 1147709580 25200 # Node ID dfa17bd1d45ed4f46c50a4fdfd3dd29721bdb22f # Parent 3f18d1eea37002aaee67993c9a428e8209b0b3e3 remove non-prefixed environment variables from hooks. diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt @@ -234,10 +234,9 @@ hooks:: 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: diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -136,8 +136,7 @@ class localrepository(object): 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)