Mercurial > hg
changeset 44098:19533e4c3450
py3: fix curses chunkselector fallback (when diffs are too large) on py3
Previously we showed the message using Exception.message, which is removed in
py3. Since crecordmod.fallbackerror inherits from error.Abort, we can just use
`b'%s' % exception` to print the message. This does not print the hint, but
that's fine - we don't set one. We inherit from error.Abort so that if a
codepath doesn't handle fallback specially, it exits to the terminal with a sane
message instead of an unknown exception error.
Differential Revision: https://phab.mercurial-scm.org/D7912
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Thu, 16 Jan 2020 12:17:03 -0800 |
parents | 2f1d6180737f |
children | b4420cea45e8 |
files | mercurial/cmdutil.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Wed Jan 15 15:47:03 2020 +0100 +++ b/mercurial/cmdutil.py Thu Jan 16 12:17:03 2020 -0800 @@ -386,7 +386,7 @@ ui, originalhunks, recordfn, operation ) except crecordmod.fallbackerror as e: - ui.warn(b'%s\n' % e.message) # pytype: disable=attribute-error + ui.warn(b'%s\n' % e) ui.warn(_(b'falling back to text mode\n')) return patch.filterpatch(ui, originalhunks, match, operation)