Checkout Tools
  • last updated 3 hours ago
Constraints: committers
Constraints: files
Constraints: dates
Add resolver support for moved-file vs moved-file upon update.

The resolver now supports move vs move tree conflicts for files after

an update operation.

Two new resolution operations are available:

(m) - override incoming move and merge incoming changes from 'alpha-moved'

to 'alpha-also-moved'

(M) - accept incoming move and merge local changes from 'alpha-also-moved'

to 'alpha-moved'

Where the file was originally called 'alpha', was renamed to 'alpha-moved'

in the repository, and renamed to 'alpha-also-moved' in the working copy.

Because the local move is broken during the update operation when the

delete-half of the move is updated, the resolver only has the copied half

move available in the working copy. To find the local move destination the

resolver queries the working copy database for nodes which are copies of

the conflict victim's repository path. This can of course lead to ambiguous

results in case a node is first copied and then moved, in which case the

resolver offers the user a choice of local move targets in the usual way.

* subversion/include/private/svn_wc_private.h

(svn_wc__find_copies_of_repos_path): Declare.

* subversion/libsvn_client/conflicts.c

(conflict_tree_update_local_moved_away_details): New conflict details struct.


resolve_both_moved_file_update_keep_incoming_move): New resolution handlers.

(conflict_tree_get_details_update_local_moved_away): New details fetcher

which locates copied nodes corresponding to the local move.

(get_both_moved_file_paths): New helper function.


conflict_tree_get_description_update_both_moved_file_move_merge): New

functions which describe incoming move vs local move conflicts flagged

during updates of files.

(configure_option_both_moved_file_merge): Hook up the new options.



conflict_type_specific_setup): Support the newly added conflict options.

* subversion/libsvn_wc/node.c

(svn_wc__find_copies_of_repos_path): New.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_COPIES_OF_REPOS_RELPATH): New query which locates copies of a

particular repository relpath with a particular node kind in working copy.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_find_copies_of_repos_path): New wc_db API to execute above query.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_find_copies_of_repos_path): Declare.

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

(create_file_move_vs_file_move_update_conflict): New helper function.


test_update_file_move_vs_file_move_accept_move, test_funcs): New tests

which exercise both of the newly added conflict resolution options.

  1. … 6 more files in changeset.
Add two resolver options for 'dir move vs dir move upon merge' conflicts.

These new options work similar to their existing counterparts for files.

* subversion/include/svn_client.h


svn_client_conflict_option_both_moved_dir_move_merge): Declare.

* subversion/libsvn_client/conflicts.c


resolve_both_moved_dir_move_merge): New resolution option handlers.


configure_option_both_moved_dir_merge): Enable new options on applicable

tree conflicts.




svn_client_conflict_option_set_moved_to_abspath2): Handle new options.

* subversion/svn/conflict-callbacks.c

(builtin_resolver_options): Assign resolver menu keys to the new options.

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


test_merge_dir_move_vs_dir_move_accept_move, test_funcs): Add new tests.

(create_dir_move_vs_dir_move_merge_conflict): New helper for above tests.

  1. … 3 more files in changeset.
Add two additional resolver tests for file move vs file move upon merge.

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

(create_file_move_vs_file_move_merge_conflict): Support editing the file

on the branch.


test_merge_file_move_vs_file_move_accept_move): Update callers.


test_merge_file_edit_move_vs_file_move_accept_move): New tests.

These are like the other 2 but also edit the moved file on the branch.

(test_funcs): Add new tests.

Add two new resolver tests for file move vs file move upon merge.

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



test_merge_file_move_vs_file_move_accept_move): New tests for resolver

options svn_client_conflict_option_both_moved_file_move_merge and

svn_client_conflict_option_both_moved_file_merge. These tests only

move files, but don't edit them.

(test_funcs): Add new tests.

Follow-up to r1846851: Fix test expectations.

I missed a failing test which didn't expect to see an 'ignore deletion'

option, which is now made available due to a minor change in r1846851.

* subversion/iibsvn_client/conflicts-test.c

