# HG changeset patch # User Jean-Francois Pieronne # Date 1691022748 -7200 # Node ID def6f1a4604b3ec25daaf180425b6c5741e40b08 # Parent 82bc0b26db501bfabc85a5def200458f6d6c9ee3 openvms: make process spawning works on OpenVMS We need to adjust some behavior for OpenVMS. diff -r 82bc0b26db50 -r def6f1a4604b mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py Thu Aug 03 02:34:17 2023 +0200 +++ b/mercurial/utils/procutil.py Thu Aug 03 02:32:28 2023 +0200 @@ -181,7 +181,7 @@ # Work around Windows bugs. stdout = platform.winstdout(stdout) # pytype: disable=module-attr stderr = platform.winstdout(stderr) # pytype: disable=module-attr -if isatty(stdout): +if isatty(stdout) and pycompat.sysplatform != b'OpenVMS': # The standard library doesn't offer line-buffered binary streams. stdout = make_line_buffered(stdout) @@ -208,7 +208,7 @@ except AttributeError: pass -closefds = pycompat.isposix +closefds = pycompat.isposix and pycompat.sysplatform != b'OpenVMS' def explainexit(code): @@ -338,8 +338,6 @@ cmd = cmd.replace(b'INFILE', inname) cmd = cmd.replace(b'OUTFILE', outname) code = system(cmd) - if pycompat.sysplatform == b'OpenVMS' and code & 1: - code = 0 if code: raise error.Abort( _(b"command '%s' failed: %s") % (cmd, explainexit(code)) @@ -383,8 +381,10 @@ Defaults to $HG or 'hg' in the search path. """ if _hgexecutable is None: - hg = encoding.environ.get(b'HG') + hg = encoding.environ.get(b'HG', '') mainmod = sys.modules['__main__'] + if pycompat.sysplatform == b'OpenVMS' and hg[0:1] == '$': + hg = 'mcr ' + hg[1:] if hg: _sethgexecutable(hg) elif resourceutil.mainfrozen(): @@ -533,8 +533,6 @@ out.write(line) proc.wait() rc = proc.returncode - if pycompat.sysplatform == b'OpenVMS' and rc & 1: - rc = 0 return rc