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

Re: svn commit: r1232634 - /subversion/branches/ev2-export/subversion/libsvn_client/export.c

From: Hyrum K Wright <hyrum.wright_at_wandisco.com>
Date: Wed, 18 Jan 2012 08:07:04 -0600

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

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.