Julian Foad

Merge r1878997, r1879192, r1879474 from trunk.
Create a backport branch.
Remove an unused field in merge code.

There is no code anywhere that sets this flag. There was in svn 1.6, but

not in svn 1.7 and later.

For issue #4859 "Merge removing a folder with non-inheritable mergeinfo ->

E155023: can't set properties: invalid status for updating properties".

* subversion/libsvn_client/mergeinfo.h

(svn_client__merge_path_t): Remove 'scheduled_for_deletion' field.

* subversion/libsvn_client/merge.c

(remove_absent_children): Remove reference to it.

Fix issue #4859 "Merge removing a folder with non-inheritable mergeinfo ->

E155023: can't set properties: invalid status for updating properties".

The code was attempting to set mergeinfo on a path that is being deleted by

the merge. This happened only in certain unusual cases such as when

deleting a folder that had non-inheritable mergeinfo and had children.

This patch fixes the problem by removing the 'children_with_mergeinfo'

entries for sub-paths of a deleted folder.

* subversion/libsvn_client/merge.c

(merge_cmd_baton_t): Allow modifying 'children_with_mergeinfo'.

(record_update_delete): Remove from 'children_with_mergeinfo' all paths

in the subtree.

* subversion/tests/cmdline/merge_tests.py

(merge_deleted_folder_with_mergeinfo): Remove 'XFail'.

(merge_deleted_folder_with_mergeinfo_2): New test.

(test_list): Add the new test.

Add a test for issue #4859: Merge removing a folder with non-inheritable

mergeinfo.

The merge fails like this:

> svn merge -c4 ^/branch_A .../A

> --- Merging r4 into '.../A':

> D .../A/D

> svn: E155023: Can't set properties on '/.../A/D/gamma':

> invalid status for updating properties.

* subversion/tests/cmdline/merge_tests.py

(merge_deleted_folder_with_mergeinfo): New test.

(test_list): Run it.

* publish/docs/release-notes/1.14.html (shelving): Add a reference to

the shelving development review wiki page.

* tools/dist/release.py: Correct & clarify error message reference to --branch option.
Disable the SWIG-PY test for shelving API.

The experimental shelving API is not currently exposed through SWIG,

following r1875037.

* subversion/bindings/swig/python/tests/client.py

(test_shelf): Skip.

Adjust tests following r1875039 (disable shelving by default).
Let shelving be disabled by default.

Set the env. var. 'SVN_EXPERIMENTAL_COMMANDS' to a value that includes

'shelf2' or 'shelf3' to enable shelving v2 or v3 respectively.

* subversion/svn/svn.c

(sub_main): Default to no shelving if the var is not set.

* subversion/svn/svn.c

(add_commands): Add explicit casts to avoid compiler warnings.

Merge the 'decouple-shelving-cli' branch to trunk.

Summary:

Add the shelving v2 implementation from Subversion 1.11, as an alternative

to the shelving v3 implementation from Subversion 1.12.

They have substantially different pros and cons, so it is beneficial for the

user to be able to choose.

Make the shelving CLI version selectable by an environment variable:

env. var. not set => shelving v3 enabled

SVN_EXPERIMENTAL_COMMANDS=shelf3 => shelving v3 enabled

SVN_EXPERIMENTAL_COMMANDS=shelf2 => shelving v2 enabled

SVN_EXPERIMENTAL_COMMANDS= => no shelving CLI

    • ?
    /trunk/subversion/include/private/svn_client_shelf.h
    • ?
    /trunk/subversion/include/private/svn_client_shelf2.h
    • ?
    /trunk/subversion/libsvn_client/shelf2.c
    • ?
    /trunk/subversion/tests/cmdline/shelf2_tests.py
Add the shelving v2 implementation from Subversion 1.11, as an alternative

to the shelving v3 implementation from Subversion 1.12.

They have substantially different pros and cons, so it is beneficial for the

user to be able to choose.

