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

Re: svn cat (was: Re: svn up -p)

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2002-11-13 20:48:27 CET

Greg Hudson <ghudson@MIT.EDU> writes:

> On Tue, 2002-11-12 at 08:53, Ben Collins-Sussman wrote:
> > Sure, take a look at libsvn_client/switch.c:192 and below. There's a
> > call to RA->get_file() in there. Notice that first creates a unique
> > tmpfile and gets an apr_file_t back. Then it converts the apr_file_t
> > into an svn_stream_t. Then the stream object is given to
> > RA->get_file(), which pushes data into the stream.
> >
> > In your case, you probably just want to get an apr_file_t that
> > represents stdout, and convert that into a stream.
>
> What about keyword and newline translation?

You just HAD to open that can of worms, eh? :-)

Let's label that as "phase 2" of 'svn cat'. It's not trivial, but it
won't be that hard either. RA->get_file() is able to retrieve text,
props, or both. It's just a matter of looking at the svn:eol-style
and svn:keywords props, fetching the textdata into a tmpfile,
copy-and-translating into a 2nd tmpfile, dumping to the screen, then
deleting the tmpfiles. I think.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Nov 13 20:50:29 2002

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.