/[Apache-SVN]
ViewVC logotype

Revision 1836409


Jump to revision: Previous Next
Author: stsp
Date: Sat Jul 21 14:10:16 2018 UTC (5 years, 9 months ago)
Changed paths: 9
Log Message:
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/private/svn_wc_private.h
  (svn_wc__find_working_nodes_with_basename): Declare.

* 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/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.


Changed paths

Path Details
Directorysubversion/trunk/subversion/include/private/svn_wc_private.h modified , text changed
Directorysubversion/trunk/subversion/include/svn_client.h modified , text changed
Directorysubversion/trunk/subversion/libsvn_client/conflicts.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_wc/node.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_wc/wc-queries.sql modified , text changed
Directorysubversion/trunk/subversion/libsvn_wc/wc_db.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_wc/wc_db.h modified , text changed
Directorysubversion/trunk/subversion/svn/conflict-callbacks.c modified , text changed
Directorysubversion/trunk/subversion/tests/libsvn_client/conflicts-test.c modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26