summaryrefslogtreecommitdiff
path: root/subversion/libsvn_wc/conflicts.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/libsvn_wc/conflicts.c')
-rw-r--r--subversion/libsvn_wc/conflicts.c95
1 files changed, 65 insertions, 30 deletions
diff --git a/subversion/libsvn_wc/conflicts.c b/subversion/libsvn_wc/conflicts.c
index 606710c69f001..b4bc6c05ad6ce 100644
--- a/subversion/libsvn_wc/conflicts.c
+++ b/subversion/libsvn_wc/conflicts.c
@@ -539,6 +539,7 @@ svn_wc__conflict_skel_add_tree_conflict(svn_skel_t *conflict_skel,
svn_wc_conflict_reason_t reason,
svn_wc_conflict_action_t action,
const char *move_src_op_root_abspath,
+ const char *move_dst_op_root_abspath,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -555,18 +556,33 @@ svn_wc__conflict_skel_add_tree_conflict(svn_skel_t *conflict_skel,
tree_conflict = svn_skel__make_empty_list(result_pool);
- if (reason == svn_wc_conflict_reason_moved_away
- && move_src_op_root_abspath)
+ if (reason == svn_wc_conflict_reason_moved_away)
{
- const char *move_src_op_root_relpath;
+ if (move_dst_op_root_abspath)
+ {
+ const char *move_dst_op_root_relpath;
- SVN_ERR(svn_wc__db_to_relpath(&move_src_op_root_relpath,
- db, wri_abspath,
- move_src_op_root_abspath,
- result_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_to_relpath(&move_dst_op_root_relpath,
+ db, wri_abspath,
+ move_dst_op_root_abspath,
+ result_pool, scratch_pool));
- svn_skel__prepend_str(move_src_op_root_relpath, tree_conflict,
- result_pool);
+ svn_skel__prepend_str(move_dst_op_root_relpath, tree_conflict,
+ result_pool);
+ }
+
+ if (move_src_op_root_abspath)
+ {
+ const char *move_src_op_root_relpath;
+
+ SVN_ERR(svn_wc__db_to_relpath(&move_src_op_root_relpath,
+ db, wri_abspath,
+ move_src_op_root_abspath,
+ result_pool, scratch_pool));
+
+ svn_skel__prepend_str(move_src_op_root_relpath, tree_conflict,
+ result_pool);
+ }
}
svn_skel__prepend_str(svn_token__to_word(action_map, action),
@@ -932,6 +948,7 @@ svn_error_t *
svn_wc__conflict_read_tree_conflict(svn_wc_conflict_reason_t *reason,
svn_wc_conflict_action_t *action,
const char **move_src_op_root_abspath,
+ const char **move_dst_op_root_abspath,
svn_wc__db_t *db,
const char *wri_abspath,
const svn_skel_t *conflict_skel,
@@ -981,10 +998,10 @@ svn_wc__conflict_read_tree_conflict(svn_wc_conflict_reason_t *reason,
c = c->next;
- if (move_src_op_root_abspath)
+ if (move_src_op_root_abspath || move_dst_op_root_abspath)
{
/* Only set for update and switch tree conflicts */
- if (c && is_moved_away)
+ if (c && is_moved_away && move_src_op_root_abspath)
{
const char *move_src_op_root_relpath
= apr_pstrmemdup(scratch_pool, c->data, c->len);
@@ -994,8 +1011,25 @@ svn_wc__conflict_read_tree_conflict(svn_wc_conflict_reason_t *reason,
move_src_op_root_relpath,
result_pool, scratch_pool));
}
- else
+ else if (move_src_op_root_abspath)
*move_src_op_root_abspath = NULL;
+
+ if (c)
+ c = c->next;
+
+ if (c && is_moved_away && move_dst_op_root_abspath)
+ {
+ const char *move_dst_op_root_relpath
+ = apr_pstrmemdup(scratch_pool, c->data, c->len);
+
+ SVN_ERR(svn_wc__db_from_relpath(move_dst_op_root_abspath,
+ db, wri_abspath,
+ move_dst_op_root_relpath,
+ result_pool, scratch_pool));
+ }
+ else if (move_dst_op_root_abspath)
+ *move_dst_op_root_abspath = NULL;
+
}
return SVN_NO_ERROR;
@@ -1352,7 +1386,7 @@ generate_propconflict(svn_boolean_t *conflict_remains,
}
case svn_wc_conflict_choose_merged:
{
- if (!cdesc->merged_file
+ if (!cdesc->merged_file
&& (!result->merged_file && !result->merged_value))
return svn_error_create
(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
@@ -1801,7 +1835,7 @@ read_tree_conflict_desc(svn_wc_conflict_description2_t **desc,
svn_wc_conflict_action_t action;
SVN_ERR(svn_wc__conflict_read_tree_conflict(
- &reason, &action, NULL,
+ &reason, &action, NULL, NULL,
db, local_abspath, conflict_skel, scratch_pool, scratch_pool));
if (reason == svn_wc_conflict_reason_missing)
@@ -2347,7 +2381,7 @@ svn_wc__read_conflict_descriptions2_t(const apr_array_header_t **conflicts,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- return svn_wc__read_conflicts(conflicts, NULL, wc_ctx->db, local_abspath,
+ return svn_wc__read_conflicts(conflicts, NULL, wc_ctx->db, local_abspath,
FALSE, FALSE, result_pool, scratch_pool);
}
@@ -2603,7 +2637,7 @@ resolve_prop_conflict_on_node(svn_boolean_t *did_resolve,
return SVN_NO_ERROR;
}
-/*
+/*
* Record a tree conflict resolution failure due to error condition ERR
* in the RESOLVE_LATER hash table. If the hash table is not available
* (meaning the caller does not wish to retry resolution later), or if
@@ -2676,7 +2710,7 @@ resolve_tree_conflict_on_node(svn_boolean_t *did_resolve,
SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action,
&src_op_root_abspath,
- db, local_abspath,
+ NULL, db, local_abspath,
conflicts,
scratch_pool, scratch_pool));
@@ -2748,6 +2782,7 @@ resolve_tree_conflict_on_node(svn_boolean_t *did_resolve,
SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action,
&src_op_root_abspath,
+ NULL,
db, local_abspath,
new_conflicts,
scratch_pool,
@@ -3483,7 +3518,7 @@ svn_wc__conflict_tree_update_break_moved_away(svn_wc_context_t *wc_ctx,
return SVN_NO_ERROR;
SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action,
- &src_op_root_abspath,
+ &src_op_root_abspath, NULL,
wc_ctx->db, local_abspath,
conflict_skel,
scratch_pool, scratch_pool));
@@ -3569,7 +3604,7 @@ svn_wc__conflict_tree_update_raise_moved_away(svn_wc_context_t *wc_ctx,
if (!tree_conflicted)
return SVN_NO_ERROR;
- SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, NULL,
+ SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, NULL, NULL,
wc_ctx->db, local_abspath,
conflict_skel,
scratch_pool, scratch_pool));
@@ -3648,7 +3683,7 @@ svn_wc__conflict_tree_update_moved_away_node(svn_wc_context_t *wc_ctx,
return SVN_NO_ERROR;
SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action,
- &src_op_root_abspath,
+ &src_op_root_abspath, NULL,
wc_ctx->db, local_abspath,
conflict_skel,
scratch_pool, scratch_pool));
@@ -3734,8 +3769,8 @@ svn_wc__conflict_tree_update_incoming_move(svn_wc_context_t *wc_ctx,
return SVN_NO_ERROR;
SVN_ERR(svn_wc__conflict_read_tree_conflict(&local_change, &incoming_change,
- NULL, wc_ctx->db, local_abspath,
- conflict_skel,
+ NULL, NULL, wc_ctx->db,
+ local_abspath, conflict_skel,
scratch_pool, scratch_pool));
/* Make sure the expected conflict is recorded. */
@@ -3803,8 +3838,8 @@ svn_wc__conflict_tree_update_local_add(svn_wc_context_t *wc_ctx,
return SVN_NO_ERROR;
SVN_ERR(svn_wc__conflict_read_tree_conflict(&local_change, &incoming_change,
- NULL, wc_ctx->db, local_abspath,
- conflict_skel,
+ NULL, NULL, wc_ctx->db,
+ local_abspath, conflict_skel,
scratch_pool, scratch_pool));
/* Make sure the expected conflict is recorded. */
@@ -3853,9 +3888,9 @@ svn_wc__guess_incoming_move_target_nodes(apr_array_header_t **possible_targets,
apr_size_t longest_ancestor_len = 0;
*possible_targets = apr_array_make(result_pool, 1, sizeof(const char *));
- SVN_ERR(svn_wc__find_repos_node_in_wc(&candidates, wc_ctx->db, victim_abspath,
- moved_to_repos_relpath,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_find_repos_node_in_wc(&candidates, wc_ctx->db, victim_abspath,
+ moved_to_repos_relpath,
+ scratch_pool, scratch_pool));
/* Find a "useful move target" node in our set of candidates.
* Since there is no way to be certain, filter out nodes which seem
@@ -3903,7 +3938,7 @@ svn_wc__guess_incoming_move_target_nodes(apr_array_header_t **possible_targets,
status != svn_wc__db_status_added)
continue;
- if (node_kind != victim_node_kind)
+ if (victim_node_kind != svn_node_none && node_kind != victim_node_kind)
continue;
SVN_ERR(svn_wc__db_is_switched(&is_wcroot, &is_switched, NULL,
@@ -3930,8 +3965,8 @@ svn_wc__guess_incoming_move_target_nodes(apr_array_header_t **possible_targets,
{
insert_index = (*possible_targets)->nelts; /* append */
}
- svn_sort__array_insert(*possible_targets, &moved_to_abspath,
- insert_index);
+ SVN_ERR(svn_sort__array_insert2(*possible_targets, &moved_to_abspath,
+ insert_index));
}
svn_pool_destroy(iterpool);