[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Valid values of svn_merge_range_t - no change number zero

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Fri, 12 Mar 2010 17:06:10 +0000

BTW this is just a request for comments, not a finished patch.
(mergeinfo_tests.py 2 fails and I have not yet investigated.)

- Julian

I (Julian Foad) wrote:
> Hi Paul.
>
> I think we can tighten the validation of svn_merge_range_t to exclude
> change number "r0" (RANGE->start == -1) as in the following patch.
>
> My reasoning is that a change numbered "r0" is not a valid concept in
> any Subversion system because the state (tree-snapshot) numbered r0 is
> by definition the beginning. (It also happens to be empty by
> definition, but that's not so relevant.) We can say the same in a
> different way: change "r0" would mean the change from "r(-1)" to "r0",
> and "r(-1)" is not a valid concept.
>
> Makes sense?
>
> [[[
> Tighten merge-range validation to not allow "change number r0" aka "revision
> range -1:Y".
>
> * subversion/libsvn_subr/mergeinfo.c
> (IS_VALID_FORWARD_RANGE): New macro.
> (get_type_of_intersection): Use IS_VALID_FORWARD_RANGE() for tighter
> validation of arguments than before: it previously accepted "change 0".
> (range_intersect, range_contains): Validate arguments. Add doc strings.
>
> * subversion/tests/libsvn_subr/mergeinfo-test.c
> (randomly_fill_rev_array, rev_array_to_rangelist): Expand doc strings.
> (test_rangelist_remove_randomly, test_rangelist_intersect_randomly): Don't
> ever include change number r0 in a merge range.
> --This line, and those below, will be ignored--
[...]
Received on 2010-03-12 18:06:56 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.