Make the shelving CLI version selectable by an environment variable:

env. var. not set => shelving v3 enabled

SVN_EXPERIMENTAL_COMMANDS=shelf3 => shelving v3 enabled

SVN_EXPERIMENTAL_COMMANDS=shelf2 => shelving v2 enabled

SVN_EXPERIMENTAL_COMMANDS= => no shelving CLI

* subversion/svn/svn.c

Enable shelving v3 or v2 or neither, depending on the environment variable

SVN_EXPERIMENTAL_COMMANDS.

* subversion/include/private/svn_client_shelf2.h

* subversion/libsvn_client/shelf2.c

* subversion/svn/shelf2-cmd.c

* subversion/svn/shelf2-cmd.h

* subversion/tests/cmdline/shelf2_tests.py

New files, with contents copied from svn 1.11, with minor adjustments.

Move the experimental shelving API declarations into a dedicated header

file.

* subversion/include/private/svn_client_shelf.h

New file.

[This file was missed in the previous commit, r1874632.]

Move the experimental shelving API declarations into a dedicated header

file.

A step towards decoupling the experimental shelving CLI from the main CLI.

* subversion/include/private/svn_client_shelf.h

New file.

[This file was missed in this commit, and added in r1874633.]

* subversion/include/svn_client.h,

subversion/include/private/svn_client_private.h

(svn_client__shelf_*): Move into svn_client_shelf.h.

* subversion/libsvn_client/diff.c,

subversion/libsvn_client/shelf.c,

subversion/libsvn_client/status.c

Include the new header.

Initialize the 'svn x-shelf-*' commands programmatically at run time,

instead of hard-coding them in svn's main command table.

A step towards decoupling the experimental shelving CLI from the main CLI.

* subversion/svn/cl.h

(svn_cl__longopt_t,

SVN_CL__LOG_MSG_OPTIONS): Move to here from svn.c.

(svn_cl__shelf_*,

svn_cl__wc_copy_mods): Remove these declarations.

(svn_cl__cmd_table): Change to a pointer.

* subversion/svn/shelf-cmd.c

(svn_cl__shelf_*,

svn_cl__wc_copy_mods): New 'static', no longer external.

(svn_cl__cmd_table_shelf3): New command table, with contents moved to here

from svn_cl__cmd_table.

* subversion/svn/shelf-cmd.h

New.

* subversion/svn/svn.c

(svn_cl__cmd_table_main): Renamed from 'svn_cl__cmd_table'. Move

shelf-related entries to svn_cl__cmd_table_shelf3 in shelf-cmd.c.

(svn_cl__cmd_table): Change to a pointer.

(add_commands): New.

(sub_main): Call add_commands(). Rewrite a check because the shelving

command functions are no longer externally visible.

Make the 'decouple-shelving-cli' branch.
Complete the upgrade of array insert/delete functions.

For issue #4840 "Merge assertion failure in svn_sort__array_insert".

This changes all remaining callers, in other areas of Subversion, to use the

new array insert/delete functions that return standard Subversion errors if

inputs are out of bounds, and removes the old versions of those functions.

These are private functions so the public API is not affected.

* subversion/include/private/svn_sorts_private.h

* subversion/libsvn_subr/sorts.c

(svn_sort__array_insert,

svn_sort__array_delete): Remove.

(svn_sort__array_insert2,

svn_sort__array_delete2): Rewrite as the only version, instead of calling

the old version. No functional change.

Elsewhere: update all callers.

  1. … 4 more files in changeset.
