mercurial/utils/procutil.py
changeset 48913 f254fc73d956
parent 48910 3681b4c56618
child 48946 642e31cb55f0
equal deleted inserted replaced
48912:a0674e916fb6 48913:f254fc73d956
   340 
   340 
   341 
   341 
   342 def filter(s, cmd):
   342 def filter(s, cmd):
   343     """filter a string through a command that transforms its input to its
   343     """filter a string through a command that transforms its input to its
   344     output"""
   344     output"""
   345     for name, fn in pycompat.iteritems(_filtertable):
   345     for name, fn in _filtertable.items():
   346         if cmd.startswith(name):
   346         if cmd.startswith(name):
   347             return fn(s, cmd[len(name) :].lstrip())
   347             return fn(s, cmd[len(name) :].lstrip())
   348     return pipefilter(s, cmd)
   348     return pipefilter(s, cmd)
   349 
   349 
   350 
   350 
   446             return b'1'
   446             return b'1'
   447         return pycompat.bytestr(val)
   447         return pycompat.bytestr(val)
   448 
   448 
   449     env = dict(encoding.environ)
   449     env = dict(encoding.environ)
   450     if environ:
   450     if environ:
   451         env.update((k, py2shell(v)) for k, v in pycompat.iteritems(environ))
   451         env.update((k, py2shell(v)) for k, v in environ.items())
   452     env[b'HG'] = hgexecutable()
   452     env[b'HG'] = hgexecutable()
   453     return env
   453     return env
   454 
   454 
   455 
   455 
   456 if pycompat.iswindows:
   456 if pycompat.iswindows: