Author: stsp
Date: Sat Jan 30 16:28:56 2016
New Revision: 1727722
URL: http://svn.apache.org/viewvc?rev=1727722&view=rev
Log:
* subversion/libsvn_client/resolved.c
(svn_client_conflict_tree_resolve_by_id): Add a hack that makes the
'--accept mine-conflict' option work for 2 specific tree conflicts.
In Subversion 1.9 these conflicts could be resolved to 'mine-conflict'
and we should keep allowing this for backwards compatibility, even if
the conflict prompt doesn't offer this option anymore.
Modified:
subversion/trunk/subversion/libsvn_client/resolved.c
Modified: subversion/trunk/subversion/libsvn_client/resolved.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/resolved.c?rev=1727722&r1=1727721&r2=1727722&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/resolved.c (original)
+++ subversion/trunk/subversion/libsvn_client/resolved.c Sat Jan 30 16:28:56
2016
@@ -1251,6 +1251,46 @@ svn_client_conflict_tree_resolve_by_id(
apr_array_header_t *resolution_options;
svn_client_conflict_option_t *option;
+ /* Backwards compatibility hack: Upper layers may still try to resolve
+ * these two tree conflicts as 'mine-conflict' as Subversion 1.9 did.
+ * Fix up if necessary... */
+ if (option_id == svn_client_conflict_option_working_text_where_conflicted)
+ {
+ svn_wc_operation_t operation;
+
+ operation = svn_client_conflict_get_operation(conflict);
+ if (operation == svn_wc_operation_update ||
+ operation == svn_wc_operation_switch)
+ {
+ svn_wc_conflict_reason_t reason;
+
+ reason = svn_client_conflict_get_local_change(conflict);
+ if (reason == svn_wc_conflict_reason_moved_away)
+ {
+ /* Map 'mine-conflict' to 'update move destination'. */
+ option_id = svn_client_conflict_option_update_move_destination;
+ }
+ else if (reason == svn_wc_conflict_reason_deleted ||
+ reason == svn_wc_conflict_reason_replaced)
+ {
+ svn_wc_conflict_action_t action;
+ svn_node_kind_t node_kind;
+
+ action = svn_client_conflict_get_incoming_change(conflict);
+ node_kind =
+ svn_client_conflict_tree_get_victim_node_kind(conflict);
+
+ if (action == svn_wc_conflict_action_edit &&
+ node_kind == svn_node_dir)
+ {
+ /* Map 'mine-conflict' to 'update any moved away children'.
*/
+ option_id =
+ svn_client_conflict_option_update_any_moved_away_children;
+ }
+ }
+ }
+ }
+
SVN_ERR(svn_client_conflict_tree_get_resolution_options(
&resolution_options, conflict,
scratch_pool, scratch_pool));