--- a/mercurial/utils/procutil.py Sat Sep 15 10:35:00 2018 +0900
+++ b/mercurial/utils/procutil.py Sat Sep 15 13:31:41 2018 -0400
@@ -320,10 +320,19 @@
if pycompat.iswindows:
def shelltonative(cmd, env):
return platform.shelltocmdexe(cmd, shellenviron(env))
+
+ tonativestr = encoding.strfromlocal
else:
def shelltonative(cmd, env):
return cmd
+ tonativestr = pycompat.identity
+
+def tonativeenv(env):
+ '''convert the environment from bytes to strings suitable for Popen(), etc.
+ '''
+ return pycompat.rapply(tonativestr, env)
+
def system(cmd, environ=None, cwd=None, out=None):
'''enhanced shell command execution.
run with environment maybe modified, maybe in different dir.