equal
deleted
inserted
replaced
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: |