Bug 6427 - crecord on Windows does not display chunks
Summary: crecord on Windows does not display chunks
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 5.4.1
Hardware: PC Windows
: wish bug
Assignee: Barret Rennie
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-31 17:31 UTC by Barret Rennie
Modified: 2021-12-02 06:09 UTC (History)
1 user (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Barret Rennie 2020-10-31 17:31 UTC
Steps to Reproduce:

1. Install Mercurial
2. Install curses-windows (or any curses wrapper of PDCurses)
3. Run `hg --config ui.interface=curses commit -i` in a repository with changes

Expected Results:
There should be visible chunks to commit

Actual Results:
The only thing rendered is the top bar ("Select hunks to record...")


I've traced this down to an error in `curseschunkselector.updatescreen`, specifically:

        try:
            self.printitem()
            self.updatescroll()
            self.chunkpad.refresh(
                self.firstlineofpadtoprint,
                0,
                self.numstatuslines,
                0,
                self.yscreensize - self.numstatuslines,
                self.xscreensize,
            )
        except curses.error:
            pass

The call to `chunkpad.refresh()` is refreshing the columns 0 to `self.xscreensize`, but `self.xscreensize` is the width, so it should be refreshing the range 0 to `self.xscreensize - 1`.

With windows-curses (which wraps PDCurses), this results in an exception `prefresh() returned ERR`.

Updating this to refresh up to `self.xscreensize-1` fixes the issue.
Comment 1 HG Bot 2020-11-02 15:50 UTC
Fixed by https://mercurial-scm.org/repo/hg/rev/91c41ea14598
Barret Rennie <barret@brennie.ca>
crecord: render chunkpad on Windows (issue6427)

When using Windows wrappers of PDCurses (e.g., windows-curses), the chunkpad
does not render when executing `hg commit -i`. This is due to attempting to
refresh one too many columns of the pad.

Differential Revision: https://phab.mercurial-scm.org/D9267

(please test the fix)
Comment 2 Bugzilla 2020-11-10 00:00 UTC
Bug was set to TESTING for 7 days, resolving