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

Re: [PATCH] issue #3555: make svn_stream_readline() a stream method

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Thu, 08 Jul 2010 14:41:41 +0100

On Thu, 2010-07-08 at 15:23 +0200, Stefan Sperling wrote:
> On Thu, Jul 08, 2010 at 02:08:15PM +0200, Stefan Sperling wrote:
> > On Thu, Jul 08, 2010 at 12:39:22PM +0100, Julian Foad wrote:
> > > I've only skimmed through it so far, and probably can't do a full review
> > > before the end of the month. However from what I've seen it looks good
> > > enough to go ahead and then improve/fix later.
> >
> > OK, I'll fix up the bits above and commit.
> FYI, on IRC, we decided to go for a different approach:

... because we realized that the semantics weren't really defined, e.g.
what's supposed to happen when you stack one stream with an custom
readline() method on top of another stream with a custom readline()
method, and/or one or both of them transform the lines such that a
series of readline() gives different data from a series of read(). As
readline() is not a primitive stream op, but is defined in terms of
read(), it's not clear how it's supposed to work in general.

Berty suggested, and we agreed, that readline() is a higher level
concept than stream-of-bytes, and so maybe we would want to consider
implementing some "stream of lines" concept that could be built on a
stream-of-bytes but not vice-versa.

> <stsp> julianf, look at svn_hunk_t in svn_diff.h
> <stsp> the streams in there need special handling when reading lines from them
> <stsp> instead of overloading readline we can simply add a set of helper functions that are meant to be used for reading lines from those streams
> <stsp> that is specific to what we need in svn patch,
> <stsp> and avoids having to worry about all the other generic streams
> <stsp> and if a user calls the diff-specific stream reader functions on a generic stream, that's the user's problem
> <julianf> Yes, that sounds better.
> <stsp> ok, I'll do that then

I think anything local to diff/patch like that sounds better than the
status quo of having special readline() behaviour tacked on to the
generic stream class, but I didn't consider what you mean exactly or
what would really be the best way to structure the diff/patch streamy

- Julian
Received on 2010-07-08 15:48:29 CEST

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