Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commandserver.py @ 46102:49b6910217f9
dispatch: move IOError handling and flushing of streams to `dispatch()`
Instead of patching both dispatch code and commandserver code, we directly
handle this in `dispatch.dispatch()`.
Thanks to Yuya who recommended this.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Thu, 10 Dec 2020 13:51:56 +0530 |
parents | ac9de799d390 |
children | d4ba4d51f85f |
line wrap: on
line diff
--- a/mercurial/commandserver.py Wed Dec 09 00:00:19 2020 -0800 +++ b/mercurial/commandserver.py Thu Dec 10 13:51:56 2020 +0530 @@ -355,18 +355,7 @@ ) try: - err = None - try: - status = self._dispatchcommand(req) - except error.StdioError as e: - status = -1 - err = e - - retval = dispatch.closestdio(req.ui, err) - if retval: - status = retval - - ret = status & 255 + ret = self._dispatchcommand(req) & 255 # If shutdown-on-interrupt is off, it's important to write the # result code *after* SIGINT handler removed. If the result code # were lost, the client wouldn't be able to continue processing.