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

Re: svn commit: r1091786 - in /subversion/trunk/subversion/libsvn_client: client.h cmdline.c externals.c merge.c mergeinfo.c url.c util.c

From: Greg Stein <gstein_at_gmail.com>
Date: Wed, 13 Apr 2011 14:11:22 -0400

On Wed, Apr 13, 2011 at 10:00, <rhuijben_at_apache.org> wrote:
>...
> +++ subversion/trunk/subversion/libsvn_client/merge.c Wed Apr 13 14:00:49 2011
>...
> @@ -10692,8 +10687,7 @@ merge_peg_locked(const char *source,
>   /* Determine the working copy target's repository root URL. */
>   working_rev.kind = svn_opt_revision_working;
>   SVN_ERR(svn_client__get_repos_root(&wc_repos_root, target_abspath,
> -                                     &working_rev, ctx,
> -                                     scratch_pool, scratch_pool));
> +                                     ctx, scratch_pool, scratch_pool));

working_rev can be removed from this function.

>...
>
>   /* Open an RA session to our source URL, and determine its root URL. */
>   sesspool = svn_pool_create(scratch_pool);
>
> Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.c?rev=1091786&r1=1091785&r2=1091786&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/mergeinfo.c (original)
> +++ subversion/trunk/subversion/libsvn_client/mergeinfo.c Wed Apr 13 14:00:49 2011
> @@ -1020,7 +1020,7 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
>
>       /* Acquire return values. */
>       SVN_ERR(svn_client__get_repos_root(repos_root, local_abspath,
> -                                         &peg_rev, ctx, result_pool,
> +                                         ctx, result_pool,
>                                          scratch_pool));

The elimination of peg_rev in this branch of the (is_url) test means
that a huge block can be removed from early in the function, and then
peg_rev's declaration and initialization tightened to the inner block.

>...
> +++ subversion/trunk/subversion/libsvn_client/url.c Wed Apr 13 14:00:49 2011
> @@ -47,14 +47,19 @@ svn_client_url_from_path2(const char **u
>                           apr_pool_t *result_pool,
>                           apr_pool_t *scratch_pool)
>  {
> -  svn_opt_revision_t revision;
> -
>   if (!svn_path_is_url(path_or_url))
> -    SVN_ERR(svn_dirent_get_absolute(&path_or_url, path_or_url, scratch_pool));
> +    {
> +      SVN_ERR(svn_dirent_get_absolute(&path_or_url, path_or_url,
> +                                      scratch_pool));
> +
> +      return svn_error_return(
> +                 svn_wc__node_get_url(url, ctx->wc_ctx, path_or_url,
> +                                      result_pool, scratch_pool));
> +    }
> +  else
> +    *url = apr_pstrdup(result_pool, path_or_url);

The 'else' is not required since the true-block returns.

>...

Cheers,
-g
Received on 2011-04-13 20:12:27 CEST

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.