You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2019/07/18 13:36:09 UTC

svn commit: r1863285 - in /subversion/branches/1.12.x: ./ STATUS subversion/libsvn_client/conflicts.c

Author: julianfoad
Date: Thu Jul 18 13:36:09 2019
New Revision: 1863285

URL: http://svn.apache.org/viewvc?rev=1863285&view=rev
Log:
Merge r1855419 from trunk:

 * r1855419
   Fix conflict resolver bug where local and incoming edits got swapped.
   Justification:
     Bug breaks text conflict resolution.
     User complained: https://svn.haxx.se/dev/archive-2019-03/0012.shtml
   Votes:
     +1: stsp
     +0: rhuijben

Modified:
    subversion/branches/1.12.x/   (props changed)
    subversion/branches/1.12.x/STATUS
    subversion/branches/1.12.x/subversion/libsvn_client/conflicts.c

Propchange: subversion/branches/1.12.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jul 18 13:36:09 2019
@@ -102,4 +102,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1857391,1863262
+/subversion/trunk:1855419,1857391,1863262

Modified: subversion/branches/1.12.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.12.x/STATUS?rev=1863285&r1=1863284&r2=1863285&view=diff
==============================================================================
--- subversion/branches/1.12.x/STATUS (original)
+++ subversion/branches/1.12.x/STATUS Thu Jul 18 13:36:09 2019
@@ -21,15 +21,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1855419
-   Fix conflict resolver bug where local and incoming edits got swapped.
-   Justification:
-     Bug breaks text conflict resolution.
-     User complained: https://svn.haxx.se/dev/archive-2019-03/0012.shtml
-   Votes:
-     +1: stsp
-     +0: rhuijben
-
  * r1856397
    Allow generating Visual Studio 2019 projects
    Justification:
@@ -77,4 +68,3 @@ Approved changes:
      Error handling was inconsistent across RA layers.
    Votes:
      +1: julianfoad, stsp
-

Modified: subversion/branches/1.12.x/subversion/libsvn_client/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.12.x/subversion/libsvn_client/conflicts.c?rev=1863285&r1=1863284&r2=1863285&view=diff
==============================================================================
--- subversion/branches/1.12.x/subversion/libsvn_client/conflicts.c (original)
+++ subversion/branches/1.12.x/subversion/libsvn_client/conflicts.c Thu Jul 18 13:36:09 2019
@@ -8632,10 +8632,10 @@ resolve_incoming_move_file_text_merge(sv
   if (operation == svn_wc_operation_update ||
       operation == svn_wc_operation_switch)
     {
-      svn_stream_t *working_stream;
+      svn_stream_t *moved_to_stream;
       svn_stream_t *incoming_stream;
 
-      /* Create a temporary copy of the working file in repository-normal form.
+      /* Create a temporary copy of the moved file in repository-normal form.
        * Set up this temporary file to be automatically removed. */
       err = svn_stream_open_unique(&incoming_stream,
                                    &incoming_abspath, wc_tmpdir,
@@ -8644,19 +8644,31 @@ resolve_incoming_move_file_text_merge(sv
       if (err)
         goto unlock_wc;
 
-      err = svn_wc__translated_stream(&working_stream, ctx->wc_ctx,
-                                      merge_source_abspath,
-                                      merge_source_abspath,
+      err = svn_wc__translated_stream(&moved_to_stream, ctx->wc_ctx,
+                                      moved_to_abspath,
+                                      moved_to_abspath,
                                       SVN_WC_TRANSLATE_TO_NF,
                                       scratch_pool, scratch_pool);
       if (err)
         goto unlock_wc;
 
-      err = svn_stream_copy3(working_stream, incoming_stream,
+      err = svn_stream_copy3(moved_to_stream, incoming_stream,
                              NULL, NULL, /* no cancellation */
                              scratch_pool);
       if (err)
         goto unlock_wc;
+
+      /* Overwrite the moved file with the conflict victim's content.
+       * Incoming changes will be merged in from the temporary file created
+       * above. This is required to correctly make local changes show up as
+       * 'mine' during the three-way text merge between the ancestor file,
+       * the conflict victim ('mine'), and the moved file ('theirs') which
+       * was brought in by the update/switch operation and occupies the path
+       * of the merge target. */
+      err = svn_io_copy_file(merge_source_abspath, moved_to_abspath, FALSE,
+                             scratch_pool);
+      if (err)
+        goto unlock_wc;
     }
   else if (operation == svn_wc_operation_merge)
     {