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 2021/03/04 12:38:27 UTC

svn commit: r1887172 - /subversion/trunk/subversion/libsvn_wc/working_file_writer.c

Author: kotkov
Date: Thu Mar  4 12:38:27 2021
New Revision: 1887172

URL: http://svn.apache.org/viewvc?rev=1887172&view=rev
Log:
Revert r1887111 and r1887112, which inlined the svn_subst_translation_required()
check in the working file writer.

With a second thought, it might be better to keep using that helper to rely on
the stable primitive, instead of reimplementing it by hand.

And for the keywords part of that check, we should be able to get rid of it
with a bit of groundwork in subst.c.

Modified:
    subversion/trunk/subversion/libsvn_wc/working_file_writer.c

Modified: subversion/trunk/subversion/libsvn_wc/working_file_writer.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/working_file_writer.c?rev=1887172&r1=1887171&r2=1887172&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/working_file_writer.c (original)
+++ subversion/trunk/subversion/libsvn_wc/working_file_writer.c Thu Mar  4 12:38:27 2021
@@ -73,6 +73,9 @@ svn_wc__working_file_writer_open(svn_wc_
   svn_stream_t *install_stream;
   svn_stream_t *write_stream;
 
+  if (keywords && apr_hash_count(keywords) <= 0)
+    keywords = NULL;
+
   SVN_ERR(svn_stream__create_for_install(&install_stream, tmp_abspath,
                                          result_pool, scratch_pool));
 
@@ -85,8 +88,9 @@ svn_wc__working_file_writer_open(svn_wc_
 
   write_stream = install_stream;
 
-  if ((keywords && apr_hash_count(keywords) > 0) ||
-      eol_style != svn_subst_eol_style_none)
+  if (svn_subst_translation_required(eol_style, eol, keywords,
+                                     FALSE /* special */,
+                                     TRUE /* force_eol_check */))
     {
       write_stream = svn_subst_stream_translated(write_stream,
                                                  eol,