Checkout Tools
  • last updated 2 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Revert r1731699, to avoid raising unnecessary text conflicts.

This was discussed and agreed upon in this thread:

https://mail-archives.apache.org/mod_mbox/subversion-dev/201705.mbox/%3C20170509101420.GH55397@ted.stsp.name%3E

Date: Tue, 9 May 2017 12:14:20 +0200

From: Stefan Sperling

To: Subversion development list

Subject: stricter text conflicts in 1.10

Message ID: <20170509101420.GH55397@ted.stsp.name>

  1. … 2 more files in changeset.
[Note from the future: reverted in r1795861.]

Make our 3-way-diff/merge handling raise a conflict in a very specific case

where changes in different ranges that touched each other were applied as

adding both ranges in Subversion while other merge tools create a conflict.

With our current diff output on these conflicts the conflict is much easier

to diagnose and resolve than it was in 2003 when this behavior was first

documented by adding a regression test.

This resolves the problem

Found by: Michal Matyl <Michal.Matyl{_AT_}zf.com>

which is essentially about the controversial behavior discussed in 2003 in

http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=35014

The patch_tests.py change is a good example of the change.

* subversion/libsvn_diff/diff3.c

(svn_diff_diff3_2): Merge adjacent svn_diff__type_diff_modified and

svn_diff__type_diff_latest ranges to a single conflict range.

* subversion/tests/cmdline/patch_tests.py

(patch_merge): Remove XFail marker. Update expected result.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(merge_adjacent_changes): Update expected result.

(three_way_double_add): Tweak expected result.

(test_funcs): Mark three_way_double_add as PASS.

  1. … 2 more files in changeset.
* subversion/tests/libsvn_diff/diff-diff3-test.c

(three_way_double_add): Extend test with related testcase.

Produce 3 way output.

Following up on r1731610, tweak the last line before both changes

to introduce the reported issue.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(three_way_double_add): Tweak last line before one patch, and trigger

this issue. (And remove unused variable).

(test_list): Mark three_way_double_add as XFail.

Add new regression test in working state.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(three_way_double_add): New test.

(test_funcs): Add three_way_double_add.

Add svn_diff_file_output_merge3() with cancel support and update callers.

* subversion/include/svn_diff.h

(svn_diff_file_output_merge3): New function.

(svn_diff_file_output_merge2): Deprecate.

* subversion/libsvn_diff/diff_file.c

(svn_diff_file_output_merge2): Replace with ...

(svn_diff_file_output_merge3): that adds cancel support.

* subversion/libsvn_diff/deprecated.c

(svn_diff_file_output_merge2): New implementation that just uses

svn_diff_file_output_merge3().

* subversion/libsvn_wc/conflicts.h

(svn_wc__mark_resolved_text_conflict): Add cancel support.

* subversion/libsvn_wc/conflicts.c

(merge_showing_conflicts, eval_text_conflict_func_result,

resolve_text_conflict, svn_wc__mark_resolved_text_conflict):

Add cancel support.

(svn_wc__conflict_invoke_resolver): Pass cancel arguments to

resolve_text_conflict() and svn_wc__mark_resolved_text_conflict()

(resolve_text_conflict_on_node): Pass cancel arguments to

merge_showing_conflicts.

* subversion/libsvn_wc/merge.c

(do_text_merge): Add cancel support.

(merge_text_file): Update caller.

* subversion/libsvn_wc/adm_crawler.c

(restore_file): Update call to svn_wc__mark_resolved_text_conflict().

Did not add cancel support here.

* subversion/svn/conflict-callbacks.c

(show_conflicts, merge_prop_conflict, show_prop_conflict,

edit_prop_conflict): Add cancel support.

(handle_text_conflict): Update call to show_conflicts().

(handle_prop_conflict): Update call to show_prop_conflict().

* subversion/tests/libsvn_diff/diff-diff3-test.c

(three_way_merge): Switch to svn_diff_file_output_merge3().

* tools/diff/diff3.c

(do_diff3): Switch to svn_diff_file_output_merge3().

* tools/diff/diff4.c

