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

Re: [PATCH] Stylistic tweak, based on r27845

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: Mon, 21 Jan 2008 21:23:49 +0530

Senthil,

Patch looks fine.

+1 to commit.

With regards
Kamesh Jayachandran

Senthil Kumaran S wrote:
> Hi,
>
> I am attaching a patch along with this email, which is a stylisctic
> tweak based on r27845 and the review comments made by glasser
> regarding function return type of renumber_merge_source_rev_range
> in http://svn.haxx.se/dev/archive-2007-11/0628.shtml
>
> [[[
> Stylistic tweak, based on r27845.
>
> This tweak is based on r27845 and the review comments made by glasser
> regarding function return type of renumber_merge_source_rev_range
> in http://svn.haxx.se/dev/archive-2007-11/0628.shtml
>
> * subversion/libsvn_repos/load.c
> (): include private/svn_mergeinfo_private.h
> (prefix_mergeinfo_paths): Change function signature, which returns
> svn_string_t instead of const char*
> (set_node_property): Adjust the caller of prefix_mergeinfo_paths
> according to the above change
>
> Patch by: Senthil Kumaran <senthil_at_collab.net>
> Suggested by: glasser
> dlr
> ]]]
>
> ------------------------------------------------------------------------
>
> Index: subversion/libsvn_repos/load.c
> ===================================================================
> --- subversion/libsvn_repos/load.c (revision 28065)
> +++ subversion/libsvn_repos/load.c (working copy)
> @@ -29,6 +29,8 @@
> #include "svn_mergeinfo.h"
> #include "svn_md5.h"
>
> +#include "private/svn_mergeinfo_private.h"
> +
> #include <apr_lib.h>
>
>
> @@ -236,33 +238,35 @@
> return SVN_NO_ERROR;
> }
>
> +
> /* Prepend the mergeinfo source paths in MERGEINFO_ORIG with PARENT_DIR, and
> return it in *MERGEINFO_VAL. */
> static svn_error_t *
> -prefix_mergeinfo_paths(const char **mergeinfo_val, const char *mergeinfo_orig,
> - const char *parent_dir, apr_pool_t *pool)
> +prefix_mergeinfo_paths(svn_string_t **mergeinfo_val,
> + const svn_string_t *mergeinfo_orig,
> + const char *parent_dir,
> + apr_pool_t *pool)
> {
> apr_hash_t *prefixed_mergeinfo, *mergeinfo;
> apr_hash_index_t *hi;
> - svn_stringbuf_t *merge_val;
> - const char *path;
> - const void *merge_source;
> void *rangelist;
>
> - SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mergeinfo_orig, pool));
> + SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mergeinfo_orig->data, pool));
> prefixed_mergeinfo = apr_hash_make(pool);
> for (hi = apr_hash_first(NULL, mergeinfo); hi; hi = apr_hash_next(hi))
> {
> + const char *path;
> + const void *merge_source;
> apr_hash_this(hi, &merge_source, NULL, &rangelist);
> path = svn_path_join(parent_dir, (const char*)merge_source+1, pool);
> apr_hash_set(prefixed_mergeinfo, path, APR_HASH_KEY_STRING, rangelist);
> }
> - svn_mergeinfo_to_stringbuf(&merge_val, prefixed_mergeinfo, pool);
> - *mergeinfo_val = merge_val->data;
> + SVN_ERR(svn_mergeinfo__to_string(mergeinfo_val, prefixed_mergeinfo, pool));
>
> return SVN_NO_ERROR;
> }
>
> +
> /* Read CONTENT_LENGTH bytes from STREAM, parsing the bytes as an
> encoded Subversion properties hash, and making multiple calls to
> PARSE_FNS->set_*_property on RECORD_BATON (depending on the value
> @@ -1138,10 +1142,10 @@
> {
> /* Prefix the merge source paths with PARENT_DIR. */
> /* ASSUMPTION: All source paths are included in the dump stream. */
> - const char *mergeinfo_val;
> - SVN_ERR(prefix_mergeinfo_paths(&mergeinfo_val, value->data,
> - parent_dir, nb->pool));
> - value = svn_string_create(mergeinfo_val, nb->pool);
> + svn_string_t *mergeinfo_val;
> + SVN_ERR(prefix_mergeinfo_paths(&mergeinfo_val, value, parent_dir,
> + nb->pool));
> + value = mergeinfo_val;
> }
>
> SVN_ERR(svn_fs_change_node_prop(rb->txn_root, nb->path,
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: dev-help_at_subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-01-21 16:54:18 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.