On Tue, Jan 17, 2012 at 11:10 PM, Daniel Shahaf <danielsh_at_elego.de> wrote:
> hwright_at_apache.org wrote on Tue, Jan 17, 2012 at 23:04:32 -0000:
>> Author: hwright
>> Date: Tue Jan 17 23:04:32 2012
>> New Revision: 1232634
>>
>> URL: http://svn.apache.org/viewvc?rev=1232634&view=rev
>> Log:
>> On the ev2-export branch:
>> Replace one hack with another, which allows us to remove the vestigal delta
>> editor from the export functionality.
>>
>> * subversion/libsvn_client/export.c
>> Â (dir_baton, file_baton, change_file_prop, close_file): Remove.
>> Â (svn_client_export5): Instead of manually driving the delta editor,
>> Â Â manually drive an Ev2 editor. Â This has the happy consequence of only
>> Â Â requiring one function call, instead of three.
>>
>> Modified:
>> Â Â subversion/branches/ev2-export/subversion/libsvn_client/export.c
>>
>> Modified: subversion/branches/ev2-export/subversion/libsvn_client/export.c
>> URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/export.c?rev=1232634&r1=1232633&r2=1232634&view=diff
>> ==============================================================================
>> +++ subversion/branches/ev2-export/subversion/libsvn_client/export.c Tue Jan 17 23:04:32 2012
>> @@ -671,166 +671,6 @@ struct edit_baton
>> Â };
>>
>>
>> Â static svn_error_t *
>> Â fetch_props_func(apr_hash_t **props,
>> Â Â Â Â Â Â Â Â Â void *baton,
>> @@ -1138,8 +978,8 @@ svn_client_export5(svn_revnum_t *result_
>> Â Â Â Â if (kind == svn_node_file)
>> Â Â Â Â Â {
>> Â Â Â Â Â Â apr_hash_t *props;
>> + Â Â Â Â Â svn_stream_t *tmp_stream;
>> + Â Â Â Â Â const char *tmppath;
>> Â Â Â Â Â Â svn_node_kind_t to_kind;
>>
>> Â Â Â Â Â Â if (svn_path_is_empty(to_path))
>> @@ -1171,41 +1011,21 @@ svn_client_export5(svn_revnum_t *result_
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "overwrite directory with non-directory"),
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â svn_dirent_local_style(to_path, pool));
>>
>> + Â Â Â Â Â SVN_ERR(svn_stream_open_unique(&tmp_stream, &tmppath,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â svn_dirent_dirname(eb->root_path, pool),
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â svn_io_file_del_on_pool_cleanup,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â pool, pool));
>>
>> Â Â Â Â Â Â SVN_ERR(svn_ra_get_file(ra_session, "", revnum,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tmp_stream, NULL, &props, pool));
>> + Â Â Â Â Â SVN_ERR(svn_stream_close(tmp_stream));
>>
>> + Â Â Â Â Â SVN_ERR(svn_stream_open_readonly(&tmp_stream, tmppath, pool, pool));
>>
>
> Same question as before. Â Why the tempfile? Â Can you avoid it?
> (Perhaps that requires an svn_stream_copy() call?)
The tempfile here is due to the way the svn_ra_get_file() interface
works. Note that instead of returning a stream, that API accepts and
already open stream and then pushes content to it. In contrast, the
Ev2 add_file handler, as well as svn_stream_copy3(), pulls content
from the source stream. Given this mismatch, a temporary storage
location is needed.
It may be possible to utilize the new spillbuffer code to build a
stream which can act as a buffer when needed and only spill to disk
when the file grows beyond a certain threshold, though I've not
explored it.
-Hyrum
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Received on 2012-01-18 15:07:37 CET