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 2022/02/11 11:21:02 UTC

svn commit: r1897968 - in /subversion/branches/pristines-on-demand-on-mwf: ./ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_wc/ subversion/tests/libsvn_wc/

Author: julianfoad
Date: Fri Feb 11 11:21:01 2022
New Revision: 1897968

URL: http://svn.apache.org/viewvc?rev=1897968&view=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: sync with ^/subversion/branches/multi-wc-format@1897967.

Modified:
    subversion/branches/pristines-on-demand-on-mwf/   (props changed)
    subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/checkout.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/upgrade.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/upgrade.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc.h
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_wcroot.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/utils.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/wc-queries-test.c

Propchange: subversion/branches/pristines-on-demand-on-mwf/
------------------------------------------------------------------------------
  Merged /subversion/branches/multi-wc-format:r1897945-1897967

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h?rev=1897968&r1=1897967&r2=1897968&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h Fri Feb 11 11:21:01 2022
@@ -2183,6 +2183,8 @@ svn_wc__working_file_writer_close(svn_wc
  * Convert @a version to that version's characteristic working copy
  * format, returned in @a format.
  *
+ * A NULL @a version translates to the library's default version.
+ *
  * Use @a scratch_pool for temporary allocations.
  *
  * @since New in 1.15.
@@ -2231,7 +2233,7 @@ svn_wc__min_supported_format_version(voi
 /**
  * Set @a format to the format of the nearest parent working copy root of
  * @a local_abspath in @a wc_ctx, or to the oldest format of any root stored
- * there. If @a wc_ctx is empty, return the newset supported format.
+ * there. If @a wc_ctx is empty, return the library's default format.
  *
  * Use @a scratch_pool for temporary allocations.
  *

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/checkout.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/checkout.c?rev=1897968&r1=1897967&r2=1897968&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/checkout.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/checkout.c Fri Feb 11 11:21:01 2022
@@ -98,6 +98,8 @@ svn_client__checkout_internal(svn_revnum
       && (revision->kind != svn_opt_revision_head))
     return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL, NULL);
 
+  /* Here the default for wc_format_version is determined from WC context,
+   * rather than the library's default version. */
   if (wc_format_version)
     SVN_ERR(svn_wc__format_from_version(&target_format, wc_format_version,
                                         scratch_pool));

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h?rev=1897968&r1=1897967&r2=1897968&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h Fri Feb 11 11:21:01 2022
@@ -541,9 +541,8 @@ svn_client__update_internal(svn_revnum_t
 
    A new working copy, if needed, will be created in the format corresponding
    to the WC_FORMAT_VERSION of the client. If this parameter is NULL, the
-   format from CTX->WC_CTX will be and an error will be returned if the format
-   cannot be determined. The format of any existing working copy will remain
-   unchanged.
+   format will be determined from context (see svn_wc__format_from_context).
+   The format of any existing working copy will remain unchanged.
 
    If RA_SESSION is NOT NULL, it may be used to avoid creating a new
    session. The session may point to a different URL after returning.

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/upgrade.c?rev=1897968&r1=1897967&r2=1897968&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/upgrade.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/upgrade.c Fri Feb 11 11:21:01 2022
@@ -196,10 +196,6 @@ svn_client_upgrade2(const char *path,
 {
   int wc_format;
 
-  /* A NULL wc_format_version translates to the default version. */
-  if (!wc_format_version)
-    wc_format_version = svn_client_supported_wc_version();
-
   SVN_ERR(svn_wc__format_from_version(&wc_format,
                                       wc_format_version,
                                       scratch_pool));

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c?rev=1897968&r1=1897967&r2=1897968&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c Fri Feb 11 11:21:01 2022
@@ -580,7 +580,7 @@ svn_wc_ensure_adm4(svn_wc_context_t *wc_
                    apr_pool_t *scratch_pool)
 {
   return svn_error_trace(
-      svn_wc__ensure_adm(wc_ctx, SVN_WC__VERSION, local_abspath,
+      svn_wc__ensure_adm(wc_ctx, SVN_WC__DEFAULT_VERSION, local_abspath,
                          url, repos_root_url, repos_uuid, revision, depth,
                          scratch_pool));
 }
@@ -4900,7 +4900,7 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
                void *notify_baton,
                apr_pool_t *scratch_pool)
 {
-  return svn_wc__upgrade(wc_ctx, local_abspath, SVN_WC__VERSION,
+  return svn_wc__upgrade(wc_ctx, local_abspath, SVN_WC__DEFAULT_VERSION,
                          repos_info_func, repos_info_baton,
                          cancel_func, cancel_baton,
                          notify_func, notify_baton,

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/upgrade.c?rev=1897968&r1=1897967&r2=1897968&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/upgrade.c Fri Feb 11 11:21:01 2022
@@ -1647,7 +1647,11 @@ svn_wc__format_from_version(int *format,
                             const svn_version_t* version,
                             apr_pool_t *scratch_pool)
 {
-  SVN_ERR_ASSERT(version != NULL);
+  if (!version)
+    {
+      *format = SVN_WC__DEFAULT_VERSION;
+      return SVN_NO_ERROR;
+    }
 
   if (version->major != SVN_VER_MAJOR || version->minor > SVN_VER_MINOR)
     return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc.h?rev=1897968&r1=1897967&r2=1897968&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc.h Fri Feb 11 11:21:01 2022
@@ -173,6 +173,10 @@ extern "C" {
               whenever you change this value! */
 #define SVN_WC__SUPPORTED_VERSION 31
 
+/* The default WC version that the Subversion library should create
+ * (or upgrade to) when not otherwise specified. */
+#define SVN_WC__DEFAULT_VERSION SVN_WC__SUPPORTED_VERSION
+
 /* Formats <= this have no concept of "revert text-base/props".  */
 #define SVN_WC__NO_REVERT_FILES 4
 

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.c?rev=1897968&r1=1897967&r2=1897968&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.c Fri Feb 11 11:21:01 2022
@@ -1506,6 +1506,13 @@ svn_wc__db_init(svn_wc__db_t *db,
                         FALSE /* auto-upgrade */,
                         db->state_pool, scratch_pool));
 
+#define FORMAT_EXPECTED 32
+  if (wcroot->format != FORMAT_EXPECTED)
+    {
+      SVN_DBG(("### format is %d; expected %d", wcroot->format, FORMAT_EXPECTED));
+      SVN_ERR_MALFUNCTION_NO_RETURN();
+    }
+
   /* Any previously cached children may now have a new WCROOT, most likely that
      of the new WCROOT, but there might be descendant directories that are their
      own working copy, in which case setting WCROOT to our new WCROOT might
@@ -13462,6 +13469,12 @@ svn_wc__db_upgrade_begin(svn_sqlite__db_
                                        FALSE /* auto-upgrade */,
                                        wc_db->state_pool, scratch_pool));
 
+  if (wcroot->format != FORMAT_EXPECTED)
+    {
+      SVN_DBG(("### format is %d; expected %d", wcroot->format, FORMAT_EXPECTED));
+      SVN_ERR_MALFUNCTION_NO_RETURN();
+    }
+
   /* The WCROOT is complete. Stash it into DB.  */
   svn_hash_sets(wc_db->dir_data, wcroot->abspath, wcroot);
 

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_wcroot.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_wcroot.c?rev=1897968&r1=1897967&r2=1897968&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_wcroot.c Fri Feb 11 11:21:01 2022
@@ -1050,11 +1050,11 @@ svn_wc__format_from_context(int *format,
   apr_array_header_t *keys;
   int index;
 
-  /* Thsi is what we return if we don't find a concrete format version. */
+  /* This is what we return if we don't find a concrete format version. */
   SVN_ERR(svn_hash_keys(&keys, dir_data, scratch_pool));
   if (0 == keys->nelts)
     {
-      *format = SVN_WC__VERSION;
+      *format = SVN_WC__DEFAULT_VERSION;
       return SVN_NO_ERROR;
     }
 

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c?rev=1897968&r1=1897967&r2=1897968&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c Fri Feb 11 11:21:01 2022
@@ -602,7 +602,7 @@ test_access_baton_like_locking(const svn
   {
     const char *url, *repos_root_url, *repos_uuid;
     const char *subdir = svn_dirent_join(local_abspath, "sub-wc", pool);
-    int target_format = SVN_WC__VERSION;
+    int target_format;
     const char *repos_relpath;
 
     svn_boolean_t is_root;
@@ -613,9 +613,8 @@ test_access_baton_like_locking(const svn
     url = svn_path_url_add_component2(repos_root_url, repos_relpath, pool);
 
     SVN_ERR(svn_io_make_dir_recursively(subdir, pool));
-    if (opts->wc_format_version)
-      SVN_ERR(svn_wc__format_from_version(&target_format, opts->wc_format_version,
-                                          pool));
+    SVN_ERR(svn_wc__format_from_version(&target_format, opts->wc_format_version,
+                                        pool));
     SVN_ERR(svn_wc__ensure_adm(wc_ctx, target_format,
                                subdir,
                                svn_path_url_add_component2(url, "sub-wc", pool),

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/utils.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/utils.c?rev=1897968&r1=1897967&r2=1897968&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/utils.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/utils.c Fri Feb 11 11:21:01 2022
@@ -135,11 +135,10 @@ svn_test__create_fake_wc(const char *wc_
   int i;
   svn_sqlite__stmt_t *stmt;
   const apr_int64_t wc_id = 1;
-  int target_format = SVN_WC__VERSION;
+  int target_format;
 
-  if (wc_format_version)
-    SVN_ERR(svn_wc__format_from_version(&target_format, wc_format_version,
-                                        scratch_pool));
+  SVN_ERR(svn_wc__format_from_version(&target_format, wc_format_version,
+                                      scratch_pool));
 
   /* Allocate MY_STATEMENTS in RESULT_POOL because the SDB will continue to
    * refer to it over its lifetime. */

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/wc-queries-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1897968&r1=1897967&r2=1897968&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/wc-queries-test.c Fri Feb 11 11:21:01 2022
@@ -158,11 +158,10 @@ create_memory_db(sqlite3 **db,
 {
   sqlite3 *sdb;
   int i;
-  int target_format = SVN_WC__VERSION;
+  int target_format;
 
-  if (opts->wc_format_version)
-    SVN_ERR(svn_wc__format_from_version(&target_format, opts->wc_format_version,
-                                        pool));
+  SVN_ERR(svn_wc__format_from_version(&target_format, opts->wc_format_version,
+                                      pool));
 
   /* Create an in-memory raw database */
   SVN_TEST_ASSERT(sqlite3_initialize() == SQLITE_OK);