This is an archive of the discontinued Mercurial Phabricator instance.

histedit: py3 fixes for curses mode
ClosedPublic

Authored by sfink on Feb 25 2020, 4:32 PM.

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

sfink created this revision.Feb 25 2020, 4:32 PM
sfink added a comment.Feb 25 2020, 4:37 PM

Maybe this should be in the patch comment, but justification for the change:

_chistedit is looking for bytestr opt keys, but is getting string keys. Normally, I'd use pycompat.byteskwargs at the top, except that _texthistedit is called at the bottom and it's expecting to see str keys initially (before it fixes them up). So I canonicalize in the caller (that chooses between an initial _chistedit or _texthistedit), except that it's passing the opts with **opts and Python requires keywords to be str. So I stop splatting the args and opts.

I wasn't involved in the py3 port, but it does seem weird to me that strings are forced to be bytes everywhere. That makes sense for everything read out of a repo, but it seems like the command line should think in strings for both keys and non-path values. But I'm sure there were some hard decisions to make.

pulkit accepted this revision.Mar 2 2020, 8:02 AM
This revision is now accepted and ready to land.Mar 2 2020, 8:02 AM