Author: stsp
Date: Tue Mar 17 12:05:10 2015
New Revision: 1667280
URL: http://svn.apache.org/r1667280
Log:
Always install a .mine file for conflicted binary files, not just in
case the binary file was detranslated.
This makes the 'mine-full' option work again from the conflict prompt.
Before this change, an assertion in libsvn_wc failed when the 'mine-full'
option was used since no path for 'mine' was recorded in conflict storage.
* subversion/libsvn_wc/merge.c
(merge_binary_file): Always create .mine, if necessary as a copy
of the conflicted working file. Update docstring.
* subversion/tests/cmdline/merge_tests.py
(dry_run_merge_conflicting_binary): Update on-disk test expectations.
Modified:
subversion/trunk/subversion/libsvn_wc/merge.c
subversion/trunk/subversion/tests/cmdline/merge_tests.py
Modified: subversion/trunk/subversion/libsvn_wc/merge.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/merge.c?rev=1667280&r1=1667279&r2=1667280&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/merge.c (original)
+++ subversion/trunk/subversion/libsvn_wc/merge.c Tue Mar 17 12:05:10 2015
@@ -962,9 +962,10 @@ merge_text_file(svn_skel_t **work_items,
* Copy* the files at LEFT_ABSPATH and RIGHT_ABSPATH into the same directory
* as the target file, giving them unique names that start with the target
* file's name and end with LEFT_LABEL and RIGHT_LABEL respectively.
- * If the merge target has been 'detranslated' to repository normal form,
- * move the detranslated file similarly to a unique name ending with
- * TARGET_LABEL.
+ *
+ * Copy the working state of the merge target to a unique name ending with
+ * TARGET_LABEL. If the merge target has been 'detranslated' to repository
+ * normal form, use the detranslated form instead of the working state.
*
* ### * Why do we copy the left and right temp files when we could (maybe
* not always?) move them?
@@ -1035,26 +1036,31 @@ merge_binary_file(svn_skel_t **work_item
SVN_ERR(svn_io_copy_file(left_abspath, left_copy, TRUE, pool));
SVN_ERR(svn_io_copy_file(right_abspath, right_copy, TRUE, pool));
+ /* Create a .mine file too */
+ SVN_ERR(svn_io_open_uniquely_named(NULL,
+ &conflict_wrk,
+ merge_dirpath,
+ merge_filename,
+ target_label,
+ svn_io_file_del_none,
+ pool, pool));
+
/* Was the merge target detranslated? */
if (strcmp(mt->local_abspath, detranslated_target_abspath) != 0)
- {
- /* Create a .mine file too */
- SVN_ERR(svn_io_open_uniquely_named(NULL,
- &conflict_wrk,
- merge_dirpath,
- merge_filename,
- target_label,
- svn_io_file_del_none,
- pool, pool));
- SVN_ERR(svn_wc__wq_build_file_move(work_items, mt->db,
- mt->local_abspath,
- detranslated_target_abspath,
- conflict_wrk,
- pool, result_pool));
- }
+ SVN_ERR(svn_wc__wq_build_file_move(work_items, mt->db,
+ mt->local_abspath,
+ detranslated_target_abspath,
+ conflict_wrk,
+ pool, result_pool));
else
{
- conflict_wrk = NULL;
+ /* Ensure .mine file is created (translation is a no-op).
+ * ### add workq API to copy without translation? */
+ SVN_ERR(svn_wc__wq_build_file_copy_translated(work_items, mt->db,
+ mt->local_abspath,
+ mt->local_abspath,
+ conflict_wrk,
+ pool, result_pool));
}
/* Mark target_abspath's entry as "Conflicted", and start tracking
Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=1667280&r1=1667279&r2=1667280&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Tue Mar 17
12:05:10 2015
@@ -16009,6 +16009,11 @@ def dry_run_merge_conflicting_binary(sbo
'A/theta.merge-right.r3' :
Item(contents= theta_contents + "some extra junk")
})
+ # verify content of working backup ("mine") file
+ expected_disk.add({
+ 'A/theta.working' :
+ Item(contents= theta_contents + "some other junk")
+ })
expected_status = svntest.actions.get_virginal_state(other_wc, 1)
expected_status.add({