summaryrefslogtreecommitdiff
path: root/subversion/libsvn_wc/merge.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/libsvn_wc/merge.c')
-rw-r--r--subversion/libsvn_wc/merge.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/subversion/libsvn_wc/merge.c b/subversion/libsvn_wc/merge.c
index 7cff3e4..85ec632 100644
--- a/subversion/libsvn_wc/merge.c
+++ b/subversion/libsvn_wc/merge.c
@@ -26,10 +26,11 @@
#include "svn_dirent_uri.h"
#include "svn_path.h"
#include "svn_pools.h"
+#include "svn_props.h"
#include "wc.h"
-#include "adm_files.h"
#include "conflicts.h"
+#include "props.h"
#include "translate.h"
#include "workqueue.h"
@@ -179,7 +180,7 @@ detranslate_wc_file(const char **detranslated_abspath,
= prop ? (prop->value ? prop->value->data : NULL) : old_mime_value;
old_is_binary = old_mime_value && svn_mime_type_is_binary(old_mime_value);
- new_is_binary = new_mime_value && svn_mime_type_is_binary(new_mime_value);;
+ new_is_binary = new_mime_value && svn_mime_type_is_binary(new_mime_value);
}
/* See what translations we want to do */
@@ -391,6 +392,8 @@ do_text_merge(svn_boolean_t *contains_conflicts,
const char *target_label,
const char *left_label,
const char *right_label,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
apr_pool_t *pool)
{
svn_diff_t *diff;
@@ -415,13 +418,14 @@ do_text_merge(svn_boolean_t *contains_conflicts,
ostream = svn_stream_from_aprfile2(result_f, TRUE, pool);
- SVN_ERR(svn_diff_file_output_merge2(ostream, diff,
+ SVN_ERR(svn_diff_file_output_merge3(ostream, diff,
left, detranslated_target, right,
left_marker,
target_marker,
right_marker,
"=======", /* separator */
- svn_diff_conflict_display_modified_latest,
+ svn_diff_conflict_display_modified_original_latest,
+ cancel_func, cancel_baton,
pool));
SVN_ERR(svn_stream_close(ostream));
@@ -725,16 +729,20 @@ merge_file_trivial(svn_skel_t **work_items,
{
svn_stream_t *tmp_src;
svn_stream_t *tmp_dst;
+ const char *tmp_dir;
SVN_ERR(svn_stream_open_readonly(&tmp_src, right_abspath,
scratch_pool,
scratch_pool));
- SVN_ERR(svn_wc__open_writable_base(&tmp_dst, &right_abspath,
- NULL, NULL,
- db, target_abspath,
- scratch_pool,
- scratch_pool));
+ SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&tmp_dir, db,
+ target_abspath,
+ scratch_pool,
+ scratch_pool));
+
+ SVN_ERR(svn_stream_open_unique(&tmp_dst, &right_abspath,
+ tmp_dir, svn_io_file_del_none,
+ scratch_pool, scratch_pool));
SVN_ERR(svn_stream_copy3(tmp_src, tmp_dst,
cancel_func, cancel_baton,
@@ -866,15 +874,17 @@ merge_text_file(svn_skel_t **work_items,
target_label,
left_label,
right_label,
+ cancel_func, cancel_baton,
pool));
SVN_ERR(svn_io_file_close(result_f, pool));
/* Determine the MERGE_OUTCOME, and record any conflict. */
- if (contains_conflicts && ! dry_run)
+ if (contains_conflicts)
{
*merge_outcome = svn_wc_merge_conflict;
- if (*merge_outcome == svn_wc_merge_conflict)
+
+ if (! dry_run)
{
const char *left_copy, *right_copy, *target_copy;
@@ -902,12 +912,7 @@ merge_text_file(svn_skel_t **work_items,
result_pool,
scratch_pool));
}
-
- if (*merge_outcome == svn_wc_merge_merged)
- goto done;
}
- else if (contains_conflicts && dry_run)
- *merge_outcome = svn_wc_merge_conflict;
else
{
svn_boolean_t same, special;
@@ -941,7 +946,6 @@ merge_text_file(svn_skel_t **work_items,
*work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
}
-done:
/* Remove the tempfile after use */
SVN_ERR(svn_wc__wq_build_file_remove(&work_item, mt->db, mt->local_abspath,
result_target,
@@ -1226,6 +1230,7 @@ svn_wc_merge5(enum svn_wc_merge_outcome_t *merge_content_outcome,
apr_hash_t *pristine_props = NULL;
apr_hash_t *old_actual_props;
apr_hash_t *new_actual_props = NULL;
+ svn_node_kind_t kind;
SVN_ERR_ASSERT(svn_dirent_is_absolute(left_abspath));
SVN_ERR_ASSERT(svn_dirent_is_absolute(right_abspath));
@@ -1238,7 +1243,6 @@ svn_wc_merge5(enum svn_wc_merge_outcome_t *merge_content_outcome,
/* Sanity check: the merge target must be a file under revision control */
{
svn_wc__db_status_t status;
- svn_node_kind_t kind;
svn_boolean_t had_props;
svn_boolean_t props_mod;
svn_boolean_t conflicted;
@@ -1401,7 +1405,7 @@ svn_wc_merge5(enum svn_wc_merge_outcome_t *merge_content_outcome,
svn_boolean_t text_conflicted, prop_conflicted;
SVN_ERR(svn_wc__conflict_invoke_resolver(
- wc_ctx->db, target_abspath,
+ wc_ctx->db, target_abspath, kind,
conflict_skel, merge_options,
conflict_func, conflict_baton,
cancel_func, cancel_baton,