(do_diff4): Switch to svn_diff_file_output_merge3().

  1. … 10 more files in changeset.
Make the C tests work with the --enable-optimize configure option.

Because the main() function used to be defined in libsvn_test,

the -flto option (which performs rather aggressive link-time

optimizations) would cause the linker to remove all "unreferenced"

static functions ... which includes all the actual tests.

Which this change, main() is now defined in each test driver.

* subversion/tests/svn_test.h

(test_funcs, svn_test_max_threads): Remove external declarations.

(svn_test_main): New prototype for the (existing-but-renamed) test driver.

(SVN_TEST_MAIN): Bolierplate macro that generates a main() implementation.

* subversion/tests/svn_test_main.c

(svn_test_main): Renamed from 'main', and takes two extra parameters,

'max_threads' and 'test_funcs'. Propagates test_funcs to get_array_size,

do_test_num and do_tests_concurrently.

(get_array_size, do_test_num,

test_params_t, test_thread, do_tests_concurrently): Require a test_funcs

parameter. All uses updated.

* subversion/tests/libsvn_client/client-test.c,

subversion/tests/libsvn_client/mtcc-test.c,

subversion/tests/libsvn_delta/random-test.c,

subversion/tests/libsvn_delta/window-test.c,

subversion/tests/libsvn_diff/diff-diff3-test.c,

subversion/tests/libsvn_diff/parse-diff-test.c,

subversion/tests/libsvn_fs/fs-test.c,

subversion/tests/libsvn_fs/locks-test.c,

subversion/tests/libsvn_fs_base/

subversion/tests/libsvn_fs_base/changes-test.c,

subversion/tests/libsvn_fs_base/fs-base-test.c,

subversion/tests/libsvn_fs_base/strings-reps-test.c,

subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c,

subversion/tests/libsvn_fs_x/fs-x-pack-test.c,

subversion/tests/libsvn_fs_x/string-table-test.c,

subversion/tests/libsvn_ra/ra-test.c,

subversion/tests/libsvn_ra_local/ra-local-test.c,

subversion/tests/libsvn_repos/repos-test.c,

subversion/tests/libsvn_subr/auth-test.c,

subversion/tests/libsvn_subr/cache-test.c,

subversion/tests/libsvn_subr/checksum-test.c,

subversion/tests/libsvn_subr/compat-test.c,

subversion/tests/libsvn_subr/config-test.c,

subversion/tests/libsvn_subr/crypto-test.c,

subversion/tests/libsvn_subr/dirent_uri-test.c,

subversion/tests/libsvn_subr/error-code-test.c,

subversion/tests/libsvn_subr/error-test.c,

subversion/tests/libsvn_subr/hashdump-test.c,

subversion/tests/libsvn_subr/io-test.c,

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

subversion/tests/libsvn_subr/named_atomic-test.c,

subversion/tests/libsvn_subr/opt-test.c,

subversion/tests/libsvn_subr/packed-data-test.c,

subversion/tests/libsvn_subr/path-test.c,

subversion/tests/libsvn_subr/prefix-string-test.c,

subversion/tests/libsvn_subr/priority-queue-test.c,

subversion/tests/libsvn_subr/revision-test.c,

subversion/tests/libsvn_subr/root-pools-test.c,

subversion/tests/libsvn_subr/skel-test.c,

subversion/tests/libsvn_subr/spillbuf-test.c,

subversion/tests/libsvn_subr/sqlite-test.c,

subversion/tests/libsvn_subr/stream-test.c,

subversion/tests/libsvn_subr/string-test.c,

subversion/tests/libsvn_subr/subst_translate-test.c,

subversion/tests/libsvn_subr/time-test.c,

subversion/tests/libsvn_subr/translate-test.c,

subversion/tests/libsvn_subr/utf-test.c,

subversion/tests/libsvn_wc/conflict-data-test.c,

subversion/tests/libsvn_wc/db-test.c,

subversion/tests/libsvn_wc/entries-compat.c,

subversion/tests/libsvn_wc/op-depth-test.c,

subversion/tests/libsvn_wc/pristine-store-test.c,

