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

Re: [PATCH][MERGE-TRACKING] New function to create a mergeinfo hash out of a single path and single merge-range

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-10-10 11:18:47 CEST

> [[[
> Abstract construction of a mergeinfo of a single path with single
> merge-range
> into a separate function.
>
> On the merge-tracking branch:
> Patch By: dlr
> madanus
>
> * subversion/include/svn_mergeinfo.h
> (svn_mergeinfo__make): New.
Somehow I feel not having '__', if it is '__' the function should be on
a private header file.
May be 'svn_mergeinfo__make' -> 'svn_mergeinfo_make'?
> ------------------------------------------------------------------------
>
> Index: subversion/include/svn_mergeinfo.h
> ===================================================================
> --- subversion/include/svn_mergeinfo.h (revision 21841)
> +++ subversion/include/svn_mergeinfo.h (working copy)
> @@ -47,6 +47,13 @@
> svn_mergeinfo_parse(const char *input, apr_hash_t **mergehash,
> apr_pool_t *pool);
>
> +/** Make a mergeinfo hash for the given @a path, @a start and @a end
> + * revisions.
> + */
> +apr_hash_t *
> +svn_mergeinfo__make(const char *path, svn_revnum_t start, svn_revnum_t end,
> + apr_pool_t *pool);
> +
> /** Calculate the delta between two hashes of merge info, @a mergefrom
> * and @a mergeto, and place the result in @a deleted and @a added
> * (neither output argument will ever be @c NULL), stored as the usual
> Index: subversion/libsvn_subr/mergeinfo.c
> ===================================================================
> --- subversion/libsvn_subr/mergeinfo.c (revision 21841)
> +++ subversion/libsvn_subr/mergeinfo.c (working copy)
> @@ -224,7 +224,24 @@
> return parse_top(&input, input + strlen(input), *hash, pool);
> }
>
> +apr_hash_t *
> +svn_mergeinfo__make(const char *path, svn_revnum_t start, svn_revnum_t end,
> + apr_pool_t *pool)
> +{
> + apr_hash_t *mergeinfo;
> + svn_merge_range_t *range = apr_palloc(pool, sizeof(*range));
>
I feel

- svn_merge_range_t *range = apr_palloc(pool, sizeof(*range));

+svn_merge_range_t *range = apr_palloc(pool, sizeof(svn_merge_range_t));

more clearer.
> + apr_array_header_t *rangelist = apr_array_make(pool, 1, sizeof(range));
>
> + range->start = start;
> + range->end = end;
> +
> + APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = range;
> + mergeinfo = apr_hash_make(pool);
> + apr_hash_set(mergeinfo, path, sizeof(rangelist), rangelist);
>
Again!

- apr_hash_set(mergeinfo, path, sizeof(rangelist), rangelist);

+ apr_hash_set(mergeinfo, path, APR_HASH_KEY_STRING, rangelist);

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 10 11:18:12 2006

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