hwri...@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?)

> +          /* Since you cannot actually root an editor at a file, we
> +           * manually drive a function of our editor. */
> +          SVN_ERR(add_file_ev2(eb, "", NULL, tmp_stream, props,
> +                               SVN_INVALID_REVNUM, pool));
>          }
>        else if (kind == svn_node_dir)
>          {
> 
> 

Reply via email to