[PATCH 5 of 5] ui: use bytes IO and convert EOL manually in ui.editor()

David Soria Parra dsp at experimentalworks.net
Sat Apr 1 12:49:59 EDT 2017


On Sat, Apr 01, 2017 at 07:00:07PM +0900, Yuya Nishihara wrote:
> On Fri, 31 Mar 2017 09:52:37 -0700, David Soria Parra wrote:
> > On Wed, Mar 29, 2017 at 11:46:41PM +0900, Yuya Nishihara wrote:
> > > # HG changeset patch
> > > # User Yuya Nishihara <yuya at tcha.org>
> > > # Date 1490791418 -32400
> > > #      Wed Mar 29 21:43:38 2017 +0900
> > > # Node ID 81aa3738f703e4354b0f853e87548a139b129bdd
> > > # Parent  c43fe15a4a4bec542b7411087a1ad0233cb5614f
> > > ui: use bytes IO and convert EOL manually in ui.editor()
> > > 
> > I am not sure if we should convert line endings. In particular crecord is
> > calling ui.edit() with a patch. A patch that would have CRLF line endings would
> > be displayed wrong and if someone wants to add a lineending or remove it in the
> > process, we would wrongly convert it to LF on Windows machines.
> 
> We need EOL conversion on Windows because of notepad.exe. For crecord, we
> might want to add ui.edit(text=False) option.

That could work. I feel all user input either in the form of crecords
patch or comittemplates should be returned to the user as is. Internal strings,
such as the default comittemplate or similar things should be converted to the
platform specific. An ui.edit(..., raw=True) switch could work


More information about the Mercurial-devel mailing list