# HG changeset patch # User Augie Fackler # Date 1611348186 18000 # Node ID 11ce2977572f058fdf3ea12cb69d480b24a24efc # Parent a936e570288daffd18bd1d518ce0bf885891c823 histedit: rip out mysterious catch-all ignore curses.error handler I have no idea why this was here, and ripping it out doesn't obviously break anything for me (tests all pass, I can poke around chistedit UI a bit without issue), so I'm thinking we should rip it out and see if we get bug reports. Differential Revision: https://phab.mercurial-scm.org/D9855 diff -r a936e570288d -r 11ce2977572f hgext/histedit.py --- a/hgext/histedit.py Fri Jan 22 15:32:00 2021 -0500 +++ b/hgext/histedit.py Fri Jan 22 15:43:06 2021 -0500 @@ -1623,63 +1623,60 @@ stdscr.clear() stdscr.refresh() while True: - try: - oldmode, unused = state[b'mode'] - if oldmode == MODE_INIT: - changemode(state, MODE_RULES) - e = event(state, ch) - - if e == E_QUIT: - return False - if e == E_HISTEDIT: - return state[b'rules'] + oldmode, unused = state[b'mode'] + if oldmode == MODE_INIT: + changemode(state, MODE_RULES) + e = event(state, ch) + + if e == E_QUIT: + return False + if e == E_HISTEDIT: + return state[b'rules'] + else: + if e == E_RESIZE: + size = screen_size() + if size != stdscr.getmaxyx(): + curses.resizeterm(*size) + + curmode, unused = state[b'mode'] + sizes = layout(curmode) + if curmode != oldmode: + state[b'page_height'] = sizes[b'main'][0] + # Adjust the view to fit the current screen size. + movecursor(state, state[b'pos'], state[b'pos']) + + # Pack the windows against the top, each pane spread across the + # full width of the screen. + y, x = (0, 0) + helpwin, y, x = drawvertwin(sizes[b'help'], y, x) + mainwin, y, x = drawvertwin(sizes[b'main'], y, x) + commitwin, y, x = drawvertwin(sizes[b'commit'], y, x) + + if e in (E_PAGEDOWN, E_PAGEUP, E_LINEDOWN, E_LINEUP): + if e == E_PAGEDOWN: + changeview(state, +1, b'page') + elif e == E_PAGEUP: + changeview(state, -1, b'page') + elif e == E_LINEDOWN: + changeview(state, +1, b'line') + elif e == E_LINEUP: + changeview(state, -1, b'line') + + # start rendering + commitwin.erase() + helpwin.erase() + mainwin.erase() + if curmode == MODE_PATCH: + renderpatch(mainwin, state) + elif curmode == MODE_HELP: + renderstring(mainwin, state, __doc__.strip().splitlines()) else: - if e == E_RESIZE: - size = screen_size() - if size != stdscr.getmaxyx(): - curses.resizeterm(*size) - - curmode, unused = state[b'mode'] - sizes = layout(curmode) - if curmode != oldmode: - state[b'page_height'] = sizes[b'main'][0] - # Adjust the view to fit the current screen size. - movecursor(state, state[b'pos'], state[b'pos']) - - # Pack the windows against the top, each pane spread across the - # full width of the screen. - y, x = (0, 0) - helpwin, y, x = drawvertwin(sizes[b'help'], y, x) - mainwin, y, x = drawvertwin(sizes[b'main'], y, x) - commitwin, y, x = drawvertwin(sizes[b'commit'], y, x) - - if e in (E_PAGEDOWN, E_PAGEUP, E_LINEDOWN, E_LINEUP): - if e == E_PAGEDOWN: - changeview(state, +1, b'page') - elif e == E_PAGEUP: - changeview(state, -1, b'page') - elif e == E_LINEDOWN: - changeview(state, +1, b'line') - elif e == E_LINEUP: - changeview(state, -1, b'line') - - # start rendering - commitwin.erase() - helpwin.erase() - mainwin.erase() - if curmode == MODE_PATCH: - renderpatch(mainwin, state) - elif curmode == MODE_HELP: - renderstring(mainwin, state, __doc__.strip().splitlines()) - else: - renderrules(mainwin, state) - rendercommit(commitwin, state) - renderhelp(helpwin, state) - curses.doupdate() - # done rendering - ch = encoding.strtolocal(stdscr.getkey()) - except curses.error: - pass + renderrules(mainwin, state) + rendercommit(commitwin, state) + renderhelp(helpwin, state) + curses.doupdate() + # done rendering + ch = encoding.strtolocal(stdscr.getkey()) def _chistedit(ui, repo, freeargs, opts):