##// END OF EJS Templates
dispatch: handle IOError when writing to stderr...
dispatch: handle IOError when writing to stderr Previously, attempts to write to stderr in dispatch.run() may lead to an exception being thrown. This would likely be handled by Python's default exception handler, which would print the exception and exit 1. Code in this function is already catching IOError for stdout failures and converting to exit code 255 (-1 & 255 == 255). Why we weren't doing the same for stderr for the sake of consistency, I don't know. I do know that chg and hg diverged in behavior here (as the changed test-basic.t shows). After this commit, we catch I/O failure on stderr and change the exit code to 255. chg and hg now behave consistently. As a bonus, Rust hg also now passes this test. I'm skeptical at changing the exit code due to failures this late in the process. I think we should consider preserving the current exit code - assuming it is non-0. And, we may want to preserve the exit code completely if the I/O error is EPIPE (and potentially other special error classes). There's definitely room to tweak behavior. But for now, let's at least prevent the uncaught exception. Differential Revision: https://phab.mercurial-scm.org/D1860
Gregory Szorc -
r35671:48fe4f56 default
Show More
Name Size Modified Last Commit Author
contrib
doc
hgdemandimport
hgext
hgext3rd
i18n
mercurial
rust
tests
.arcconfig Loading ...
.clang-format Loading ...
.editorconfig Loading ...
.hgignore Loading ...
.hgsigs Loading ...
.hgtags Loading ...
.jshintrc Loading ...
CONTRIBUTING Loading ...
CONTRIBUTORS Loading ...
COPYING Loading ...
Makefile Loading ...
README.rst Loading ...
hg Loading ...
hgeditor Loading ...
hgweb.cgi Loading ...
setup.py Loading ...

Mercurial

Mercurial is a fast, easy to use, distributed revision control tool for software developers.

Basic install:

$ make            # see install targets
$ make install    # do a system-wide install
$ hg debuginstall # sanity-check setup
$ hg              # see help

Running without installing:

$ make local      # build for inplace usage
$ ./hg --version  # should show the latest version

See https://mercurial-scm.org/ for detailed installation instructions, platform-specific notes, and Mercurial user information.