Checkout Tools
  • last updated 27 mins 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.
Stop producing 0-line common chunks in certain cases of diff3 processing.

These chunks are currently ignored while processing the chunks, but they

make it harder than necessary to see chunks that touch each other.

The patch avoids some unneeded processing and memory usage.

* subversion/libsvn_diff/diff3.c

(includes): Add svn_sorts.h (for MIN macro).

(svn_diff3_2): Only produce actual diffs.

Whitespace adjustments

* subversion/libsvn_diff/diff3.c

Made first half of file match second half and norm

Speed-up of libsvn_diff using token counts.

By using indices, not node pointers, to refer to tokens, and counting

the number of each token, the longest common subsequence (lcs)

algorithm at the heart of libsvn_diff becomes much faster in many

situations by skipping tokens that are unique to one source or the other.

* subversion/libsvn_diff/token.c

(svn_diff__node_t): Added 'index' member.

(svn_diff__tree_t): Added 'node_count' member.

(svn_diff__get_node_count): New function.

(tree_insert_token): Assigns indices to nodes.

(svn_diff__get_tokens): Uses token_index (svn_diff__token_index_t), not

node pointer, to identify node in position struct.

* subversion/libsvn_diff/lcs.c

(svn_diff__snake): Takes token counts as additional argument.

Skips tokens that are unique to one or the other file.

(svn_diff__lcs): Takes token counts and number of different tokens

as additional arguments. Calculates number of tokens unique to

each source and uses this to compute effective length difference.

* subversion/libsvn_diff/diff.h

(svn_diff__token_index_t): New type for token indices/counts.

(svn_diff__position_t): Replaced node pointer member by a

token_index (svn_diff__token_index_t).

Updated and added new function declarations.

* subversion/libsvn_diff/diff.c

* subversion/libsvn_diff/diff3.c

* subversion/libsvn_diff/diff4.c

(svn_diff_diff_2, svn_diff_diff_3, svn_diff_diff_4): Count the

number of times each token appears in each source.

(svn_diff__resolve_conflict): Takes number of different tokens

as additional argument. Counts the number of times

each token appears in each (partial) source.

(svn_diff__get_token_counts): New function.

Patch by: Morten Kloster <morklo{_AT_}gmail.com>

(some small whitespace fixes and docstring movements by me)

  1. … 5 more files in changeset.
Remove a set of assignments which are not needed.

* subversion/libsvn_diff/diff3.c

(svn_diff__resolve_conflict): We don't need modified_length and latest_length

again, so don't bother restoring them.

Re-enable elimination of the identical suffix for diff (and diff3 (merge) and

diff4), which was disabled in r1068613 because of truncation of suffix lines

during merge.

This time, count the number of suffix lines so we can create an entirely

correct LCS, also containing the common suffix, so diff3 (merge) can do its

work properly.

* subversion/include/svn_diff.h

(svn_diff_fns2_t): Add a new output parameter SUFFIX_LINES to the

datasources_open prototype. The svn_diff_fns2_t struct is new in 1.7 (was

already revved), so we can still do this.

* subversion/libsvn_diff/diff_file.c

(SUFFIX_LINES_TO_KEEP): Add extensive comment to explain its purpose.

(find_identical_suffix): Count the number of suffix lines, and return it in

the new out-parameter SUFFIX_LINES.

(datasources_open): Add new out-parameter SUFFIX_LINES, passing the number

of suffix lines to callers.

* subversion/libsvn_diff/diff_memory.c

(datasources_open): Add new out-parameter SUFFIX_LINES, and set it to 0

just like the PREFIX_LINES (i.e. dummy implementation of prefix/suffix

scanning).

* subversion/libsvn_diff/diff.h

(svn_diff__lcs): Add parameter SUFFIX_LINES.

* subversion/libsvn_diff/lcs.c

(prepend_prefix_lcs): Rename to ...

(prepend_lcs): ... this, and add parameters POS0_OFFSET and POS1_OFFSET, so

it can be used for prepending both the prefix lcs and the suffix lcs.

(svn_diff__lcs): Take the new parameter SUFFIX_LINES, and use it to add

a chunk of suffix lcs to the lcs chain.

* subversion/libsvn_diff/diff.c

(svn_diff_diff_2): Get the SUFFIX_LINES from the call to datasources_open,

and pass it to svn_diff__lcs.

* subversion/libsvn_diff/diff3.c

(svn_diff__resolve_conflict): Pass 0 for SUFFIX_LINES in the call to

svn_diff__lcs, because it's not used here (just like for PREFIX_LINES).

(svn_diff_diff3_2): Get the SUFFIX_LINES from the call to datasources_open,

and pass it to svn_diff__lcs.

* subversion/libsvn_diff/diff4.c

(svn_diff_diff4_2): Get the SUFFIX_LINES from the call to datasources_open,

