# HG changeset patch # User Kyle Lippincott # Date 1638921235 28800 # Node ID eaad6829490409f30986d834dd8b980cd284cb8c # Parent c51408b92b887a0a15b225ba11bf4c3d176f5a62 status: when extracting arguments from `opts`, use the same default values Sometimes other code, such as commit when using `commands.commit.post-status`, calls `commands.status()` without going through the normal dispatch mechanism that would typically fill in the args to be something besides None. As a "defense in depth" mechanism for a bug where Mercurial would crash if both `commands.commit.post-status` and `experimental.directaccess` were enabled, let's sanitize these values to be identical to the values they would have when the user invoked this method from the commandline. Differential Revision: https://phab.mercurial-scm.org/D11884 diff -r c51408b92b88 -r eaad68294904 mercurial/commands.py --- a/mercurial/commands.py Tue Dec 07 15:48:22 2021 -0800 +++ b/mercurial/commands.py Tue Dec 07 15:53:55 2021 -0800 @@ -6873,9 +6873,9 @@ cmdutil.check_at_most_one_arg(opts, 'rev', 'change') opts = pycompat.byteskwargs(opts) - revs = opts.get(b'rev') - change = opts.get(b'change') - terse = opts.get(b'terse') + revs = opts.get(b'rev', []) + change = opts.get(b'change', b'') + terse = opts.get(b'terse', _NOTTERSE) if terse is _NOTTERSE: if revs: terse = b''