This is an archive of the discontinued Mercurial Phabricator instance.

crecord: fallback to text mode if diffs are too big for curses mode
ClosedPublic

Authored by spectral on May 18 2018, 2:12 AM.

Details

Summary

crecord uses curses.newpad to create a region that we can then scroll around in
by moving the main 'screen' as a veiwport into the (probably larger than the
actual screen) pad. Internally, at least in ncurses, pads are implemented using
windows, which have their dimensions limited to a certain size. Depending on
compilation options for ncurses, this size might be pretty small: (signed)
short, or it might be larger ((signed) int).

crecord wants to have enough room to have all of the contents of the main area
of the chunkselector in the pad; this means that the full size with everything
expanded must be less than these (undocumented, afaict) limits.

It's not easy to write tests for this because the limits are platform- and
installation- dependent and undocumented / unqueryable, as far as I can tell.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

spectral created this revision.May 18 2018, 2:12 AM
pulkit accepted this revision.May 18 2018, 2:09 PM
This revision was automatically updated to reflect the committed changes.