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