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

Re: svn commit: r1803140 - in /subversion/trunk/subversion: include/svn_delta.h libsvn_delta/svndiff.c tests/libsvn_delta/random-test.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 27 Jul 2017 11:59:46 +0000

kotkov_at_apache.org wrote on Thu, 27 Jul 2017 08:53 +0000:
> URL: http://svn.apache.org/viewvc?rev=1803140&view=rev
> Log:
> Add new svn_txdelta_to_svndiff_stream() API.
>
> This API turns a given svn_txdelta_stream_t delta stream into a readable
> svn_stream_t containing svndiff. It would be required to make ra_serf
> stream svndiff deltas without creating temporary files.
>
> +++ subversion/trunk/subversion/libsvn_delta/svndiff.c Thu Jul 27 08:53:51 2017
> @@ -993,3 +993,95 @@ svn_txdelta__read_raw_window_len(apr_siz
> +static svn_error_t *
> +svndiff_stream_write_fn(void *baton, const char *data, apr_size_t *len)
> +{
> + svndiff_stream_baton_t *b = baton;
> +
> + svn_stringbuf_appendbytes(b->window_buffer, data, *len);
> +
> + return SVN_NO_ERROR;
> +}

Isn't this using O(filesize in bytes) memory? File content streams are
supposed to be O(1) memory.

> +++ subversion/trunk/subversion/include/svn_delta.h Thu Jul 27 08:53:51 2017
> @@ -546,6 +546,20 @@ svn_txdelta_to_svndiff(svn_stream_t *out
> +/** Return a readable generic stream which will produce svndiff-encoded
> + * text delta from the delta stream @a txstream. @a svndiff_version and
> + * @a compression_level are same as in svn_txdelta_to_svndiff3().
> + *

Why is a write handler implemented, when the docstring doesn't promise
the returned stream would be writable?

> + * Allocate the stream in @a pool.
> + *
> + * @since New in 1.10.
> + */
> +svn_stream_t *
> +svn_txdelta_to_svndiff_stream(svn_txdelta_stream_t *txstream,
> + int svndiff_version,
> + int compression_level,
> + apr_pool_t *pool);

Cheers,

Daniel
Received on 2017-07-27 13:59:59 CEST

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.