You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/04/09 09:52:40 UTC
svn commit: r932284 - /subversion/trunk/subversion/libsvn_wc/merge.c
Author: gstein
Date: Fri Apr 9 07:52:40 2010
New Revision: 932284
URL: http://svn.apache.org/viewvc?rev=932284&view=rev
Log:
Another round of converting loggy_copy.
* subversion/libsvn_wc/merge.c:
(merge_text_file): replace a loggy_copy with an OP_FILE_INSTALL
(merge_binary_file): rejigger the switch logic to break out and install
the working copy file from a particular source.
Modified:
subversion/trunk/subversion/libsvn_wc/merge.c
Modified: subversion/trunk/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/merge.c?rev=932284&r1=932283&r2=932284&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/merge.c (original)
+++ subversion/trunk/subversion/libsvn_wc/merge.c Fri Apr 9 07:52:40 2010
@@ -978,9 +978,16 @@ merge_text_file(svn_stringbuf_t **log_ac
if (*merge_outcome != svn_wc_merge_unchanged && ! dry_run)
{
+ const svn_skel_t *work_item;
+
/* replace TARGET_ABSPATH with the new merged file, expanding. */
- SVN_ERR(svn_wc__loggy_copy(db, dir_abspath,
- result_target, target_abspath, pool));
+ SVN_ERR(svn_wc__wq_build_file_install(&work_item,
+ db, target_abspath,
+ result_target,
+ FALSE /* use_commit_times */,
+ FALSE /* record_fileinfo */,
+ pool, pool));
+ SVN_ERR(svn_wc__db_wq_add(db, dir_abspath, work_item, pool));
}
return SVN_NO_ERROR;
@@ -1025,6 +1032,7 @@ merge_binary_file(svn_stringbuf_t **log_
{
svn_wc_conflict_result_t *result = NULL;
const svn_wc_conflict_description_t *cdesc;
+ const char *install_from = NULL;
cdesc = setup_text_conflict_desc(left_abspath, right_abspath,
target_abspath,
@@ -1050,19 +1058,15 @@ merge_binary_file(svn_stringbuf_t **log_
unless the conflict-callback did the merging itself. */
case svn_wc_conflict_choose_base:
{
- SVN_ERR(svn_wc__loggy_copy(db, merge_dirpath,
- left_abspath, target_abspath,
- pool));
+ install_from = left_abspath;
*merge_outcome = svn_wc_merge_merged;
- return SVN_NO_ERROR;
+ break;
}
case svn_wc_conflict_choose_theirs_full:
{
- SVN_ERR(svn_wc__loggy_copy(db, merge_dirpath,
- right_abspath, target_abspath,
- pool));
+ install_from = right_abspath;
*merge_outcome = svn_wc_merge_merged;
- return SVN_NO_ERROR;
+ break;
}
/* For a binary file, if the response is to use the
user's file, we do nothing. We also do nothing if
@@ -1086,12 +1090,9 @@ merge_binary_file(svn_stringbuf_t **log_
}
else
{
- SVN_ERR(svn_wc__loggy_copy(db, merge_dirpath,
- result->merged_file,
- target_abspath,
- pool));
+ install_from = result->merged_file;
*merge_outcome = svn_wc_merge_merged;
- return SVN_NO_ERROR;
+ break;
}
}
case svn_wc_conflict_choose_postpone:
@@ -1100,6 +1101,22 @@ merge_binary_file(svn_stringbuf_t **log_
/* Assume conflict remains, fall through to code below. */
}
}
+
+ if (install_from != NULL)
+ {
+ const svn_skel_t *work_item;
+
+ SVN_ERR(svn_wc__wq_build_file_install(&work_item,
+ db, target_abspath,
+ install_from,
+ FALSE /* use_commit_times */,
+ FALSE /* record_fileinfo */,
+ pool, pool));
+ SVN_ERR(svn_wc__db_wq_add(db, merge_dirpath, work_item, pool));
+
+ /* A merge choice was made, so we're done here. */
+ return SVN_NO_ERROR;
+ }
}
/* If we don't call the conflict resolver, there MAY be work items