##// 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 171 cmdutil,
172 172 commands,
173 173 dispatch,
174 encoding,
174 175 extensions,
175 176 subrepo,
176 177 ui as uimod,
@@ -245,7 +246,8 b' def _modesetup(ui, coloropt):'
245 246 if not always and not auto:
246 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 252 mode = ui.config('color', 'mode', 'auto')
251 253
@@ -256,7 +258,7 b' def _modesetup(ui, coloropt):'
256 258 realmode = mode
257 259 if mode == 'auto':
258 260 if os.name == 'nt':
259 term = os.environ.get('TERM')
261 term = encoding.environ.get('TERM')
260 262 # TERM won't be defined in a vanilla cmd.exe environment.
261 263
262 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 190 if conntype != "pserver":
191 191 if conntype == "rsh":
192 rsh = os.environ.get("CVS_RSH") or "ssh"
192 rsh = encoding.environ.get("CVS_RSH") or "ssh"
193 193 if user:
194 194 cmd = [rsh, '-l', user, host] + cmd
195 195 else:
@@ -11,6 +11,7 b' import re'
11 11
12 12 from mercurial.i18n import _
13 13 from mercurial import (
14 encoding,
14 15 hook,
15 16 pycompat,
16 17 util,
@@ -147,7 +148,7 b' def createlog(ui, directory=None, root="'
147 148 pass
148 149
149 150 if not root:
150 root = os.environ.get('CVSROOT', '')
151 root = encoding.environ.get('CVSROOT', '')
151 152
152 153 # read log cache if one exists
153 154 oldlog = []
@@ -40,6 +40,8 b' import platform'
40 40 import subprocess
41 41 import sys
42 42
43 from mercurial import encoding
44
43 45 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
44 46 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
45 47 # be specifying the version(s) of Mercurial they are tested with, or
@@ -117,7 +119,7 b' def uisetup(ui):'
117 119 optpairs = (
118 120 ('OPT_{0}'.format(key.upper()), str(value))
119 121 for key, value in opts.iteritems())
120 env = dict(itertools.chain(os.environ.items(),
122 env = dict(itertools.chain(encoding.environ.items(),
121 123 msgpairs, optpairs),
122 124 EVENT=event, HGPID=str(os.getpid()))
123 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