equal
deleted
inserted
replaced
38 import os |
38 import os |
39 import subprocess |
39 import subprocess |
40 import sys |
40 import sys |
41 |
41 |
42 from mercurial import ( |
42 from mercurial import ( |
43 encoding, |
|
44 pycompat, |
43 pycompat, |
45 ) |
44 ) |
46 |
45 |
47 from mercurial.utils import ( |
46 from mercurial.utils import ( |
48 procutil, |
47 procutil, |
126 for i, m in enumerate(messages, 1)) |
125 for i, m in enumerate(messages, 1)) |
127 # keyword arguments get prefixed with OPT_ and uppercased |
126 # keyword arguments get prefixed with OPT_ and uppercased |
128 optpairs = ( |
127 optpairs = ( |
129 ('OPT_{0}'.format(key.upper()), str(value)) |
128 ('OPT_{0}'.format(key.upper()), str(value)) |
130 for key, value in opts.iteritems()) |
129 for key, value in opts.iteritems()) |
131 env = dict(itertools.chain(encoding.environ.items(), |
130 env = dict(itertools.chain(procutil.shellenviron().items(), |
132 msgpairs, optpairs), |
131 msgpairs, optpairs), |
133 EVENT=event, HGPID=str(os.getpid())) |
132 EVENT=event, HGPID=str(os.getpid())) |
134 runshellcommand(script, env) |
133 runshellcommand(script, env) |
135 return super(logtoprocessui, self).log(event, *msg, **opts) |
134 return super(logtoprocessui, self).log(event, *msg, **opts) |
136 |
135 |