You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kamesh Jayachandran <ka...@collab.net> on 2008/01/21 15:53:49 UTC

Re: [PATCH] Stylistic tweak, based on r27845

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 <se...@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@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Stylistic tweak, based on r27845

Posted by Senthil Kumaran S <se...@collab.net>.
Kamesh Jayachandran wrote:
> Patch looks fine.
> 
> +1 to commit.

Committed in r28996.

-- 
Senthil Kumaran S
http://www.stylesen.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org