D8150: histedit: py3 fixes for curses mode

sfink (Steve Fink) phabricator at mercurial-scm.org
Tue Feb 25 21:37:55 UTC 2020


sfink added a comment.


  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.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8150/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8150

To: sfink, durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list