Thu, 22 Oct 2020 13:38:14 -0700 errors: set detailed exit code to 20 for locking errors
Martin von Zweigbergk <martinvonz@google.com> [Thu, 22 Oct 2020 13:38:14 -0700] rev 45828
errors: set detailed exit code to 20 for locking errors This is per https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. Differential Revision: https://phab.mercurial-scm.org/D9242
Tue, 06 Oct 2020 22:36:15 -0700 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com> [Tue, 06 Oct 2020 22:36:15 -0700] rev 45827
errors: introduce InputError and use it from commands and cmdutil This patch introduces a `InputError` class and replaces many uses of `error.Abort` by it in `commands` and `cmdutil`. This is a part of https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. There will later be a different class for state errors (to raise e.g. when there's an unfinished operation). It's not always clear when one should report an input error and when it should be a state error. We can always adjust later if I got something wrong in this patch (but feel free to point out any you notice now). Differential Revision: https://phab.mercurial-scm.org/D9167
Wed, 21 Oct 2020 19:00:16 -0700 errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com> [Wed, 21 Oct 2020 19:00:16 -0700] rev 45826
errors: add config that lets user get more detailed exit codes This adds an experimental config that lets the user get more detailed exit codes. For example, there will be a specific error code for input/user errors. This is part of https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. I've made the config part of tweakdefaults. I've made the config enabled by default in tests. My reasoning is that we want to see that each specific error case gives the right exit code and we don't want to duplicate all error cases in the entire test suite. It also makes it easy to grep the `.t` files for `[255]` to find which cases we have left to fix. The logic for the current exit codes is quite simple, so I'm not too worried about regressions there. I've added a test case specifically for the "legacy" exit codes. I've set the detailed exit status only for the case of `InterventionRequired` and `SystemExit` for now (the cases where we currently return something other than 255), just to show that it works. Differential Revision: https://phab.mercurial-scm.org/D9238
Sat, 07 Nov 2020 21:50:28 -0800 worker: raise exception instead of calling sys.exit() with child's code
Martin von Zweigbergk <martinvonz@google.com> [Sat, 07 Nov 2020 21:50:28 -0800] rev 45825
worker: raise exception instead of calling sys.exit() with child's code When a worker process returns an error code, we would call `sys.exit()` with that exit code on the main process. The `SystemExit` exception would then get caught in `scmutil.callcatch()`, which would return that error code. The comment there says "Commands shouldn't sys.exit directly", which I agree with. This patch changes it so we raise a specific exception when a worker fails so we can catch instead. I think that means that `SystemExit` is now always an internal error. (I had earlier thought that this call to `sys.exit()` was from within the child process until Matt Harbison made me look again, so thanks for that!) Differential Revision: https://phab.mercurial-scm.org/D9287
Tue, 03 Nov 2020 09:56:02 -0800 config: read system hgrc in lexicographical order
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Nov 2020 09:56:02 -0800] rev 45824
config: read system hgrc in lexicographical order This is similar to edbcf5b239f9 (config: read configs from directories in lexicographical order, 2019-04-03). Apparently I forgot to sort the system hgrc files there. That's fixed by this patch. Differential Revision: https://phab.mercurial-scm.org/D9269
Sun, 08 Nov 2020 20:12:32 +0100 relnotes: drop 5.6 release entries from next
Joerg Sonnenberger <joerg@bec.de> [Sun, 08 Nov 2020 20:12:32 +0100] rev 45823
relnotes: drop 5.6 release entries from next Differential Revision: https://phab.mercurial-scm.org/D9282
Sat, 07 Nov 2020 15:02:53 -0500 merge with stable
Augie Fackler <augie@google.com> [Sat, 07 Nov 2020 15:02:53 -0500] rev 45822
merge with stable
Mon, 05 Oct 2020 19:46:31 -0700 makefile: use Python 3 by default (BC)
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 05 Oct 2020 19:46:31 -0700] rev 45821
makefile: use Python 3 by default (BC) This change is long overdue IMO. .. bc:: Makefile now uses `python3` instead of `python` by default on non-Windows platforms. This means Mercurial will be built and run with Python 3 instead of Python 2.7 by default. To continue using Python 2, set the PYTHON variable. e.g. `make install PYTHON=python2.7`. Differential Revision: https://phab.mercurial-scm.org/D7258
Tue, 03 Nov 2020 20:28:23 -0800 hgweb: don't call sys.exit() in httpservice.run()
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Nov 2020 20:28:23 -0800] rev 45820
hgweb: don't call sys.exit() in httpservice.run() If I'm reading the code correctly, `mercurial.server.createservice()` can return an hgweb service or one of three types of command server services. The caller then calls `mercurial.server.runservice()`, passing it the returned service's run method. Only the hgweb service was calling `sys.exit()`. It has been that way since 8d44649df03b (refactor ssh server., 2006-06-04). That commit message doesn't provide any explanation. Let's clean up and have the code follow the usual return path into the `dispatch` module. After this patch, there should be no remaining places left where we call `sys.exit()` except for valid uses in the `dispatch` and `worker` modules. Differential Revision: https://phab.mercurial-scm.org/D9272
Tue, 03 Nov 2020 20:20:49 -0800 serve: simply return instead of calling sys.exit() in `hg serve --stdio`
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Nov 2020 20:20:49 -0800] rev 45819
serve: simply return instead of calling sys.exit() in `hg serve --stdio` The shouldn't be a reason to call `sys.exit()` instead of letting the code return normally. I've remove the call in both `hg serve` and `hg debugserve`. Differential Revision: https://phab.mercurial-scm.org/D9271
(0) -30000 -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 tip