Nominate r1872030 group (issue #4840, merge assertion failure).
Nominate r1872030 group (issue #4840, merge assertion failure).
Follow-up to r1872925:

* subversion/tests/README: Add missing case 'SKIP' to the synopsis.

Fix issue #4840 "Merge assertion failure in svn_sort__array_insert".

This replaces the implementation of svn_rangelist_merge2() with a correct

and simpler one.

* subversion/libsvn_subr/mergeinfo.c

(adjust_remaining_ranges,

rangelist_merge2): Delete.

(rangelist_interval_kind_t,

rangelist_interval_t,

rangelist_interval_iterator_t,

rlii_update,

rlii_next_any_interval,

rlii_first,

rlii_next,

rangelist_builder_t,

rl_builder_new,

rl_builder_flush,

rl_builder_add_interval,

rangelist_merge): New.

(svn_rangelist_merge2): Adjust to call the new implementation.

* subversion/tests/libsvn_subr/mergeinfo-test.c

(test_rangelist_merge_canonical_result,

test_rangelist_merge_array_insert_failure,

test_rangelist_merge_random_canonical_inputs,

test_rangelist_merge_random_semi_c_inputs): Remove XFAIL.

Fix test expectations of an XFAIL test.

For issue #4840 "Merge assertion failure in svn_sort__array_insert".

Restore a debug-mode assertion; perform additional validation in debug

mode only.

A follow-up to r1872118.

For issue #4840 "Merge assertion failure in svn_sort__array_insert".

* subversion/libsvn_subr/mergeinfo.c

(rangelist_merge2): Restore a debug-mode assertion.

(svn_rangelist_merge2): Perform additional validation in debug

mode only.

Fix weak test coverage.

In the tests for "semi-canonical" and "canonical" kinds of inputs to

svn_rangelist_merge2(), the input generator previously called "generate a

random non-validated input" repeatedly until it passed certain quality

tests. That made the result heavily biased towards very simple cases.

As a result, the coverage of the "semi-canonical" and "canonical" tests

missed the failure mode of the original bug report #4840.

This generates "semi-canonical" and "canonical" inputs with a fairer

distribution, increasing their coverage to include that failure mode.

For issue 4840 "Merge assertion failure in svn_sort__array_insert"

* subversion/tests/libsvn_subr/mergeinfo-test.c

(rand_interval_triangular): New.

(rangelist_random_non_validated): Use it.

(int_compare,

ascending_values): New.

(rangelist_random_semi_canonical,

rangelist_random_canonical): Rewrite.

(add_failure_mode): Deduplicate 'Attempted insert at index ...' messages.

Use the variable I declared in r1872921.
Add comments about parameters of random input generation.

For issue #4840 "Merge assertion failure in svn_sort__array_insert".

Report each failure mode only once in random-input tests.

Instead of printing each case that fails, print only the first example of

each failure mode. This makes it easier to manually check that test has

enough coverage. (Programmatic checks for particular coverage could be

added.)

For issue 4840 "Merge assertion failure in svn_sort__array_insert"

* subversion/tests/libsvn_subr/mergeinfo-test.c

(new_response): New.

(test_rangelist_merge_random_canonical_inputs,

test_rangelist_merge_random_semi_c_inputs,

test_rangelist_merge_random_non_validated_inputs): Use it.

New test for issue 4840 "Merge assertion failure in svn_sort__array_insert".

* subversion/tests/libsvn_subr/mergeinfo-test.c

(test_rangelist_merge_array_insert_failure): New test.

(test_funcs): Run it, XFAIL.

Make random-input mergeinfo tests repeatable.

The pseudo-random sequence used in each random-input mergeinfo test is now

repeatable and independent of other tests.

This ensures the test results are repeatable and avoids occasional

unexpected pass of expected-fail tests.

For issue #4840, "Merge assertion failure in svn_sort__array_insert".

* subversion/tests/libsvn_subr/mergeinfo-test.c

(rand_less_than): Use a passed-in state ('seed').

(rangelist_random_non_validated,

rangelist_random_semi_canonical,

rangelist_random_canonical,

mergeinfo_random_non_validated): Pass through the state.

(test_rangelist_merge_random_canonical_inputs,

test_rangelist_merge_random_canonical_inputs,

test_rangelist_merge_random_semi_c_inputs,

test_mergeinfo_merge_random_non_validated_inputs):

Keep random state separately in each test.