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 2022/11/24 10:48:03 UTC

svn commit: r1905506 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c

Author: kotkov
Date: Thu Nov 24 10:48:03 2022
New Revision: 1905506

URL: http://svn.apache.org/viewvc?rev=1905506&view=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: In the pristine-store-test, check
the actual working copy settings, instead of trying to predict them based
on the test options.

* subversion/tests/libsvn_wc/pristine-store-test.c
  (pristine_install_dehydrated,
   pristine_dehydrate): Check the working copy settings.

Modified:
    subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c?rev=1905506&r1=1905505&r2=1905506&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c Thu Nov 24 10:48:03 2022
@@ -328,17 +328,16 @@ pristine_install_dehydrated(const svn_te
   const char data[] = "Blah";
   svn_checksum_t *data_sha1, *data_md5;
 
-  int wc_format;
-
-  SVN_ERR(svn_wc__format_from_version(&wc_format, opts->wc_format_version, pool));
-
-  if (wc_format < SVN_WC__HAS_OPTIONAL_PRISTINE)
-    return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
-                            "Not supported in WC format under test");
+  svn_boolean_t store_pristine;
 
   SVN_ERR(create_repos_and_wc(&wc_abspath, &db,
                               "pristine_install_dehydrated", opts, pool));
 
+  SVN_ERR(svn_wc__db_get_settings(NULL, &store_pristine, db, wc_abspath, pool));
+  if (store_pristine)
+    return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
+                            "Test assumes a working copy without pristine");
+
   /* Write DATA into a new temporary pristine file, set PRISTINE_TMP_ABSPATH
    * to its path and set DATA_SHA1 and DATA_MD5 to its checksums. */
   SVN_ERR(svn_wc__db_pristine_prepare_install(&pristine_stream,
@@ -439,17 +438,16 @@ pristine_dehydrate(const svn_test_opts_t
   svn_string_t *data_string = svn_string_create(data, pool);
   svn_checksum_t *data_sha1, *data_md5;
 
-  int wc_format;
-
-  SVN_ERR(svn_wc__format_from_version(&wc_format, opts->wc_format_version, pool));
-
-  if (wc_format < SVN_WC__HAS_OPTIONAL_PRISTINE)
-    return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
-                            "Not supported in WC format under test");
+  svn_boolean_t store_pristine;
 
   SVN_ERR(create_repos_and_wc(&wc_abspath, &db,
                               "pristine_dehydrate", opts, pool));
 
+  SVN_ERR(svn_wc__db_get_settings(NULL, &store_pristine, db, wc_abspath, pool));
+  if (store_pristine)
+    return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
+                            "Test assumes a working copy without pristine");
+
   /* Write DATA into a new temporary pristine file, set PRISTINE_TMP_ABSPATH
    * to its path and set DATA_SHA1 and DATA_MD5 to its checksums. */
   SVN_ERR(svn_wc__db_pristine_prepare_install(&pristine_stream,