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/libsvn_client/conflicts.c (conflict_tree_update_local_moved_away_details): New conflict details struct. (resolve_both_moved_file_update_keep_local_move, 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_merge, 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. (svn_client_conflict_option_get_moved_to_abspath_candidates2, svn_client_conflict_option_set_moved_to_abspath2, conflict_type_specific_setup): Support the newly added conflict options.
* 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, test_update_file_move_vs_file_move_accept_move, test_funcs): New tests which exercise both of the newly added conflict resolution options.
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 svn_client_conflict_option_get_moved_to_abspath_candidates() 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/svn_client.h (svn_client_conflict_option_get_moved_to_abspath_candidates, 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_get_moved_to_abspath_candidates, 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 (STMT_SELECT_PRESENT_HIGHEST_WORKING_NODES_BY_BASENAME_AND_KIND): New query.
* 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/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.