(test_merge_incoming_delete_vs_local_delete): Expect the 'ignore deletion'

option to show up. The new logic to toggle this option since r1846851

may need more consideration, but providing the option isn't harmful

so make this test expect it for now.

Add resolver support for unversioned directories during update/switch.

The resolver now offers the 'merge directories' option when it encounters

a conflict for an incoming added directory vs an unversioned directory

after an update or switch.

* subversion/libsvn_client/conflicts.c

(resolve_update_incoming_added_dir_merge): Add support for unversioned

directories. Resolution is implemented as a meta-data only revert.

(configure_option_incoming_added_dir_merge): Enable this option for

added vs. unversioned directories during update/switch.

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

(create_unversioned_dir, resolve_added_dir_vs_unversioned_dir): New helpers.


test_switch_dir_add_vs_unversioned_dir, test_funcs): Add new tests.

  1. … 1 more file in changeset.
Add resolver support for 'added file vs unversioned file' with update/switch.

Make the conflict resolver handle conflicts recorded during update and switch

operations where a newly added file was obstructed by an unversioned file.

The resolver will now offer the 'incoming_added_file_text_merge' option

in this case, allowing users to merge unversioned files with incoming

newly added files.

Because 'merge' currently skips unversioned files and does not even record

a conflict for them, this change only affects 'update' and 'switch'.

Supporting unversioned file conflicts during merges can be revisited later.

Suggested by: Ace Olszowka

* subversion/libsvn_client/conflicts.c

(resolve_merge_incoming_added_file_text_update): Handle unversioned files

in addition to versioned files.

(configure_option_incoming_added_file_text_merge): Enable this option

for the case where the local file is unversioned.

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

(new_file_content): Declare.


test_switch_file_add_vs_unversiond_file, test_funcs): New tests.

  1. … 1 more file in changeset.
Fix wrong paths in comments in resolver tests.

Found by: jcorvel

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

(test_local_missing_abiguous_moves_dir): Fix up references to "A/mu" which

isn't used by this test; it uses "A/B" instead.

Fix an assertion failure in the conflict resolver.

* subversion/libsvn_client/conflicts.c

(conflict_tree_get_details_local_missing): We do not yet support the case

where the parent directory of the conflict victim is not part of the

repository-side tree which is checked out. Do not try to figure out

conflict details in this case yet.

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

(test_file_vs_dir_move_merge_assertion_failure): Remove code under #if 0

which I committed by accident in r1841753. Align test expectations with

the current behaviour of the conflict resolver.

(test_funcs): Mark test_file_vs_dir_move_merge_assertion_failure as PASS.

  1. … 1 more file in changeset.
Add an XFAIL resolver test which triggers an assertion failure.

This new test triggers an infamous assertion failure which has

already been reported several times:

svn_tests: E235000: In file 'subversion/libsvn_client/conflicts.c' \

line 2242: assertion failed (start_rev > end_rev)

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

(test_file_vs_dir_move_merge_assertion_failure, test_funcs): New XFAIL test.

Add resolver support for 'local missing' conflicts involving directories.

* subversion/libsvn_client/conflicts.c

(conflict_tree_get_details_local_missing): Don't hard-code svn_node_file.

Recommend an option for local missing merge targets in case there is

no ambiguity.

(resolve_sibling_move_dir_merge): Rename to...

(resolve_local_move_dir_merge): ... this, and support both local moves

(i.e. moves in the history of the merge target) and sibling moves (i.e.

moves in the history of the merge source).

(configure_option_local_move_file_merge): Rename to...

(configure_option_local_move_file_or_dir_merge): ... this, and add support

for directories.


configure_option_local_move_file_or_dir_merge): Track renamed functions.

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

(test_local_missing_abiguous_moves_dir): Fix an error in a path probed

by this test.

(test_funcs): Mark test_local_missing_abiguous_moves_dir as PASS.

  1. … 1 more file in changeset.
Add a new XFAIL conflict resolver test.

This is a basic test for 'local missing' conflicts with directories.

It might need to be tweaked further once the resolver starts supporting

this use case.

