[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: newline conversion with EDITOR

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-01-28 10:57:16 CET

On Mon, Jan 28, 2002 at 10:14:29AM +0100, Daniel Stenberg wrote:
> On Sat, 26 Jan 2002, Branko [UTF-8] ÄŒibej wrote:
>
> > The EDITOR stuff isn't careful about newline conversion in the log
> > messages. I edited this log message on Windows with Notepad, and this is
> > the result.
>
> Oops.
>
> > May I suggest that we read and write a) files with log messages; b) files
> > with prop values; using stdio FILE*s, opend in text mode ("rt", "wt")?
> > that'll take care of newline conversion on all systems.
>
> Isn't this just a case where we (I) use bad flags to apr_file_open() ?
>
> Sicne the -F stuff works, and it opens the files with 'APR_OS_DEFAULT' then
> wouldn't that be the quick solution to this problem?

Um...

I'm a little unclear on where Branko wants the newline stuff to go here.
IMO, there shouldn't be any newline conversion. The editor should be popped
up, and we just suck out the data. I guess we kind of need to figure out
what the newline style is, so that we can properly eliminate lines that
start with SVN:.

But I don't think we shold use FILE*. Using apr_file_t is portable. If it
has drawbacks, then we should fix APR, not workaround it.

So... I'd say the intended behavior is:

*) get the file as specified by -F or as the output of EDITOR.
*) figure out the newline style (\r, \n, \r\n), and break up the files into
   lines. eliminate lines that start with SVN:
*) eliminate leading and trailing blank lines (new behavior!)
*) recompose the log message using Unix newlines: \n
*) send the contents as the log message

We had said that the property stuff should treat all properties as binary.
It is possible that we shouldn't do any newline handling for property files.
Just take the output as is and shove it into the property.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:00 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.