subversion/tests/libsvn_wc/wc-queries-test.c,

subversion/tests/libsvn_wc/wc-test.c:

(max_threads): Renamed from svn_test_max_threads and made static.

(test_funcs): Made static.

(SVN_TEST_MAIN): Expanded boilerplate main() function.

  1. … 54 more files in changeset.
Add "--parallel" option to our C tests.

Besides shaving off a few seconds off our total test execution time,

parallel execution also stresses our code and the tests themselves

harder. It uncovers things like improperly separated working sets

that make post-failure analysis harder.

Parallel mode is only available with APR 1.3+ and threads enabled.

The option will simply be ignored in other configurations. Further

limitations are cleanups being delayed to after all tests completed

and segfaults not being intercepted.

Some tests can't be executed in parallel. Therefore, we introduce

svn_test_max_threads a simple upper limit to the number of threads

supported that each test must define alongside the test_funcs array.

This patch sets it to "1" in many cases because the tests are so

small that multi-threaded execution is simply not worth it.

* build/run_tests.py

(TestHarness._run_c_test): Pass --parallel option to the individual

test applications.

* subversion/tests/svn_test.h

(svn_test_max_threads): Declare new external setting to be set by

every test application.

* subversion/tests/svn_test_main.c

(parallel): New command line option presence flag.

(parallel_opt,

cl_options): Declare the new "--parallel" option.

(svn_test_add_dir_cleanup): Synchronize shared pool access since

this might be called from multiple

threads at the same time.

(log_results): Result logger function factored out from do_test_num

to be shared between serialized and parallel test

execution code.

(do_test_num): Use that new function.

(test_params_t,

test_thread,

do_tests_concurrently): Threads, their parameter and the thread

starter for thread-pooled test execution.

(main): Handle the new option.

Call concurrent execution when in PARALLEL mode.

* subversion/tests/libsvn_delta/random-test.c

subversion/tests/libsvn_subr/named_atomic-test.c

(svn_test_max_threads): These tests don't support concurrent execution.

* subversion/tests/libsvn_delta/random-test.c

subversion/tests/libsvn_delta/window-test.c

subversion/tests/libsvn_diff/parse-diff-test.c

subversion/tests/libsvn_ra_local/ra-local-test.c

subversion/tests/libsvn_ra/ra-test.c

subversion/tests/libsvn_subr/auth-test.c

subversion/tests/libsvn_subr/cache-test.c

subversion/tests/libsvn_subr/checksum-test.c

subversion/tests/libsvn_subr/compat-test.c

subversion/tests/libsvn_subr/config-test.c

subversion/tests/libsvn_subr/crypto-test.c

subversion/tests/libsvn_subr/dirent_uri-test.c

subversion/tests/libsvn_subr/error-code-test.c

subversion/tests/libsvn_subr/error-test.c

subversion/tests/libsvn_subr/hashdump-test.c

subversion/tests/libsvn_subr/mergeinfo-test.c

subversion/tests/libsvn_subr/named_atomic-test.c

subversion/tests/libsvn_subr/opt-test.c

subversion/tests/libsvn_subr/packed-data-test.c

subversion/tests/libsvn_subr/path-test.c

subversion/tests/libsvn_subr/prefix-string-test.c

subversion/tests/libsvn_subr/priority-queue-test.c

subversion/tests/libsvn_subr/revision-test.c

subversion/tests/libsvn_subr/root-pools-test.c

subversion/tests/libsvn_subr/skel-test.c

subversion/tests/libsvn_subr/spillbuf-test.c

subversion/tests/libsvn_subr/sqlite-test.c

subversion/tests/libsvn_subr/stream-test.c

subversion/tests/libsvn_subr/string-test.c

subversion/tests/libsvn_subr/subst_translate-test.c

subversion/tests/libsvn_subr/time-test.c

subversion/tests/libsvn_subr/utf-test.c

subversion/tests/libsvn_wc/conflict-data-test.c

subversion/tests/libsvn_wc/wc-queries-test.c:

(svn_test_max_threads): These are too small to benefit from multi-threading.

