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

RE: svn commit: r1037748 - in /subversion/trunk/subversion: include/private/svn_mergeinfo_private.h libsvn_subr/mergeinfo.c

From: Bert Huijben <bert_at_qqmail.nl>
Date: Mon, 22 Nov 2010 16:16:47 +0100

> -----Original Message-----
> From: julianfoad_at_apache.org [mailto:julianfoad_at_apache.org]
> Sent: maandag 22 november 2010 16:08
> To: commits_at_subversion.apache.org
> Subject: svn commit: r1037748 - in /subversion/trunk/subversion:
> include/private/svn_mergeinfo_private.h libsvn_subr/mergeinfo.c
>
> Author: julianfoad
> Date: Mon Nov 22 15:08:25 2010
> New Revision: 1037748
>
> URL: http://svn.apache.org/viewvc?rev=1037748&view=rev
> Log:
> Simplify and remove ambiguity in a mergeinfo function.
>
> * subversion/include/private/svn_mergeinfo_private.h,
> subversion/libsvn_subr/mergeinfo.c
> (svn_mergeinfo__add_suffix_to_mergeinfo): Require that the suffix is
> a
> canonical relpath.
>
> Modified:
> subversion/trunk/subversion/include/private/svn_mergeinfo_private.h
> subversion/trunk/subversion/libsvn_subr/mergeinfo.c
>

<snip>

> Modified: subversion/trunk/subversion/libsvn_subr/mergeinfo.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/me
> rgeinfo.c?rev=1037748&r1=1037747&r2=1037748&view=diff
> =======================================================================
> =======
> --- subversion/trunk/subversion/libsvn_subr/mergeinfo.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/mergeinfo.c Mon Nov 22
> 15:08:25 2010
> @@ -1809,33 +1809,28 @@ svn_mergeinfo__add_prefix_to_catalog(svn
> svn_error_t *
> svn_mergeinfo__add_suffix_to_mergeinfo(svn_mergeinfo_t *out_mergeinfo,
> svn_mergeinfo_t mergeinfo,
> - const char *suffix,
> + const char *suffix_relpath,
> apr_pool_t *result_pool,
> apr_pool_t *scratch_pool)
> {
> - if (!suffix || svn_dirent_is_absolute(suffix))
> - {
> - *out_mergeinfo = svn_mergeinfo_dup(mergeinfo, result_pool);
> - }
> - else
> - {
> - apr_hash_index_t *hi;
> - const char *canonical_suffix = svn_uri_canonicalize(suffix,
> -
> scratch_pool);
> - *out_mergeinfo = apr_hash_make(result_pool);
> + apr_hash_index_t *hi;
>
> - for (hi = apr_hash_first(scratch_pool, mergeinfo);
> - hi;
> - hi = apr_hash_next(hi))
> - {
> - const char *path = svn__apr_hash_index_key(hi);
> - apr_array_header_t *rangelist = svn__apr_hash_index_val(hi);
> + SVN_ERR_ASSERT(suffix_relpath &&
> svn_relpath_is_canonical(suffix_relpath,
> +
> scratch_pool));
>
> - apr_hash_set(*out_mergeinfo,
> - svn_dirent_join(path, canonical_suffix,
> result_pool),
> - APR_HASH_KEY_STRING,
> - svn_rangelist_dup(rangelist, result_pool));
> - }
> + *out_mergeinfo = apr_hash_make(result_pool);
> +
> + for (hi = apr_hash_first(scratch_pool, mergeinfo);
> + hi;
> + hi = apr_hash_next(hi))
> + {
> + const char *path = svn__apr_hash_index_key(hi);
> + apr_array_header_t *rangelist = svn__apr_hash_index_val(hi);
> +
> + apr_hash_set(*out_mergeinfo,
> + svn_dirent_join(path, suffix_relpath, result_pool),
> + APR_HASH_KEY_STRING,
> + svn_rangelist_dup(rangelist, result_pool));

Path is not a dirent (a local disk path), so this should not use the dirent API.

I think this should use the new svn_fspath__ join. (Merge info contains a '/')

        Bert
Received on 2010-11-22 16:17:30 CET

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