I'm just trying to follow some existing code. The comment that I'm adding in this pseudo-patch is a stalled attempt to describe the following code block.
/* Helper for do_file_merge and do_directory_merge (by way of
populate_remaining_ranges() for the latter).
Determine what portions of SOURCE have already been merged
to CHILD->ABSPATH and populate CHILD->REMAINING_RANGES with
the ranges that still need merging.
[...] TARGET_MERGEINFO is the working mergeinfo on CHILD.
static svn_error_t *
const merge_source_t *source,
const apr_array_header_t *implicit_src_gap,
const char *mergeinfo_path;
const char *primary_url = (source->loc1->rev < source->loc2->rev)
? source->loc2->url : source->loc1->url;
svn_mergeinfo_t adjusted_target_mergeinfo = NULL;
/* Determine which of the requested ranges to consider merging... */
+ /* [Let's see if we can describe the following if-else block.]
+ Set ADJUSTED_TARGET_MERGEINFO to ... let's see ... in some cases,
+ the portion of CHILD's pre-merge mergeinfo that represents merges
+ from the branch-segment SOURCE. If CHILD has no mergeinfo that
+ refers to SOURCE, this could leave it as NULL or set it to an
+ empty hash. In other cases, set it to TARGET_MERGEINFO -- that is,
+ CHILD's current working mergeinfo, in its entirety.
+ [That doesn't seem too coherent. Maybe we can better describe this
+ code block in terms of preparing for the next step:]
+ We need to pass mergeinfo in to filter_merged_revisions(), which says
+ its TARGET_MERGEINFO input should be "the CHILD->ABSPATH's explicit
+ or inherited mergeinfo [NULL if none, empty if empty]". So ...
+ [But we're calculating something more specific here. The doc string on
+ filter_merged_revisions() doesn't say, but apparent from this code (its
+ only caller) is that it should not always be passed the whole mergeinfo
+ of CHILD.]
/* Consider: CHILD might have explicit mergeinfo '/MERGEINFO_PATH:M-N'
where M-N fall into the gap in SOURCE's natural
history allowed by 'MERGEINFO MERGE SOURCE NORMALIZATION'. If this is
the case, then '/MERGEINFO_PATH:N' actually refers to a completely
different line of history than SOURCE and we
*don't* want to consider those revisions merged already. */
if (implicit_src_gap && child->pre_merge_mergeinfo)
apr_array_header_t *explicit_mergeinfo_gap_ranges =
svn_mergeinfo_t gap_mergeinfo = apr_hash_make(scratch_pool);
apr_hash_set(gap_mergeinfo, mergeinfo_path, APR_HASH_KEY_STRING,
FALSE, result_pool, scratch_pool));
adjusted_target_mergeinfo = target_mergeinfo;
/* Initialize CHILD->REMAINING_RANGES and filter out revisions already
merged (or, in the case of reverse merges, ranges not yet merged). */
SVN_ERR(filter_merged_revisions(parent, child, mergeinfo_path,
ra_session, ctx, result_pool,
Received on 2012-05-01 10:53:42 CEST