You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2016/11/28 13:41:17 UTC

svn commit: r1771738 - /subversion/trunk/subversion/libsvn_client/conflicts.c

Author: stsp
Date: Mon Nov 28 13:41:17 2016
New Revision: 1771738

URL: http://svn.apache.org/viewvc?rev=1771738&view=rev
Log:
Fix handling of keywords while updating an incoming moved file.

* subversion/libsvn_client/conflicts.c
  (resolve_incoming_move_file_text_merge): Normalize working file content to
   repository-normal form instead of passing 'local_abspath' as 'right_abspath'
   directly to svn_wc_merge5(). Should fix merges with keywords.

Modified:
    subversion/trunk/subversion/libsvn_client/conflicts.c

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1771738&r1=1771737&r2=1771738&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Mon Nov 28 13:41:17 2016
@@ -7043,7 +7043,39 @@ resolve_incoming_move_file_text_merge(sv
   if (operation == svn_wc_operation_update ||
       operation == svn_wc_operation_switch)
     {
-      incoming_abspath = local_abspath;
+      svn_stream_t *working_stream;
+      svn_stream_t *incoming_stream;
+      svn_stream_t *normalized_stream;
+      apr_hash_t *keywords;
+
+      /* Create a temporary copy of the working 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,
+                                   svn_io_file_del_on_pool_cleanup,
+                                   scratch_pool, scratch_pool);
+      if (err)
+        goto unlock_wc;
+
+      err = svn_stream_open_readonly(&working_stream, local_abspath,
+                                     scratch_pool, scratch_pool);
+      if (err)
+        goto unlock_wc;
+
+      err = get_keywords(&keywords, ctx->wc_ctx, local_abspath,
+                         scratch_pool, scratch_pool);
+      if (err)
+        goto unlock_wc;
+
+      normalized_stream = svn_subst_stream_translated(working_stream,
+                                                      "\n", TRUE,
+                                                      keywords, FALSE,
+                                                      scratch_pool);
+      err = svn_stream_copy3(normalized_stream, incoming_stream,
+                             NULL, NULL, /* no cancellation */
+                             scratch_pool);
+      if (err)
+        goto unlock_wc;
     }
   else if (operation == svn_wc_operation_merge)
     {
@@ -7056,7 +7088,8 @@ resolve_incoming_move_file_text_merge(sv
        * the move, and only then perform a three-way text merge between
        * the ancestor's file, our working file (which we would move to
        * the destination), and the file that we have set aside, which
-       * contains the incoming fulltext. */
+       * contains the incoming fulltext.
+       * Set up this temporary file to NOT be automatically removed. */
       err = svn_stream_open_unique(&incoming_stream,
                                    &incoming_abspath, wc_tmpdir,
                                    svn_io_file_del_none,