* subversion/tests/libsvn_client/client-test.c

subversion/tests/libsvn_diff/diff-diff3-test.c

subversion/tests/libsvn_fs_base/changes-test.c

subversion/tests/libsvn_fs_base/fs-base-test.c

subversion/tests/libsvn_fs_base/strings-reps-test.c

subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c

subversion/tests/libsvn_fs/fs-test.c

subversion/tests/libsvn_fs/locks-test.c

subversion/tests/libsvn_fs_x/fs-x-pack-test.c

subversion/tests/libsvn_fs_x/string-table-test.c

subversion/tests/libsvn_repos/repos-test.c

subversion/tests/libsvn_subr/io-test.c

subversion/tests/libsvn_subr/translate-test.c

subversion/tests/libsvn_wc/db-test.c

subversion/tests/libsvn_wc/op-depth-test.c

subversion/tests/libsvn_wc/wc-test.c

(svn_test_max_threads): Set concurrency limit to whatever various test

runs suggested as the most efficient value.

* subversion/tests/libsvn_wc/entries-compat.c

subversion/tests/libsvn_wc/pristine-store-test.c

(svn_test_max_threads): Set concurrency limit to "unbounded".

  1. … 54 more files in changeset.
Begin converting C tests to use the same transient directory as the Python

tests, so that both can be run off a RAM disk.

* subversion/tests/svn_test.h (svn_test_data_path): New prototype.

* subversion/tests/svn_test_main.c: Include svn_utf.h.

(data_path): New static variable.

(init_test_data): New; initializes the value of data_path.

(svn_test_data_path): Implement.

(main): Call init_test_data and handle any resulting errors.

* subversion/tests/libsvn_client/client-test.c,

subversion/tests/libsvn_delta/random-test.c,

subversion/tests/libsvn_diff/diff-diff3-test.c: Update tests to only

create files in the transient directory.

* subversion/tests/libsvn_client,

subversion/tests/libsvn_diff: Do not ignore names that are no longer

created in the source directory, even for in-tree builds.

  1. … 6 more files in changeset.
* subversion/tests/libsvn_diff/diff-diff3-test.c: Fix typo in test description.

Use fewer, longer, lines in diff-diff3-test 15 to reduce memory and

CPU. I believe only data length is relevant to this test, not the

the number of lines.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(test_token_compare): Change pattern and expectations.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(two_way_diff): Use a subpool to reduce the memory required to

run diff-diff3-test 15.

Additional fix for issue 4339, diff suffix scanning invalid read

at last chunk boundary.

* subversion/libsvn_diff/diff_file.c

(find_identical_suffix): Handle file ending at end of chunk in all cases.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(test_token_compare): Extend.

Patch by: jcorvel

me

  1. … 1 more file in changeset.
Fix issue 4339, diff suffix scanning invalid read at last chunk boundary.

* subversion/libsvn_diff/diff_file.c

