Index: subversion/libsvn_client/merge.c =================================================================== --- subversion/libsvn_client/merge.c (revision 37602) +++ subversion/libsvn_client/merge.c (working copy) @@ -2873,6 +2873,63 @@ return SVN_NO_ERROR; } +/* Helper of filter_merged_revisions to make sure implicit mergeinfo + * is available for CHILD, a child of PARENT (PARENT can be NULL for the + * merge root). ENTRY is the entry corresponding to CHILD->PATH. + * + * The range REVISION1:REVISION2 specifies the requested merge. + * + * RA_SESSION, ADM_ACCESS, and CTX can be used to retrieve the mergeinfo + * if it is not already cached in CHILD. + */ +static svn_error_t * +ensure_implicit_mergeinfo(svn_client__merge_path_t *parent, + svn_client__merge_path_t *child, + const svn_wc_entry_t *entry, + svn_revnum_t revision1, + svn_revnum_t revision2, + svn_ra_session_t *ra_session, + svn_wc_adm_access_t *adm_access, + svn_client_ctx_t *ctx, + apr_pool_t *pool) +{ + /* If we haven't already found CHILD->IMPLICIT_MERGEINFO then + contact the server to get it. */ + + if (child->implicit_mergeinfo) + return SVN_NO_ERROR; + + + /* If CHILD has explicit mergeinfo only because its parent has + non-inheritable mergeinfo (see criteria 3 in + get_mergeinfo_paths() then CHILD can inherit PARENT's + implicit mergeinfo and we can avoid contacting the server. + + If child->child_of_noninheritable is true, it implies that + PARENT must exist per the rules of get_mergeinfo_paths(). */ + + if (child->child_of_noninheritable) + SVN_ERR(inherit_implicit_mergeinfo_from_parent(parent, + child, + revision1, + revision2, + ra_session, + adm_access, + ctx, + pool)); + else + SVN_ERR(get_full_mergeinfo(NULL, + &(child->implicit_mergeinfo), + entry, NULL, + svn_mergeinfo_inherited, + ra_session, child->path, + MAX(revision1, revision2), + MIN(revision1, revision2), + adm_access, ctx, pool)); + + return SVN_NO_ERROR; +} + /* Helper for calculate_remaining_ranges(). Initialize CHILD->REMAINING_RANGES to a rangelist representing the @@ -3002,37 +3059,16 @@ { apr_array_header_t *implicit_rangelist; - /* If we haven't already found CHILD->IMPLICIT_MERGEINFO then - contact the server to get it. */ - if (! (child->implicit_mergeinfo)) - { - /* If CHILD has explicit mergeinfo only because its parent has - non-inheritable mergeinfo (see criteria 3 in - get_mergeinfo_paths() then CHILD can inherit PARENT's - implicit mergeinfo and we can avoid contacting the server. + SVN_ERR(ensure_implicit_mergeinfo(parent, + child, + entry, + revision1, + revision2, + ra_session, + adm_access, + ctx, + pool)); - If child->child_of_noninheritable is true, it implies that - PARENT must exist per the rules of get_mergeinfo_paths(). */ - if (child->child_of_noninheritable) - SVN_ERR(inherit_implicit_mergeinfo_from_parent(parent, - child, - revision1, - revision2, - ra_session, - adm_access, - ctx, - pool)); - else - SVN_ERR(get_full_mergeinfo(NULL, - &(child->implicit_mergeinfo), - entry, NULL, - svn_mergeinfo_inherited, - ra_session, child->path, - MAX(revision1, revision2), - MIN(revision1, revision2), - adm_access, ctx, subpool)); - } - target_implicit_rangelist = apr_hash_get(child->implicit_mergeinfo, mergeinfo_path, APR_HASH_KEY_STRING); @@ -3110,37 +3146,17 @@ { /* Based on CHILD's TARGET_MERGEINFO there are ranges to merge. Check CHILD's implicit mergeinfo to see if these remaining - ranges are represented there. If we don't already have - CHILD->IMPLICIT_MERGEINFO then get it now. */ - if (! (child->implicit_mergeinfo)) - { - /* If CHILD has explicit mergeinfo only because its parent has - non-inheritable mergeinfo (see criteria 3 in - get_mergeinfo_paths() then CHILD can inherit PARENT's - implicit mergeinfo and we can avoid contacting the server. + ranges are represented there. */ + SVN_ERR(ensure_implicit_mergeinfo(parent, + child, + entry, + revision1, + revision2, + ra_session, + adm_access, + ctx, + pool)); - If child->child_of_noninheritable is true, it implies that - PARENT must exist per the rules of get_mergeinfo_paths(). */ - if (child->child_of_noninheritable) - SVN_ERR(inherit_implicit_mergeinfo_from_parent(parent, - child, - revision1, - revision2, - ra_session, - adm_access, - ctx, - pool)); - else - SVN_ERR(get_full_mergeinfo(NULL, - &(child->implicit_mergeinfo), - entry, NULL, - svn_mergeinfo_inherited, - ra_session, child->path, - MAX(revision1, revision2), - MIN(revision1, revision2), - adm_access, ctx, pool)); - } - target_implicit_rangelist = apr_hash_get(child->implicit_mergeinfo, mergeinfo_path, APR_HASH_KEY_STRING);