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

Re: svn commit: r1808258 - /subversion/trunk/subversion/libsvn_client/conflicts.c

From: Branko Čibej <brane_at_apache.org>
Date: Tue, 19 Sep 2017 17:56:41 +0200

On 13.09.2017 19:16, stsp_at_apache.org wrote:
> Author: stsp
> Date: Wed Sep 13 17:16:43 2017
> New Revision: 1808258
>
> URL: http://svn.apache.org/viewvc?rev=1808258&view=rev
> Log:
> Follow-up to r1808177:
>
> The change in r1808177 had a bug where moves were actually only searched
> within one revision back in history. Detect moves even if are revisions
> between the "branch-point" and the revision being cherry-picked.
>
> * subversion/libsvn_client/conflicts.c
> (find_nearest_yca): New helper function.
> (conflict_tree_get_details_local_missing): Use find_nearest_yca() to
> find a lower bound for the revision range which must be searched for
> moves.
>
> Modified:
> subversion/trunk/subversion/libsvn_client/conflicts.c
>
> Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1808258&r1=1808257&r2=1808258&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
> +++ subversion/trunk/subversion/libsvn_client/conflicts.c Wed Sep 13 17:16:43 2017
> @@ -482,6 +482,80 @@ find_yca(svn_client__pathrev_t **yca_loc
> return SVN_NO_ERROR;
> }
>
> +/* Like find_yca, expect that a YCA could also be found via a brute-force
> + * search of parents of REPOS_RELPATH1 and REPOS_RELPATH2, if no "direct"
> + * YCA exists. An implicit assumption is that some parent of REPOS_RELPATH1
> + * is a branch of some parent of REPOS_RELPATH2.
> + *
> + * This function can guess a "good enough" YCA for 'missing nodes' which do
> + * not exist in the working copy, e.g. when a file edit is merged to a path
> + * which does not exist in the working copy.
> + */
> +static svn_error_t *
> +find_nearest_yca(svn_client__pathrev_t **yca_locp,
> + const char *repos_relpath1,
> + svn_revnum_t peg_rev1,
> + const char *repos_relpath2,
> + svn_revnum_t peg_rev2,
> + const char *repos_root_url,
> + const char *repos_uuid,
> + svn_ra_session_t *ra_session,
> + svn_client_ctx_t *ctx,
> + apr_pool_t *result_pool,
> + apr_pool_t *scratch_pool)
> +{
> + svn_client__pathrev_t *yca_loc;
> + svn_error_t *err;
> + apr_pool_t *iterpool;
> + const char *p1, *p2;
> + int c1, c2;
> +
> + *yca_locp = NULL;
> +
> + iterpool = svn_pool_create(scratch_pool);
> +
> + p1 = repos_relpath1;
> + c1 = svn_path_component_count(repos_relpath1);

...subversion/libsvn_client/conflicts.c:524:8: warning: implicit conversion loses integer precision:
      'apr_size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
  c1 = svn_path_component_count(repos_relpath1);
     ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> + while (c1--)
> + {
> + svn_pool_clear(iterpool);
> +
> + p2 = repos_relpath2;
> + c2 = svn_path_component_count(repos_relpath2);

.../subversion/libsvn_client/conflicts.c:530:12: warning: implicit conversion loses integer precision:
      'apr_size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
      c2 = svn_path_component_count(repos_relpath2);
         ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> + while (c2--)
> + {
> + err = find_yca(&yca_loc, p1, peg_rev1, p2, peg_rev2,
> + repos_root_url, repos_uuid, ra_session, ctx,
> + result_pool, iterpool);
> + if (err)
> + {
> + if (err->apr_err == SVN_ERR_FS_NOT_FOUND)
> + {
> + svn_error_clear(err);
> + yca_loc = NULL;
> + }
> + else
> + return svn_error_trace(err);
> + }
> +
> + if (yca_loc)
> + {
> + *yca_locp = yca_loc;
> + svn_pool_destroy(iterpool);
> + return SVN_NO_ERROR;
> + }
> +
> + p2 = svn_relpath_dirname(p2, scratch_pool);
> + }
> +
> + p1 = svn_relpath_dirname(p1, scratch_pool);
> + }
> +
> + svn_pool_destroy(iterpool);
> +
> + return SVN_NO_ERROR;
> +}

-- Brane
Received on 2017-09-19 17:56:47 CEST

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