and pass it to svn_diff__lcs.

  1. … 7 more files in changeset.
Reintegrate diff-optimizations-bytes branch with trunk.

  1. … 12 more files in changeset.
Remove some unused variables identified by gcc.

* subversion/libsvn_ra/compat.c

(svn_ra__file_revs_from_log): Variable ‘last_path’.

* subversion/libsvn_diff/diff3.c (svn_diff_diff3): Variable ‘original_length’.

* subversion/libsvn_subr/utf.c (convert_to_stringbuf): Variable ‘destbuf’.

* subversion/mod_dav_svn/reports/update.c

(dav_svn__update_report): Variable ‘log_depth’.

* subversion/mod_dav_svn/reports/mergeinfo.c

(dav_svn__get_mergeinfo_report): Variable ‘sent_anything’.

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

(test_stream_range): Variable ‘after’.

* subversion/tests/libsvn_subr/string-test.c (test10): Variable ‘len_2’.

* subversion/svn/tree-conflicts.c

(svn_cl__get_human_readable_tree_conflict_description): Variable ‘victim_name’

* subversion/libsvn_fs_base/tree.c (open_path): Variable ‘id’.

* subversion/libsvn_fs_base/lock.c (txn_body_lock): Variable ‘fs_username’.

* subversion/svnadmin/main.c (subcommand_lslocks): Variable ‘fs’.

* subversion/libsvn_wc/props.c (svn_wc__merge_props): Variable ‘working_val’.

* subversion/libsvn_wc/copy.c

(copy_file_administratively): Variable ‘src_exists’.

* subversion/libsvn_wc/wc_db.c

(commit_node): Variables ‘work_presence’ and ‘base_presence’.

* subversion/libsvn_wc/workqueue.c

(log_do_committed): Variable ‘is_file’.

* subversion/libsvn_client/merge.c

(merge_dir_deleted): Variable ‘parent_path’.

(populate_remaining_ranges): Variable ‘equals’.

(drive_merge_report_editor): Variable ‘nearest_parent_is_target’.

(normalize_merge_sources): Variable ‘youngest_opt_rev’.

* subversion/libsvn_client/patch.c (check_dir_empty): Variable ‘revision’.

* subversion/libsvn_ra_serf/update.c (finish_report): Variable ‘props’.

* subversion/libsvn_ra_serf/commit.c

(apply_textdelta): Variables ‘wc_callback_baton’ and ‘wc_callbacks’.

* subversion/libsvn_delta/xdelta.c (compute_delta): Variable ‘hi’.

* subversion/libsvn_fs_fs/tree.c

(open_path): Variable ‘id’.

(merge_changes): Variable ‘source_id’.

(history_prev): Variable ‘node_id’.

  1. … 20 more files in changeset.
Test out my new and fancy ASF commit priviledges by changing the copyright

wording in our license headers to reflect ownership by the ASF.

* NOTICE:

Change terminology to ASF, and update a link.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the ASF, and update the project website.

* everywhere:

Change license text to reflect ASF ownership.

  1. … 891 more files in changeset.
Relicense Subversion under the Apache License, Version 2.0.

* NOTICE: New.

* LICENSE: New.

* COPYING,

subversion/LICENSE: Remove.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the SVN Corp, and that it contains contributions from

many people, as referenced in NOTICE.

* subversion/bindings/swig/python/LICENSE_FOR_PYTHON_BINDINGS:

Relicense the SVN parts under Apache 2.0.

* everywhere:

Change copyright notices in file headers to reflect the Apache 2.0 license.

  1. … 882 more files in changeset.
Set property 'svn:eol-style' consistently to 'native' on C and Python source

files and files that are only for humans to read (README, INSTALL). Most such

files were already set this way; the files changed here had no 'svn:eol-style'.

* subversion/bindings/swig/python/__init__.py

* subversion/bindings/swig/python/svn/core.py

* subversion/libsvn_client/ctx.c

* subversion/libsvn_client/relocate.c

* subversion/libsvn_client/url.c

* subversion/libsvn_delta/cancel.c

* subversion/libsvn_delta/path_driver.c

* subversion/libsvn_diff/diff.h

* subversion/libsvn_diff/diff3.c

* subversion/libsvn_diff/diff4.c

* subversion/libsvn_diff/lcs.c

* subversion/libsvn_diff/token.c

* subversion/libsvn_diff/util.c

* subversion/libsvn_ra_svn/cram.c

* subversion/libsvn_repos/replay.c

* subversion/libsvn_subr/cmdline.c

* subversion/libsvn_subr/config_auth.c

* subversion/libsvn_subr/date.c

* subversion/libsvn_subr/stream.c

* subversion/libsvn_wc/relocate.c

* subversion/mod_authz_svn/INSTALL

* subversion/tests/README

