2024
2028
svn_boolean_t has_local_mods;
2025
2029
enum svn_wc_merge_outcome_t content_outcome;
2030
const char *target_label;
2031
const char *left_label;
2032
const char *right_label;
2033
const char *path_ext = "";
2035
if (merge_b->ext_patterns && merge_b->ext_patterns->nelts)
2037
svn_path_splitext(NULL, &path_ext, local_abspath, scratch_pool);
2039
&& svn_cstring_match_glob_list(path_ext,
2040
merge_b->ext_patterns)))
2027
2046
/* xgettext: the '.working', '.merge-left.r%ld' and
2028
2047
'.merge-right.r%ld' strings are used to tag onto a file
2029
2048
name in case of a merge conflict */
2030
const char *target_label = _(".working");
2031
const char *left_label = apr_psprintf(scratch_pool,
2032
_(".merge-left.r%ld"),
2033
left_source->revision);
2034
const char *right_label = apr_psprintf(scratch_pool,
2035
_(".merge-right.r%ld"),
2036
right_source->revision);
2050
target_label = apr_psprintf(scratch_pool, _(".working%s%s"),
2051
*path_ext ? "." : "", path_ext);
2052
left_label = apr_psprintf(scratch_pool,
2053
_(".merge-left.r%ld%s%s"),
2054
left_source->revision,
2055
*path_ext ? "." : "", path_ext);
2056
right_label = apr_psprintf(scratch_pool,
2057
_(".merge-right.r%ld%s%s"),
2058
right_source->revision,
2059
*path_ext ? "." : "", path_ext);
2038
2061
SVN_ERR(svn_wc_text_modified_p2(&has_local_mods, ctx->wc_ctx,
2039
2062
local_abspath, FALSE, scratch_pool));
3093
3115
scratch_pool, scratch_pool));
3095
3117
if (merge_b->force_delete)
3119
/* In this legacy mode we just assume that a directory delete
3120
matches any directory. db->delete_state is NULL */
3125
struct dir_delete_baton_t *delb;
3099
3127
/* Compare the properties */
3100
3128
SVN_ERR(properties_same_p(&same, left_props, working_props,
3101
3129
scratch_pool));
3104
delb = db->delete_state;
3105
assert(delb != NULL);
3109
delb->found_edit = TRUE;
3113
store_path(delb->compared_abspaths, local_abspath);
3116
if (delb->del_root != db)
3117
return SVN_NO_ERROR;
3119
if (delb->found_edit)
3121
else if (merge_b->force_delete)
3125
apr_array_header_t *ignores;
3129
SVN_ERR(svn_wc_get_default_ignores(&ignores, merge_b->ctx->config,
3132
/* None of the descendants was modified, but maybe there are
3133
descendants we haven't walked?
3135
Note that we aren't interested in changes, as we already verified
3136
changes in the paths touched by the merge. And the existance of
3137
other paths is enough to mark the directory edited */
3138
err = svn_wc_walk_status(merge_b->ctx->wc_ctx, local_abspath,
3139
svn_depth_infinity, TRUE /* get-all */,
3140
FALSE /* no-ignore */,
3141
TRUE /* ignore-text-mods */, ignores,
3142
verify_touched_by_del_check, delb,
3143
merge_b->ctx->cancel_func,
3144
merge_b->ctx->cancel_baton,
3149
if (err->apr_err != SVN_ERR_CEASE_INVOCATION)
3150
return svn_error_trace(err);
3152
svn_error_clear(err);
3155
same = ! delb->found_edit;
3130
delb = db->delete_state;
3131
assert(delb != NULL);
3135
delb->found_edit = TRUE;
3139
store_path(delb->compared_abspaths, local_abspath);
3142
if (delb->del_root != db)
3143
return SVN_NO_ERROR;
3145
if (delb->found_edit)
3149
apr_array_header_t *ignores;
3153
SVN_ERR(svn_wc_get_default_ignores(&ignores, merge_b->ctx->config,
3156
/* None of the descendants was modified, but maybe there are
3157
descendants we haven't walked?
3159
Note that we aren't interested in changes, as we already verified
3160
changes in the paths touched by the merge. And the existence of
3161
other paths is enough to mark the directory edited */
3162
err = svn_wc_walk_status(merge_b->ctx->wc_ctx, local_abspath,
3163
svn_depth_infinity, TRUE /* get-all */,
3164
FALSE /* no-ignore */,
3165
TRUE /* ignore-text-mods */, ignores,
3166
verify_touched_by_del_check, delb,
3167
merge_b->ctx->cancel_func,
3168
merge_b->ctx->cancel_baton,
3173
if (err->apr_err != SVN_ERR_CEASE_INVOCATION)
3174
return svn_error_trace(err);
3176
svn_error_clear(err);
3179
same = ! delb->found_edit;
3158
3183
if (same && !merge_b->dry_run)
9728
9754
if (diff3_cmd != NULL)
9729
9755
SVN_ERR(svn_path_cstring_to_utf8(&diff3_cmd, diff3_cmd, scratch_pool));
9757
/* See which files the user wants to preserve the extension of when
9758
conflict files are made. */
9759
svn_config_get(cfg, &preserved_exts_str, SVN_CONFIG_SECTION_MISCELLANY,
9760
SVN_CONFIG_OPTION_PRESERVED_CF_EXTS, "");
9731
9762
/* Build the merge context baton (or at least the parts of it that
9732
9763
don't need to be reset for each merge source). */
9733
9764
merge_cmd_baton.force_delete = force_delete;
10450
merge_source_t source;
10452
source.loc1 = source1_loc;
10453
source.loc2 = source2_loc;
10454
source.ancestral = FALSE;
10456
10486
/* Build a single-item merge_source_t array. */
10457
10487
merge_sources = apr_array_make(scratch_pool, 1, sizeof(merge_source_t *));
10458
APR_ARRAY_PUSH(merge_sources, merge_source_t *) = &source;
10488
APR_ARRAY_PUSH(merge_sources, merge_source_t *)
10489
= merge_source_create(source1_loc, source2_loc, FALSE, scratch_pool);
10461
10492
err = do_merge(NULL, NULL, conflict_report, &use_sleep,