view release on metacpan or search on metacpan
src/subversion/subversion/include/private/svn_mergeinfo_private.h view on Meta::CPAN
svn_mergeinfo_catalog_t catalog,
const char *key_prefix,
const char *val_prefix,
apr_pool_t *pool);
/* Set *YOUNGEST_REV and *OLDEST_REV to the youngest and oldest revisions
found in the rangelists within MERGEINFO. Note that *OLDEST_REV is
exclusive and *YOUNGEST_REV is inclusive. If MERGEINFO is NULL or empty
set *YOUNGEST_REV and *OLDEST_REV to SVN_INVALID_REVNUM. */
svn_error_t *
svn_mergeinfo__get_range_endpoints(svn_revnum_t *youngest_rev,
svn_revnum_t *oldest_rev,
svn_mergeinfo_t mergeinfo,
apr_pool_t *pool);
/* Set *FILTERED_MERGEINFO to a deep copy of MERGEINFO, allocated in
RESULT_POOL, less any revision ranges that fall outside of the range
OLDEST_REV:YOUNGEST_REV (exclusive:inclusive) if INCLUDE_RANGE is true,
or less any ranges within OLDEST_REV:YOUNGEST_REV if INCLUDE_RANGE
is false. If all the rangelists mapped to a given path are filtered
then filter that path as well. If all paths are filtered or MERGEINFO is
src/subversion/subversion/libsvn_client/merge.c view on Meta::CPAN
svn_merge_range_t *r2 =
APR_ARRAY_IDX(child->remaining_ranges, 0,
svn_merge_range_t *);
if (r1 && r2)
{
svn_merge_range_t range1;
svn_merge_range_t range2;
svn_boolean_t reverse_merge = r1->start > r2->end;
/* Flip endpoints if this is a reverse merge. */
if (reverse_merge)
{
range1.start = r1->end;
range1.end = r1->start;
range2.start = r2->end;
range2.end = r2->start;
}
else
{
range1.start = r1->start;
src/subversion/subversion/libsvn_client/merge.c view on Meta::CPAN
PARENT->REMAINING_RANGES must already be populated -- it can be an empty
rangelist but cannot be NULL.
PRIMARY_URL is the merge source url of CHILD at the younger of REVISION1
and REVISION2.
Since this function is only invoked for subtrees of the merge target, the
guarantees afforded by normalize_merge_sources() don't apply - see the
'MERGEINFO MERGE SOURCE NORMALIZATION' comment at the top of this file.
Therefore it is possible that PRIMARY_URL@REVISION1 and
PRIMARY_URL@REVISION2 don't describe the endpoints of an unbroken line of
history. The purpose of this helper is to identify these cases of broken
history and adjust CHILD->REMAINING_RANGES in such a way we don't later try
to describe nonexistent path/revisions to the merge report editor -- see
drive_merge_report_editor().
If PRIMARY_URL@REVISION1 and PRIMARY_URL@REVISION2 describe an unbroken
line of history then do nothing and leave CHILD->REMAINING_RANGES as-is.
If neither PRIMARY_URL@REVISION1 nor PRIMARY_URL@REVISION2 exist then
there is nothing to merge to CHILD->ABSPATH so set CHILD->REMAINING_RANGES
src/subversion/subversion/libsvn_client/merge.c view on Meta::CPAN
FALSE, ctx,
iterpool));
svn_hash_sets(merges, target_abspath, filtered_rangelist);
if (!squelch_mergeinfo_notifications)
{
/* Notify that we are recording mergeinfo describing a merge. */
svn_merge_range_t n_range;
SVN_ERR(svn_mergeinfo__get_range_endpoints(
&n_range.end, &n_range.start, merges, iterpool));
n_range.inheritable = TRUE;
notify_mergeinfo_recording(target_abspath, &n_range,
merge_b->ctx, iterpool);
}
SVN_ERR(update_wc_mergeinfo(result_catalog, target_abspath,
mergeinfo_path, merges, is_rollback,
ctx, iterpool));
}
src/subversion/subversion/libsvn_client/merge.c view on Meta::CPAN
SVN_ERR(svn_mergeinfo_intersect2(
&explicit_source_target_history_intersection,
source_mergeinfo, target_history_as_mergeinfo, TRUE,
scratch_pool, scratch_pool));
if (apr_hash_count(explicit_source_target_history_intersection))
{
svn_revnum_t old_rev, young_rev;
/* Keep track of the youngest revision merged from target to source. */
SVN_ERR(svn_mergeinfo__get_range_endpoints(
&young_rev, &old_rev,
explicit_source_target_history_intersection, scratch_pool));
if (!SVN_IS_VALID_REVNUM(*youngest_merged_rev)
|| (young_rev > *youngest_merged_rev))
*youngest_merged_rev = young_rev;
}
return SVN_NO_ERROR;
}
src/subversion/subversion/libsvn_client/merge.c view on Meta::CPAN
*intersection_p = result;
return SVN_NO_ERROR;
}
/* Set *OLDEST_P and *YOUNGEST_P to the oldest and youngest locations
* (inclusive) along BRANCH. OLDEST_P and/or YOUNGEST_P may be NULL if not
* wanted.
*/
static svn_error_t *
branch_history_get_endpoints(svn_client__pathrev_t **oldest_p,
svn_client__pathrev_t **youngest_p,
const branch_history_t *branch,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
svn_revnum_t youngest_rev, oldest_rev;
SVN_ERR(svn_mergeinfo__get_range_endpoints(
&youngest_rev, &oldest_rev,
branch->history, scratch_pool));
if (oldest_p)
*oldest_p = location_on_branch_at_rev(
branch, oldest_rev + 1, result_pool, scratch_pool);
if (youngest_p)
*youngest_p = location_on_branch_at_rev(
branch, youngest_rev, result_pool, scratch_pool);
return SVN_NO_ERROR;
}
src/subversion/subversion/libsvn_client/merge.c view on Meta::CPAN
else
base_rev = youngest_merged_rev;
/* Find the branch location just before the oldest eligible rev.
(We can't just use the base revs calculated above because the branch
might have a gap there.) */
SVN_ERR(branch_history_intersect_range(&contiguous_source,
source_branch, yca->rev,
base_rev,
scratch_pool, scratch_pool));
SVN_ERR(branch_history_get_endpoints(NULL, base_p, contiguous_source,
result_pool, scratch_pool));
}
return SVN_NO_ERROR;
}
/* Find a merge base location on the target branch, like in a sync
* merge.
*
* BASE S_T->source
src/subversion/subversion/libsvn_client/revisions.c view on Meta::CPAN
if (revision->kind == svn_opt_revision_previous)
(*revnum)--;
}
break;
case svn_opt_revision_date:
/* ### When revision->kind == svn_opt_revision_date, is there an
### optimization such that we can compare
### revision->value->date with the committed-date in the
### entries file (or rather, with some range of which
### committed-date is one endpoint), and sometimes avoid a
### trip over the RA layer? The only optimizations I can
### think of involve examining other entries to build a
### timespan across which committed-revision is known to be
### the head, but it doesn't seem worth it. -kff */
if (! ra_session)
return svn_error_create(SVN_ERR_CLIENT_RA_ACCESS_REQUIRED, NULL, NULL);
SVN_ERR(svn_ra_get_dated_revision(ra_session, revnum,
revision->value.date, scratch_pool));
break;
src/subversion/subversion/libsvn_subr/mergeinfo.c view on Meta::CPAN
*input = last_colon;
return SVN_NO_ERROR;
}
/* Return TRUE iff (svn_merge_range_t *) RANGE describes a valid, forward
* revision range.
*
* Note: The smallest valid value of RANGE->start is 0 because it is an
* exclusive endpoint, being one less than the revision number of the first
* change described by the range, and the oldest possible change is "r1" as
* there cannot be a change "r0". */
#define IS_VALID_FORWARD_RANGE(range) \
(SVN_IS_VALID_REVNUM((range)->start) && ((range)->start < (range)->end))
/* Ways in which two svn_merge_range_t can intersect or adjoin, if at all. */
typedef enum intersection_type_t
{
/* Ranges don't intersect and don't adjoin. */
svn__no_intersection,
src/subversion/subversion/libsvn_subr/mergeinfo.c view on Meta::CPAN
SVN_ERR_ASSERT_NO_RETURN(IS_VALID_FORWARD_RANGE(first));
SVN_ERR_ASSERT_NO_RETURN(IS_VALID_FORWARD_RANGE(second));
return (first->start <= second->start) && (second->end <= first->end)
&& (!consider_inheritance
|| (!(first->inheritable) == !(second->inheritable)));
}
/* Swap start and end fields of RANGE. */
static void
range_swap_endpoints(svn_merge_range_t *range)
{
svn_revnum_t swap = range->start;
range->start = range->end;
range->end = swap;
}
svn_error_t *
svn_rangelist_reverse(svn_rangelist_t *rangelist, apr_pool_t *pool)
{
int i;
svn_sort__array_reverse(rangelist, pool);
for (i = 0; i < rangelist->nelts; i++)
{
range_swap_endpoints(APR_ARRAY_IDX(rangelist, i, svn_merge_range_t *));
}
return SVN_NO_ERROR;
}
void
svn_rangelist__set_inheritance(svn_rangelist_t *rangelist,
svn_boolean_t inheritable)
{
if (rangelist)
src/subversion/subversion/libsvn_subr/mergeinfo.c view on Meta::CPAN
character. */
if (output_buf)
*output = svn_stringbuf__morph_into_string(output_buf);
else
*output = svn_string_create("\n", pool);
return SVN_NO_ERROR;
}
svn_error_t *
svn_mergeinfo__get_range_endpoints(svn_revnum_t *youngest_rev,
svn_revnum_t *oldest_rev,
svn_mergeinfo_t mergeinfo,
apr_pool_t *pool)
{
*youngest_rev = *oldest_rev = SVN_INVALID_REVNUM;
if (mergeinfo)
{
apr_hash_index_t *hi;
for (hi = apr_hash_first(pool, mergeinfo); hi; hi = apr_hash_next(hi))