(find_identical_suffix): Handle last chunk.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(test_token_compare): Add comments, tweak allocation to match use (which

doesn't change the underlying allocation due to alignment rounding).

  1. … 1 more file in changeset.
Update the expected results of the issue #3362 diff test to match the output

since r1437543.

The original data before this patch was what the memory diff produced before

r1437543, and the test failed because it was different than the file based diff.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(two_way_issue_3362_v1,

two_way_issue_3362_v2): Update expected results to make these tests fail

for the right reason.

(test_funcs): Remove XFAIL marking.

Snapshot some testwork on issue #3362 by adding a second variant of a test

and some disabled helper code.

Variant 2 currently shows different bugs in the file and memory

unified diff output. (The memory code misses the verify first line of the original

and the file code tries to read context from lines that have already been

processed, which the reader doesn't support. The result is a broken index in the

hunk header.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(two_way_diff): Add some disabled helper code.

(test_issue_3362): Duplicate this test in..

(two_way_issue_3362_v1): The original testset.

(two_way_issue_3362_v2): The final variant.

Add a c test for the diff problem described in issue #3362. The current result

is that the in-memory and file diff produce different results for this dataset.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(two_way_diff): Extend error message.

(test_issue_3362): New function.

(test_funcs): Add test_issue_3362 as XFail.

Switch diff-diff3-test.c to using our current io apis instead of the apr ones

that need the binary flag to avoid platform differences.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(make_random_file,

make_file,

three_way_merge,

two_way_diff,

make_random_merge_file,

random_trivial_merge,

random_three_way_merge,

merge_with_part_already_present): Use svn_io_* instead of apr_file_*.

Resolve another issue in the diff code when using full whitespace

normalization.

Patch by: Hideki IWAMOTO <hideki.iwamoto{_AT_}gaia.eonet.ne.jp>

(issue confirmed and patch tweaked by me)

* subversion/libsvn_diff/diff_file.c

(CHUNK_SHIFT): Add a cross-reference to test_token_compare().

(token_compare): Adjust the number of bytes to read to handle whitespace

skipping at the start of the token.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(test_token_compare): New test.

(test_funcs): Add test.

  1. … 1 more file in changeset.
Make sure that the diff suffix scanning optimization works correctly on

chunk boundaries. We accidentally skipped over the suffix start location

when that was a linebreak.

Slightly tweaked version of a

Patch by: Hideki IWAMOTO <h-iwamoto{_AT-}kit.hi-ho.ne.jp>

* subversion/libsvn_diff/diff_file.c

(datasource_get_next_token): When at the end of a chunk, check if the next

chunk should be ignored for the suffix filtering. Add comment where we

actually jump to the next chunk.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(test_identical_suffix): New test.

(test_funcs): Add test.

  1. … 1 more file in changeset.
Fix a whitespace normalization issue in the diff code, identified by Hideki

Iwamoto. This applies patch applies the same fix as applied by steveking in

r876890 on the other whitespace normalization function invocation.

If the normalized offset is set incorrectly, reading back tokens from older

chunks for diff-matching when the hash value of two tokens is identical,

is broken.

This is a slightly reworked version of the

Patch by: Hideki IWAMOTO <h-iwamoto{_AT-}kit.hi-ho.ne.jp>

* subversion/libsvn_diff/diff_file.c

(datasource_get_next_token): Set the normalized offset earlier to allow

updating the offset later by each of the possibly two normalization passes.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(test_wrap): Rename existing test to ...

(test_norm_offset): ... and test the specific issue identified here.

(test_funcs): Update reference and expect the test to pass now.

  1. … 1 more file in changeset.
In two places use the proper enum value instead of a boolean. No functional

change.

* subversion/libsvn_wc/props.c

(prop_conflict_from_skel): Use proper enum value for ignore_space.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(test_wrap): Use an enum value for ignore_space.

  1. … 1 more file in changeset.
* subversion/tests/libsvn_diff/diff-diff3-test.c

(test_wrap): Document the magic number.

Add a regression test for issue #4133, '"diff -x -w" showing wrong change'.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(test_wrap): New test.

(test_list): Run it, XFail.

Reintegrate integrate-string-improvements branch into /trunk.
  1. … 83 more files in changeset.
The semi-annual trailing whitespace cleansing ritual.

* everywhere:

for extsn in c h cpp java py pl rb; do

sed -i -e 's/[ \t]*$//' `find . -name "*.$extsn" | xargs grep '[ \t]$' -l`

done

  1. … 144 more files in changeset.
* subversion/tests/libsvn_diff/diff-diff3-test.c

(random_three_way_merge): Mark it PASS again. Since suffix scanning was

disabled in r1068613 (as a temporary fix), this test should pass.

(random_three_way_merge): Fix the comment about the number of lines that

are used in the test, to match the implementation.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(random_three_way_merge): Mark it WIMP. Bert says it'll silence the bots.

Silence the random XPASSes in the bots.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(random_three_way_merge): s/400/4000/

Tweak a diff3 test for the diff3 truncation issue.

* subversion/tests/libsvn_diff/diff-diff3-test.c

(random_three_way_merge): Use s/100/400/ lines.

(test_funcs): s/PASS/XFAIL/.