* subversion/libsvn_client/conflicts-test.c

(test_local_missing_abiguous_moves_dir, test_funcs): New test.

Implement support for ambiguous moves for 'local missing' conflicts.

* subversion/libsvn_client/conflicts.c

(conflict_tree_local_missing_details): Replace the single 'moved_to_abspath'

with appropriate data structures for supporting ambiguous moves: A map

of repository-side move targets and corresponding working copy paths.

The new data structures are similar to those used for 'incoming delete'

style conflicts.

(follow_move_chains): Move upwards in the file so it can be used earlier.

(conflict_tree_get_details_local_missing): Initialize the new map of

repository-side move targets. Again, this is similar to what the

corresponding 'get details' function for 'incoming delete' conflicts does.

(resolve_local_move_file_merge): Replace use of 'merge_target_abspath' with

use of the new move target map.

(configure_option_local_move_file_merge): Stop initializing move information

in conflict details here. This is now done earlier, when the details are

actually fetched from the repository. Doing this here is the wrong place

for the task, since we would clobber move target selections the user may

have already made. And again, the 'incoming delete' case works similar to

this new implementation for 'local missing'.

(get_repos_relpath_candidates): New helper function factored out from...


Support selection of repository move targets with the new 'local missing'

details data structures.

(svn_client_conflict_option_set_moved_to_repos_relpath: Add support for

'local missing' conflicts to this function.

(set_wc_move_target): New helper function, factored out from...


Support the new move data structures used for 'local missing' conflicts.

* subversion/svn/conflict-callbacks.c

(build_tree_conflict_options): Obtain the list of working copy move targets

for 'local missing' options as well as 'incoming delete' style options.

(handle_tree_conflict): Allow choosing ambiguous move targets for

'local missing' style options.

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

(test_local_missing_abiguous_moves, test_funcs): New test.

  1. … 2 more files in changeset.
* subversion/tests/libsvn_client/conflicts-test.c

(test_cherry_pick_post_move_edit): Remove unneeded C++ comment.

Fix expected testresult of conflicts test that hits eol-style

differences on Windows.

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

(test_cherry_pick_post_move_edit): Use strict "\n" in quite a few

places to unbreak test.

Extend an existing conflict resolver test.

* subversion/trunk/tests/libsvn_client/conflicts-test.c

(test_merge_incoming_edit_file_moved_away): Verify the result of


Introduce separate conflict option IDs for sibling move cases.

New option IDs had been avoided to make backporting to 1.10 easier.

Since the outstanding backport proposal was retracted in r1839283

it is time to use proper designations to make things less confusing.

* subversion/include/svn_client.h


svn_client_conflict_option_sibling_move_dir_merge): Declare.

* subversion/libsvn_client/conflicts.c


configure_option_sibling_move_merge): Use new options for

sibling move cases instead of overloading the 'local move' IDs.

A 'local move' is a different case.

(init_wc_move_targets): Add sibling move options.

(resolve_local_move_file_merge): Update docstring.


svn_client_conflict_option_set_moved_to_abspath): Add sibling move options.

* subversion/svn/conflict-callbacks.c

(builtin_resolver_options): Assign menu key "m" to sibling move options.

(build_tree_conflict_options, handle_tree_conflict); Support sibling

move options.

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

(test_cherry_pick_post_move_edit, test_cherry_pick_post_move_edit_dir):

Update test expectations.

  1. … 3 more files in changeset.
For issue #4694, handle cherry-picking across moved directories.

Also, refactor conflict option configuration a bit to clearly

separate local-move options from sibling-move options.

The names of options relating to sibling-moves are still not

ideal but that can be fixed later.

* subversion/libsvn_client/conflicts.c

(conflict_tree_get_details_local_missing): Recommend the

svn_client_conflict_option_local_move_dir_merge option.

(init_wc_move_targets): Handle the

svn_client_conflict_option_local_move_dir_merge option.

(resolve_sibling_move_dir_merge): Implement resolution of

(configure_option_local_move_file_merge): Move sibling-move

releted options out of here.

(configure_option_sibling_move_merge): New helper function

