Author: kotkov
Date: Mon Nov 28 12:41:57 2022
New Revision: 1905568

URL: http://svn.apache.org/viewvc?rev=1905568&view=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Following up on r1905324, fix
an issue where we inadvertently started to use unmodified working files as
text-bases even in working copies created with --store-pristine=yes.

This was causing basic_tests.py#9 to fail.

* subversion/libsvn_wc/textbase.c
  (open_textbase): Only use an unmodified working file as the text-base
   if the working copy is not configured to store local pristines.

Modified:
    
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c?rev=1905568&r1=1905567&r2=1905568&view=diff
==============================================================================
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c 
(original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c 
Mon Nov 28 12:41:57 2022
@@ -271,21 +271,33 @@ open_textbase(svn_stream_t **contents_p,
 
   if (checksum && svn_checksum_match(checksum, target_checksum))
     {
-      svn_boolean_t modified;
+      svn_boolean_t store_pristine;
 
-      SVN_ERR(check_file_modified(&modified, db, local_abspath, recorded_size,
-                                  recorded_time, target_checksum, have_props,
-                                  props_mod, scratch_pool));
-      if (!modified)
+      SVN_ERR(svn_wc__db_get_settings(NULL, &store_pristine, db, local_abspath,
+                                      scratch_pool));
+      if (!store_pristine)
         {
-          SVN_ERR(svn_wc__internal_translated_stream(contents_p, db,
-                                                     local_abspath,
-                                                     local_abspath,
-                                                     SVN_WC_TRANSLATE_TO_NF,
-                                                     result_pool,
-                                                     scratch_pool));
+          svn_boolean_t modified;
 
-          return SVN_NO_ERROR;
+          /* If the working copy doesn't store local copies of all pristine
+           * contents, a text-base of the unmodified file is the file itself,
+           * appropriately detranslated. */
+
+          SVN_ERR(check_file_modified(&modified, db, local_abspath,
+                                      recorded_size, recorded_time,
+                                      target_checksum, have_props,
+                                      props_mod, scratch_pool));
+          if (!modified)
+            {
+              SVN_ERR(svn_wc__internal_translated_stream(contents_p, db,
+                                                         local_abspath,
+                                                         local_abspath,
+                                                         
SVN_WC_TRANSLATE_TO_NF,
+                                                         result_pool,
+                                                         scratch_pool));
+
+              return SVN_NO_ERROR;
+            }
         }
     }
 


Reply via email to