mercurial/utils/procutil.py
changeset 39662 50f46b771921
parent 38526 313a940d49a3
child 39826 c31ce080eb75
equal deleted inserted replaced
39661:8bfbb25859f1 39662:50f46b771921
   318     return env
   318     return env
   319 
   319 
   320 if pycompat.iswindows:
   320 if pycompat.iswindows:
   321     def shelltonative(cmd, env):
   321     def shelltonative(cmd, env):
   322         return platform.shelltocmdexe(cmd, shellenviron(env))
   322         return platform.shelltocmdexe(cmd, shellenviron(env))
       
   323 
       
   324     tonativestr = encoding.strfromlocal
   323 else:
   325 else:
   324     def shelltonative(cmd, env):
   326     def shelltonative(cmd, env):
   325         return cmd
   327         return cmd
       
   328 
       
   329     tonativestr = pycompat.identity
       
   330 
       
   331 def tonativeenv(env):
       
   332     '''convert the environment from bytes to strings suitable for Popen(), etc.
       
   333     '''
       
   334     return pycompat.rapply(tonativestr, env)
   326 
   335 
   327 def system(cmd, environ=None, cwd=None, out=None):
   336 def system(cmd, environ=None, cwd=None, out=None):
   328     '''enhanced shell command execution.
   337     '''enhanced shell command execution.
   329     run with environment maybe modified, maybe in different dir.
   338     run with environment maybe modified, maybe in different dir.
   330 
   339