which configures resolution options for sibling move cases,

for both files and directories.


Support svn_client_conflict_option_local_move_dir_merge.

(svn_client_conflict_tree_get_resolution_options): Call the

new configure_option_sibling_move_merge helper function.

* subversion/svn/conflict-callbacks.c

(builtin_resolver_options): Add the new option

svn_client_conflict_option_local_move_dir_merge to list

of known built-in resolver options.

(build_tree_conflict_options): Get abspath candidates

for svn_client_conflict_option_local_move_dir_merge option.

(handle_tree_conflict): Perform ambiguous merge target selection

for svn_client_conflict_option_local_move_dir_merge.

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

(test_funcs): test_cherry_pick_post_move_edit_dir is now passing.

  1. … 2 more files in changeset.
Fix expectations of an XFAIL conflict resolver test.

* subversion/test/libsvn_client/conflicts-test.c

(test_cherry_pick_post_move_edit_dir): Fix errors in paths used by

post-resolution checks.

Add an XFAIL resolver test for cherry-picking directory edits.

Add an XFAIL test which attempts to cherry-pick across a moved directory.

Incidentally, this test also covers the assertion failure fixed in r1836976.

* subversion/include/svn_client.h

(svn_client_conflict_option_local_move_dir_merge): New option ID.

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

(test_cherry_pick_post_move_edit_dir, test_list): New XFAIL test.

  1. … 1 more file in changeset.
Fix issue #4766, "resolver adds unrelated moves to move target list"

* subversion/libsvn_client/conflicts.c

(find_operative_moves): Fix the logic which detects operative nested moves

to keep a couple of unrelated conflict resolver tests passing; some tests

were only passing because this code added *every* move found in the deleted

revision. Add only operative moves to the list to fix issue #4766.

Note to reviewers: See notes/resolve-moves for definition of "nested move".

(reparent_session_and_fetch_node_kind): Remove, now unused.

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

(test_funcs): Issue #4766 test is now passing.

  1. … 1 more file in changeset.
add an XFAIL test for issue #4766 (resolver adds unrelated moves)

* subversion/libsvn_client/conflicts-test.c

(new_file2_name): New constant.

(create_wc_with_incoming_delete_file_merge_conflict): Optionally create

an unrelated move within the same commit of the existing move.

This triggers issue #4766.




test_switch_incoming_move_file_text_merge): Update callers.

(test_merge_incoming_delete_file_unrelated_move, test_funcs): New test.

Fix issue #4694 "cherry-pick edit after file was moved on source branch"

Add conflict resolver support for cherry-picking changes from files which

have been moved on the merge source branch. Support multiple merge target

candidates, and run a file merge by default if only one candidate exists.

This implementation extends the existing "local move file text merge"

resolution option with support for 'move siblings' as merge targets.

I am still considering whether this case conceptually deserves a dedicated

resolution option. However, it would be nice to backport this feature to

SVN 1.10. The only API change required by this implementation is allowing

another 'option' parameter value for the existing API functions


and svn_client_conflict_option_set_moved_to_abspath(). This change is

ABI compatible, with the only caveat that a new 'svn' binary running

on top of an older libsvn_client could trigger an input assertion.

Because we require 'svn' to be kept in sync with the libraries this

should not be a problem in practice.

We can still improve the API for >= 1.11 later.

* subversion/include/private/svn_wc_private.h

(svn_wc__find_working_nodes_with_basename): Declare.

* subversion/include/svn_client.h


svn_client_conflict_option_set_moved_to_abspath): Document that

svn_client_conflict_option_local_move_file_text_merge is now

a valid option parameter for these functions.

* subversion/libsvn_client/conflicts.c

(conflict_tree_local_missing_details): Add and document wc_siblings

and preferred_sibling_idx fields.

(collect_sibling_move_candidates): New helper function.

(conflict_tree_get_details_local_missing): Try to find the 'local missing'

node which corresponds to the conflict victim in the working copy.

Technically, this would require scanning the log for every item in the WC.

However, assuming a cherry-pick from a moved file to a non-moved file, we

