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

Re: svn commit: r1238862 - /subversion/trunk/subversion/svnrdump/dump_editor.c

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Wed, 1 Feb 2012 09:45:13 +0200

hwright_at_apache.org wrote on Tue, Jan 31, 2012 at 23:40:06 -0000:
> Author: hwright
> Date: Tue Jan 31 23:40:06 2012
> New Revision: 1238862
>
> URL: http://svn.apache.org/viewvc?rev=1238862&view=rev
> Log:
> Ev2 shims: Add a prop fetching function for svnrdump. This prevents crashes,
> but doesn't improve any correctness--yet.
>
> * subversion/svnrdump/dump_editor.c
> (fetch_props_func): New.
> (svn_rdump__get_dump_editor): Use the prop fetching function.
>
> Modified:
> subversion/trunk/subversion/svnrdump/dump_editor.c
>
> Modified: subversion/trunk/subversion/svnrdump/dump_editor.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/dump_editor.c?rev=1238862&r1=1238861&r2=1238862&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/svnrdump/dump_editor.c (original)
> +++ subversion/trunk/subversion/svnrdump/dump_editor.c Tue Jan 31 23:40:06 2012
> @@ -886,6 +886,45 @@ fetch_base_func(const char **filename,
> return SVN_NO_ERROR;
> }
>
> +static svn_error_t *
> +fetch_props_func(apr_hash_t **props,
> + void *baton,
> + const char *path,
> + svn_revnum_t base_revision,
> + apr_pool_t *result_pool,
> + apr_pool_t *scratch_pool)
> +{
> + struct dump_edit_baton *eb = baton;
> + svn_node_kind_t node_kind;
> +
> + SVN_ERR(svn_ra_check_path(eb->ra_session, path, base_revision, &node_kind,
> + scratch_pool));
> +
> + if (node_kind == svn_node_file)
> + {
> + SVN_ERR(svn_ra_get_file(eb->ra_session, path, base_revision,
> + NULL, NULL, props, result_pool));
> + }
> + else if (node_kind == svn_node_dir)
> + {
> + apr_array_header_t *tmp_props;
> +
> + SVN_ERR(svn_ra_get_dir2(eb->ra_session, NULL, NULL, props, path,
> + base_revision, 0 /* Dirent fields */,
> + result_pool));
> + tmp_props = svn_prop_hash_to_array(*props, result_pool);
> + SVN_ERR(svn_categorize_props(tmp_props, NULL, NULL, &tmp_props,
> + result_pool));
> + *props = svn_prop_array_to_hash(tmp_props, result_pool);
> + }
> + else
> + {
> + *props = apr_hash_make(result_pool);

Is it correct to return an empty hash for svn_node_unknown?

> + }
> +
> + return SVN_NO_ERROR;
> +}
Received on 2012-02-01 08:46:10 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.