logtoprocess: define $HG for children processes
authorValentin Gatien-Baron <vgatien-baron@janestreet.com>
Wed, 26 Sep 2018 18:30:19 -0400
changeset 39885 566cc633e637
parent 39884 9c8eff5cfa1b
child 39886 debc4ee597e7
logtoprocess: define $HG for children processes So they can compute the hg version for instance. Differential Revision: https://phab.mercurial-scm.org/D4768
hgext/logtoprocess.py
--- a/hgext/logtoprocess.py	Wed Sep 26 22:21:25 2018 -0400
+++ b/hgext/logtoprocess.py	Wed Sep 26 18:30:19 2018 -0400
@@ -40,7 +40,6 @@
 import sys
 
 from mercurial import (
-    encoding,
     pycompat,
 )
 
@@ -128,7 +127,7 @@
                 optpairs = (
                     ('OPT_{0}'.format(key.upper()), str(value))
                     for key, value in opts.iteritems())
-                env = dict(itertools.chain(encoding.environ.items(),
+                env = dict(itertools.chain(procutil.shellenviron().items(),
                                            msgpairs, optpairs),
                            EVENT=event, HGPID=str(os.getpid()))
                 runshellcommand(script, env)