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

RE: svn commit: r1687241 - in /subversion/trunk/subversion: include/svn_client.h libsvn_client/resolved.c svn/conflict-callbacks.c

From: Bert Huijben <bert_at_qqmail.nl>
Date: Wed, 24 Jun 2015 14:01:59 +0200

> -----Original Message-----
> From: stsp_at_apache.org [mailto:stsp_at_apache.org]
> Sent: woensdag 24 juni 2015 13:39
> To: commits_at_subversion.apache.org
> Subject: svn commit: r1687241 - in /subversion/trunk/subversion:
> include/svn_client.h libsvn_client/resolved.c svn/conflict-callbacks.c
>
> Author: stsp
> Date: Wed Jun 24 11:39:26 2015
> New Revision: 1687241
>
> URL: http://svn.apache.org/r1687241
> Log:
> Introduce a new conflict API function: svn_client_conflict_prop_get_propvals()
>
> Make use of this function in the conflict resolver. The biggest change is that
> the resolver now has to deal with property values in terms of svn_string_t
> rather than paths to temporary files.
>
> Until the svn_wc_conflict_description2_t structure is fully phased out,
> however, the client library must still read temporary files into svn_string_t
> behind the scenes, and the resolver must still return merged property values
> via temporary files.
>
> * subversion/include/svn_client.h
> (svn_client_conflict_prop_get_propvals): Declare.
>
> * subversion/libsvn_client/resolved.c
> (get_propval_from_filepath): New helper function.
> (svn_client_conflict_prop_get_propvals): Implement.
>
> * subversion/svn/conflict-callbacks.c
> (merge_prop_conflict, show_prop_conflict, edit_prop_conflict,
> handle_prop_conflict): Handle all property values as svn_string_t.
>
> Modified:
> subversion/trunk/subversion/include/svn_client.h
> subversion/trunk/subversion/libsvn_client/resolved.c
> subversion/trunk/subversion/svn/conflict-callbacks.c
>
> Modified: subversion/trunk/subversion/include/svn_client.h
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h
> ?rev=1687241&r1=1687240&r2=1687241&view=diff
> ================================================================
> ==============
> --- subversion/trunk/subversion/include/svn_client.h (original)
> +++ subversion/trunk/subversion/include/svn_client.h Wed Jun 24 11:39:26
> 2015
> @@ -4436,6 +4436,23 @@ svn_client_conflict_prop_get_propname(
> const svn_wc_conflict_description2_t *conflict);
>
> /**
> + * Return the set of property values involved in the property conflict
> + * described by @a conflict. If a property value is unavailable the
> + * corresponding output argument is set to @c NULL.
> + *
> + * @since New in 1.10.
> + */
> +svn_error_t *
> +svn_client_conflict_prop_get_propvals(
> + const svn_string_t **base_propval,
> + const svn_string_t **my_propval,
> + const svn_string_t **their_propval,
> + const svn_wc_conflict_description2_t *conflict,
> + apr_pool_t *result_pool,
> + apr_pool_t *scratch_pool);

Why only 3 values now?

I remember you tweaking the code to pass all 4 values a few weeks (months?) ago.

> +
> +
> +/**
> * Accessor functions for svn_wc_conflict_description2_t. This is a temporary
> * API for eventually replacing svn_wc_conflict_description2_t with an opaque
> * type and providing improved APIs for conflict resolution.
>
> Modified: subversion/trunk/subversion/libsvn_client/resolved.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/resolv
> ed.c?rev=1687241&r1=1687240&r2=1687241&view=diff
> ================================================================
> ==============
> --- subversion/trunk/subversion/libsvn_client/resolved.c (original)
> +++ subversion/trunk/subversion/libsvn_client/resolved.c Wed Jun 24 11:39:26
> 2015
> @@ -201,3 +201,67 @@ svn_client_conflict_prop_get_propname(
>
> return conflict->property_name;
> }
> +
> +static svn_error_t *
> +get_propval_from_filepath(const svn_string_t **propval,
> + const char *local_abspath,
> + apr_pool_t *result_pool,
> + apr_pool_t *scratch_pool)
> +{
> + svn_stringbuf_t *buf;
> +
> + SVN_ERR(svn_stringbuf_from_file2(&buf, local_abspath, scratch_pool));
> + *propval = svn_string_create_from_buf(buf, result_pool);
> +
> + return SVN_NO_ERROR;
> +}
> +
> +svn_error_t *
> +svn_client_conflict_prop_get_propvals(
> + const svn_string_t **base_propval,
> + const svn_string_t **my_propval,
> + const svn_string_t **their_propval,
> + const svn_wc_conflict_description2_t *conflict,
> + apr_pool_t *result_pool,
> + apr_pool_t *scratch_pool)
> +{
> + SVN_ERR_ASSERT(svn_client_conflict_get_kind(conflict) ==
> + svn_wc_conflict_kind_property);
> +
> + /* ### Work around a historical bug in the provider: the path to the
> + * conflict description file was put in the 'theirs' field, and
> + * 'theirs' was put in the 'merged' field. */
> + ((svn_wc_conflict_description2_t *)conflict)->their_abspath =
> + conflict->merged_file;
> + ((svn_wc_conflict_description2_t *)conflict)->merged_file = NULL;
> +
> + if (base_propval)
> + {
> + if (conflict->base_abspath)
> + SVN_ERR(get_propval_from_filepath(base_propval, conflict-
> >base_abspath,
> + result_pool, scratch_pool));

Since 1.9 you can assume that we have the actual values in ram, stored in the new fields of the conflict description, that you added for 1.9.

Please use those instead of relying on the temporary file (that should be gone once we completely switch to the new code).

        Bert
Received on 2015-06-24 14:03:00 CEST

This is an archived mail posted to the Subversion Dev mailing list.