You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ko...@apache.org on 2016/09/28 10:55:49 UTC

svn commit: r1762631 - in /subversion/trunk/subversion: libsvn_client/conflicts.c tests/libsvn_client/conflicts-test.c

Author: kotkov
Date: Wed Sep 28 10:55:49 2016
New Revision: 1762631

URL: http://svn.apache.org/viewvc?rev=1762631&view=rev
Log:
When merging an incoming file move, don't forget to remove the original
file from disk after recording a move in the working copy.

* subversion/libsvn_client/conflicts.c
  (resolve_incoming_move_file_text_merge): Delete the original file after
   running a meta-data only move.

* subversion/tests/libsvn_client/conflicts-test.c
  (test_option_merge_incoming_move_file_text_merge): Extend the test with
   another check that fails without this fix.

Modified:
    subversion/trunk/subversion/libsvn_client/conflicts.c
    subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1762631&r1=1762630&r2=1762631&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Wed Sep 28 10:55:49 2016
@@ -6390,6 +6390,11 @@ resolve_incoming_move_file_text_merge(sv
                           scratch_pool);
       if (err)
         goto unlock_wc;
+
+      /* Delete the original file from disk. */
+      err = svn_io_remove_file2(local_abspath, FALSE, scratch_pool);
+      if (err)
+        goto unlock_wc;
     }
   else
     return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,

Modified: subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c?rev=1762631&r1=1762630&r2=1762631&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c Wed Sep 28 10:55:49 2016
@@ -1764,6 +1764,7 @@ test_merge_incoming_move_file_text_merge
   svn_opt_revision_t opt_rev;
   svn_stream_t *stream;
   svn_stringbuf_t *buf;
+  svn_node_kind_t kind;
 
   SVN_ERR(svn_test__sandbox_create(b, "merge_incoming_move_file_text_merge",
                                    opts, pool));
@@ -1835,6 +1836,10 @@ test_merge_incoming_move_file_text_merge
                          sbox_wc_path(b, deleted_path));
   SVN_TEST_ASSERT(status->moved_to_abspath == NULL);
 
+  /* Ensure that the original file was removed. */
+  SVN_ERR(svn_io_check_path(sbox_wc_path(b, deleted_path), &kind, b->pool));
+  SVN_TEST_ASSERT(kind == svn_node_none);
+
   /* Ensure that the moved file has the expected content. */
   SVN_ERR(svn_stream_open_readonly(&stream, sbox_wc_path(b, new_file_path),
                                    b->pool, b->pool));