Author: julianfoad
Date: Fri May 18 16:26:25 2012
New Revision: 1340159
URL: http://svn.apache.org/viewvc?rev=1340159&view=rev
Log:
* subversion/libsvn_client/merge.c
(find_gaps_in_merge_source_history): Correct the doc string to state that
'gap_rev1' will be equal to the older revision of the 'source' input,
not greater than it. Add assertions to back up this statement.
Modified:
subversion/trunk/subversion/libsvn_client/merge.c
Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1340159&r1=1340158&r2=1340159&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Fri May 18 16:26:25 2012
@@ -4194,18 +4194,18 @@ calculate_remaining_ranges(svn_client__m
SOURCE is cascaded from the arguments of the same name in
populate_remaining_ranges().
- Note: The following comments assume a forward merge, i.e. SOURCE->rev1
- < SOURCE->rev2. If this is a reverse merge then all the following
- comments still apply, but with SOURCE->url1 switched with SOURCE->url2
- and SOURCE->rev1 switched with SOURCE->rev2.
+ Note: The following comments assume a forward merge, i.e.
+ SOURCE->loc1->rev < SOURCE->loc2->rev. If this is a reverse merge then
+ all the following comments still apply, but with SOURCE->loc1 switched
+ with SOURCE->loc2.
Like populate_remaining_ranges(), SOURCE must adhere to the restrictions
documented in 'MERGEINFO MERGE SOURCE NORMALIZATION'. These restrictions
- allow for a *single* gap, URL@GAP_REV1:URL2@GAP_REV2, (where SOURCE->rev1
- < GAP_REV1 <= GAP_REV2 < SOURCE->rev2) in SOURCE if SOURCE->url2@rev2 was
- copied from SOURCE->url1@rev1. If such a gap exists, set *GAP_START and
- *GAP_END to the starting and ending revisions of the gap. Otherwise set
- both to SVN_INVALID_REVNUM.
+ allow for a *single* gap in SOURCE, GAP_REV1:GAP_REV2 exclusive:inclusive
+ (where SOURCE->loc1->rev == GAP_REV1 <= GAP_REV2 < SOURCE->loc2->rev),
+ if SOURCE->loc2->url@(GAP_REV2+1) was copied from SOURCE->loc1. If such
+ a gap exists, set *GAP_START and *GAP_END to the starting and ending
+ revisions of the gap. Otherwise set both to SVN_INVALID_REVNUM.
For example, if the natural history of URL@2:URL@9 is 'trunk/:2,7-9' this
would indicate that trunk@7 was copied from trunk@2. This function would
@@ -4213,6 +4213,9 @@ calculate_remaining_ranges(svn_client__m
might exist at r3-6, but it would not be on the same line of history as
trunk@9.
+ ### GAP_START is basically redundant, as (if there is a gap at all) it is
+ necessarily the older revision of SOURCE.
+
RA_SESSION is an open RA session to the repository in which SOURCE lives.
*/
static svn_error_t *
@@ -4231,6 +4234,8 @@ find_gaps_in_merge_source_history(svn_re
scratch_pool);
apr_array_header_t *rangelist;
+ SVN_ERR_ASSERT(source->ancestral);
+
/* Start by assuming there is no gap. */
*gap_start = *gap_end = SVN_INVALID_REVNUM;
@@ -4308,6 +4313,9 @@ find_gaps_in_merge_source_history(svn_re
}
}
+ SVN_ERR_ASSERT(*gap_start == MIN(source->loc1->rev, source->loc2->rev)
+ || (*gap_start == SVN_INVALID_REVNUM
+ && *gap_end == SVN_INVALID_REVNUM));
return SVN_NO_ERROR;
}