Show More
@@ -34,9 +34,11 b' not ensure that they exit cleanly.' | |||
|
34 | 34 | |
|
35 | 35 | from __future__ import absolute_import |
|
36 | 36 | |
|
37 | import itertools | |
|
38 | 37 | import os |
|
39 | 38 | |
|
39 | from mercurial import ( | |
|
40 | pycompat, | |
|
41 | ) | |
|
40 | 42 | from mercurial.utils import ( |
|
41 | 43 | procutil, |
|
42 | 44 | ) |
@@ -70,17 +72,16 b' def uisetup(ui):' | |||
|
70 | 72 | messages = (formatted,) + msg[1:] |
|
71 | 73 | else: |
|
72 | 74 | messages = msg |
|
75 | env = { | |
|
76 | b'EVENT': event, | |
|
77 | b'HGPID': os.getpid(), | |
|
78 | } | |
|
73 | 79 | # positional arguments are listed as MSG[N] keys in the |
|
74 | 80 | # environment |
|
75 | msgpairs = ( | |
|
76 | ('MSG{0:d}'.format(i), m) | |
|
77 | for i, m in enumerate(messages, 1)) | |
|
81 | env.update((b'MSG%d' % i, m) for i, m in enumerate(messages, 1)) | |
|
78 | 82 | # keyword arguments get prefixed with OPT_ and uppercased |
|
79 | optpairs = ( | |
|
80 | ('OPT_{0}'.format(key.upper()), value) | |
|
81 | for key, value in opts.iteritems()) | |
|
82 | env = dict(itertools.chain(msgpairs, optpairs), | |
|
83 | EVENT=event, HGPID=os.getpid()) | |
|
83 | env.update((b'OPT_%s' % key.upper(), value) | |
|
84 | for key, value in pycompat.byteskwargs(opts).items()) | |
|
84 | 85 | fullenv = procutil.shellenviron(env) |
|
85 | 86 | procutil.runbgcommand(script, fullenv, shell=True) |
|
86 | 87 | return super(logtoprocessui, self).log(event, *msg, **opts) |
General Comments 0
You need to be logged in to leave comments.
Login now