IndexError: tuple index out of range when calling thg NONEXISTENT_COMMAND
When invoking thg with an invalid command, such as:
$ thg NONEXISTENT_COMMAND
A crash happens.
Versions:
- Tortoisehg 2eabd3bef7a2 (latest default as of today)
- Mercurial 5.6.1+6-b308d750de82
- Linux
This is the stack trace of the crash:
#!python
** Mercurial version (5.6.1+6-b308d750de82+20210105). TortoiseHg version (5.6.1+11-2eabd3bef7a2)
** Command: NONEXISTENT_COMMAND
** CWD: /somedir
** Encoding: UTF-8
** Extensions loaded:
** Python version: 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
** System: Linux 5.4.0-52-generic #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020 x86_64
** Qt-5.12.8 PyQt-5.14.1 QScintilla-2.11.2
Traceback (most recent call last):
File "/opt/mercurial/thg/tortoisehg/hgqt/run.py", line 342, in _runcatch
return runcommand(ui, args)
File "/opt/mercurial/thg/tortoisehg/hgqt/run.py", line 368, in runcommand
cmd, func, args, options, cmdoptions, alias = _parse(ui, args)
File "/opt/mercurial/thg/tortoisehg/hgqt/run.py", line 301, in _parse
aliases, i = cmdutil.findcmd(alias, table, ui.config(b"ui", b"strict"))
File "/usr/lib/python3/dist-packages/mercurial/cmdutil.py", line 960, in findcmd
raise error.UnknownCommand(cmd, allcmds)
mercurial.error.UnknownCommand
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/mercurial/thg/tortoisehg/hgqt/run.py", line 138, in dispatch
return _runcatch(u, args)
File "/opt/mercurial/thg/tortoisehg/hgqt/run.py", line 356, in _runcatch
ui.warn(_("thg: unknown command '%s'\n") % inst.args[0])
IndexError: tuple index out of range