##// END OF EJS Templates
py3: replace os.environ with encoding.environ (part 5 of 5)
Pulkit Goyal -
r30638:1c5cbf28 default
parent child Browse files
Show More
@@ -171,6 +171,7 b' from mercurial import ('
171 cmdutil,
171 cmdutil,
172 commands,
172 commands,
173 dispatch,
173 dispatch,
174 encoding,
174 extensions,
175 extensions,
175 subrepo,
176 subrepo,
176 ui as uimod,
177 ui as uimod,
@@ -245,7 +246,8 b' def _modesetup(ui, coloropt):'
245 if not always and not auto:
246 if not always and not auto:
246 return None
247 return None
247
248
248 formatted = always or (os.environ.get('TERM') != 'dumb' and ui.formatted())
249 formatted = (always or (encoding.environ.get('TERM') != 'dumb'
250 and ui.formatted()))
249
251
250 mode = ui.config('color', 'mode', 'auto')
252 mode = ui.config('color', 'mode', 'auto')
251
253
@@ -256,7 +258,7 b' def _modesetup(ui, coloropt):'
256 realmode = mode
258 realmode = mode
257 if mode == 'auto':
259 if mode == 'auto':
258 if os.name == 'nt':
260 if os.name == 'nt':
259 term = os.environ.get('TERM')
261 term = encoding.environ.get('TERM')
260 # TERM won't be defined in a vanilla cmd.exe environment.
262 # TERM won't be defined in a vanilla cmd.exe environment.
261
263
262 # UNIX-like environments on Windows such as Cygwin and MSYS will
264 # UNIX-like environments on Windows such as Cygwin and MSYS will
@@ -189,7 +189,7 b' class convert_cvs(converter_source):'
189
189
190 if conntype != "pserver":
190 if conntype != "pserver":
191 if conntype == "rsh":
191 if conntype == "rsh":
192 rsh = os.environ.get("CVS_RSH") or "ssh"
192 rsh = encoding.environ.get("CVS_RSH") or "ssh"
193 if user:
193 if user:
194 cmd = [rsh, '-l', user, host] + cmd
194 cmd = [rsh, '-l', user, host] + cmd
195 else:
195 else:
@@ -11,6 +11,7 b' import re'
11
11
12 from mercurial.i18n import _
12 from mercurial.i18n import _
13 from mercurial import (
13 from mercurial import (
14 encoding,
14 hook,
15 hook,
15 pycompat,
16 pycompat,
16 util,
17 util,
@@ -147,7 +148,7 b' def createlog(ui, directory=None, root="'
147 pass
148 pass
148
149
149 if not root:
150 if not root:
150 root = os.environ.get('CVSROOT', '')
151 root = encoding.environ.get('CVSROOT', '')
151
152
152 # read log cache if one exists
153 # read log cache if one exists
153 oldlog = []
154 oldlog = []
@@ -40,6 +40,8 b' import platform'
40 import subprocess
40 import subprocess
41 import sys
41 import sys
42
42
43 from mercurial import encoding
44
43 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
45 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
44 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
46 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
45 # be specifying the version(s) of Mercurial they are tested with, or
47 # be specifying the version(s) of Mercurial they are tested with, or
@@ -117,7 +119,7 b' def uisetup(ui):'
117 optpairs = (
119 optpairs = (
118 ('OPT_{0}'.format(key.upper()), str(value))
120 ('OPT_{0}'.format(key.upper()), str(value))
119 for key, value in opts.iteritems())
121 for key, value in opts.iteritems())
120 env = dict(itertools.chain(os.environ.items(),
122 env = dict(itertools.chain(encoding.environ.items(),
121 msgpairs, optpairs),
123 msgpairs, optpairs),
122 EVENT=event, HGPID=str(os.getpid()))
124 EVENT=event, HGPID=str(os.getpid()))
123 # Connect stdin to /dev/null to prevent child processes messing
125 # Connect stdin to /dev/null to prevent child processes messing
General Comments 0
You need to be logged in to leave comments. Login now