* subversion/tests/clients/cmdline/revert_tests.py

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

* subversion/tests/libsvn_vcdiff/README

* subversion/tests/libsvn_wc/translate-test.c

* subversion/tests/python-libs/exectest.py

* subversion/tests/svn_test_editor.c

* subversion/tests/svn_tests_main.c

Set property 'svn:eol-style' to 'native'.

  1. … 28 more files in changeset.
Update copyright notices for 2004, resolving issue #1651.

(See also revision 8019, which fixed a couple of missed spots.)

  1. … 361 more files in changeset.
* subversion/libsvn_diff/diff3.c

(svn_diff__resolve_conflict): added missing initialization of

resolved_diff member in newly created svn_diff_t's.

Patch by: Martin Hauner <hauner@web.de>

Split the diff library in logical chunks. First pass at cleaning up the API.

Update all callers.

* subversion/include/svn_diff.h

Remove all spaces before the opening paren to gain consistency.

(svn_diff_diff): Renamed from svn_diff.

(svn_diff_diff3): Renamed from svn_diff3.

(svn_diff_diff4): Renamed from svn_diff4.

(svn_diff_file_diff): Renamed from svn_diff_file.

(svn_diff_file_diff3): Renamed from svn_diff3_file.

(svn_diff_file_diff4): Renamed from svn_diff4_file.

(svn_diff_file_output_merge): Renamed from svn_diff3_file_output.

* subversion/libsvn_diff/token.c

New file to contain all token tree helper functions.

(svn_diff__tree_create, svn_diff__tree_insert_token, svn_diff__get_tokens):

Moved from subversion/libsvn_diff/diff.c.

* subversion/libsvn_diff/lcs.c

New file to contain the LCS implementation, which is the core of the

entire library.

(svn_diff__snake, svn_diff__lcs_reverse, svn_diff__lcs):

Moved from subversion/libsvn_diff/diff.c.

* subversion/libsvn_diff/diff_file.c

Update all calls to the renamed functions.

(svn_diff_file_diff): Renamed from svn_diff_file.

(svn_diff_file_diff3): Renamed from svn_diff3_file.

(svn_diff_file_diff4): Renamed from svn_diff4_file.

(svn_diff_file_output_merge): Renamed from svn_diff3_file_output.

* subversion/libsvn_diff/diff.c

(svn_diff__tree_create, svn_diff__tree_insert_token, svn_diff__get_tokens):

Moved to subversion/libsvn_diff/token.c.

(svn_diff__snake, svn_diff__lcs_reverse, svn_diff__lcs):

Moved to subversion/libsvn_diff/lcs.c.

(svn_diff__diff): Export.

(svn_diff_diff): Renamed from svn_diff.

(svn_diff__resolve_conflict, svn_diff3):

Moved to subversion/libsvn_diff/diff3.c.

(svn_diff__adjust_hunk, svn_diff__adjust, svn_diff4):

Moved to subversion/libsvn_diff/diff4.c.

(svn_diff_contains_conflicts, svn_diff_contains_diffs, svn_diff_output):

Moved to subversion/libsvn_diff/util.c.

* subversion/libsvn_diff/libsvn_diff.dsp

Add lcs.c, token.c, util.c, diff3.c, diff4.c and diff.h.

* subversion/libsvn_diff/diff3.c

(svn_diff__resolve_conflict): Moved from subversion/libsvn_diff/diff.c.

(svn_diff_diff3): Same. Renamed from svn_diff3.

* subversion/libsvn_diff/diff4.c

(svn_diff__adjust_hunk, svn_diff__adjust):

Moved from subversion/libsvn_diff/diff.c.

(svn_diff_diff4): Same. Renamed from svn_diff4.

* subversion/libsvn_diff/diff.h

New private header file that declares all structs and functions needed

internally by the diff library.

* subversion/libsvn_diff/util.c

New file to contain all (public) utility functions.

(svn_diff_contains_conflicts, svn_diff_contains_diffs, svn_diff_output):

Moved from subversion/libsvn_diff/diff.c.

* subversion/libsvn_wc/merge.c

(svn_wc_merge): Update calls to svn_diff_file_diff3 and

svn_diff_output_merge.

* subversion/libsvn_client/diff.c

(diff_file_changed): Update calls to svn_diff_file_diff.

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

(three_way_merge): Update calls to svn_diff_file_diff3 and

svn_diff_file_output_merge.

(two_way_diff): Update calls to svn_diff_file_diff.

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

(do_diff): Update calls to svn_diff_file_diff.

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

(do_diff3): Update calls to svn_diff_file_diff3 and

svn_diff_file_output_merge.

* subversion/tests/libsvn_diff/diff4-test.c

(do_diff4): Update calls to svn_diff_file_diff4 and

svn_diff_file_output_merge.

  1. … 15 more files in changeset.