Include more information in the baton passed around during a merge. No functional change; this is a step in preparation for detecting whether a directory to be deleted is the same as what existed in the merge-left source. During a merge, pass around in the merge baton the repository location of the merge sources, instead of just the URL of the merge-right source, so that the information is available to all callbacks. (Some of the callbacks already receive some of this information through the svn_diff_callbacks3_t interface, but inconsistently and incompletely. This change is a local alternative to revving the callbacks API and making it consistent.) * subversion/libsvn_client/merge.c (merge_source_t): Move this definition to earlier in the file. (merge_cmd_baton_t): Replace the "url" field with a "merge_source" field. (merge_file_added, merge_dir_added): Adjust usage accordingly. (do_merge): Initialise the "merge_source" field instead of the "url" field. Index: subversion/libsvn_client/merge.c =================================================================== --- subversion/libsvn_client/merge.c (revision 32478) +++ subversion/libsvn_client/merge.c (working copy) @@ -192,6 +192,18 @@ /*** Repos-Diff Editor Callbacks ***/ +typedef struct merge_source_t +{ + /* "left" side URL and revision (inclusive iff youngest) */ + const char *url1; + svn_revnum_t rev1; + + /* "right" side URL and revision (inclusive iff youngest) */ + const char *url2; + svn_revnum_t rev2; + +} merge_source_t; + typedef struct merge_cmd_baton_t { svn_boolean_t force; svn_boolean_t dry_run; @@ -215,7 +227,7 @@ dir is added as a child of a versioned dir (dry-run only) */ const char *target; /* Working copy target of merge */ - const char *url; /* The second URL in the merge */ + merge_source_t merge_source; /* The left and right URLs and revs */ svn_client_ctx_t *ctx; /* Client context for callbacks, etc. */ /* Whether invocation of the merge_file_added() callback required @@ -884,10 +896,10 @@ const char *child = svn_path_is_child(merge_b->target, mine, subpool); if (child != NULL) - copyfrom_url = svn_path_url_add_component(merge_b->url, + copyfrom_url = svn_path_url_add_component(merge_b->merge_source.url2, child, subpool); else - copyfrom_url = merge_b->url; + copyfrom_url = merge_b->merge_source.url2; copyfrom_rev = rev2; SVN_ERR(check_scheme_match(adm_access, copyfrom_url)); } @@ -1152,7 +1164,8 @@ add. */ if (merge_b->same_repos) { - copyfrom_url = svn_path_url_add_component(merge_b->url, child, subpool); + copyfrom_url = svn_path_url_add_component(merge_b->merge_source.url2, + child, subpool); copyfrom_rev = rev; SVN_ERR(check_scheme_match(adm_access, copyfrom_url)); } @@ -4060,18 +4073,6 @@ /*** Merge Source Normalization ***/ -typedef struct merge_source_t -{ - /* "left" side URL and revision (inclusive iff youngest) */ - const char *url1; - svn_revnum_t rev1; - - /* "right" side URL and revision (inclusive iff youngest) */ - const char *url2; - svn_revnum_t rev2; - -} merge_source_t; - /* qsort-compatible sort routine, rating merge_source_t * objects to be in descending (youngest-to-oldest) order based on their ->rev1 component. */ @@ -5514,7 +5515,7 @@ /* Populate the portions of the merge context baton that need to be reset for each merge source iteration. */ - merge_cmd_baton.url = url2; + merge_cmd_baton.merge_source = *merge_source; merge_cmd_baton.added_path = NULL; merge_cmd_baton.add_necessitated_merge = FALSE; merge_cmd_baton.dry_run_deletions =