can use a short-cut: The basename of the non-moved file is already known

because it must match one of the locations which the moved file was moved

from. So we can restrict tracing of log history to nodes with a basename

which occurs in the chain of file moves on the merge source branch.

(resolve_local_move_file_merge, configure_option_local_move_file_merge):

Add support for merging to WC siblings of conflict victims which are

'locally missing'.


svn_client_conflict_option_set_moved_to_abspath): Add support for the

svn_client_conflict_option_local_move_file_text_merge resolution option.

* subversion/libsvn_wc/node.c

(svn_wc__find_working_nodes_with_basename): New private API function which

simply forwards to wc_db.

* subversion/libsvn_wc/wc-queries.sql


* subversion/libsvn_wc/wc_db.c

(svn_wc__db_find_working_nodes_with_basename): New wc_db API function which

finds present working nodes with a given basename.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_find_working_nodes_with_basename): Declare.

* subversion/svn/conflict-callbacks.c

(build_tree_conflict_options, handle_tree_conflict): Support multiple merge target

candidates with the svn_client_conflict_option_local_move_file_text_merge option.

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

(test_funcs): Mark test_cherry_pick_post_move_edit as PASS.

  1. … 8 more files in changeset.
Fix wrong expectations of an XFAIL conflict resolver test.

* subversion/tests/libsvn_client/conflict-tests.c

(test_cherry_pick_post_move_edit): The cherry-pick merge as run by this

test results in a text conflict. Update test expectations accordingly.

Fix issue #4744, "assertion failed (start_rev > end_rev)".

Do not attempt to fetch conflict details in the conflict scenario described

in issue #4744, where merge-left and merge-right URLs differ and their peg

revisions are the same. The 'merge directories' resolution option does not

handle this case yet (and is no longer offered in this case since r1833897).

However, the 'replace + merge' option works as expected.

For now this is good enough, and certainly better than an assertion failure.

Making the 'merge directories' option work is left for future work.

* subversion/libsvn_client/conflicts.c

(conflict_tree_get_details_incoming_add): Don't return details in case

merge-left/right URLs do not match and/or old_rev == new_rev.

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

(test_merge_two_added_dirs_assertion_failure): Resolve by replace + merge

and update test expectations accordingly.

  1. … 1 more file in changeset.
Follow-up to r1833897:

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

(create_wc_with_dir_add_vs_dir_add_merge_conflict): Update test

expections here as well.

In case of a merge operation, the 'merge added directories' resolution

option requires tree conflict details. Do not offer this option unless

details have been fetched.

Otherwise, the user will see an error when choosing the option:

svn: warning: W155027: Conflict resolution option '14' requires details for tree conflict at 'PATH' to be fetched from the repository

* subversion/libsvn_client/conflicts.c

(configure_option_incoming_added_dir_merge): Do not add the option in case

this is a merge operation and details are not yet available.

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

(test_merge_two_added_dirs_assertion_failure): Update test expections,

and while here remove a redundant entry from an expected options list.

  1. … 1 more file in changeset.
Add a test for issue #4744, "assertion failed (start_rev > end_rev)"

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


test_merge_two_added_dirs_assertion_failure): New test which triggers the

assertion failure.

(test_funcs): Add new test (currently XFAIL).

Fix issue #4739, "Accept incoming deletion option doing nothing for

a locally deleted file"

The consistency check for copied state applies only to "local edit vs

incoming delete" conflicts. Only run the check in that particular case.

* subversion/libsvn_client/conflicts.c

(ensure_local_edit_vs_incoming_deletion_copied_state): New helper function,

extraced from the function below for better readibility.

(verify_local_state_for_incoming_delete): Only check the local copied state

if the local change involved in the conflict was an edit.

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

(test_funcs): test_update_incoming_delete_locally_deleted_file now passes.

  1. … 1 more file in changeset.
Add failing test for issue #4739, "Accept incoming deletion" option doing

nothing for a locally deleted file in the tree conflict resolver.

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

(test_update_incoming_delete_locally_deleted_file): New.

(test_funcs): Run new test.