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/24 16:19:04 UTC

svn commit: r1898379 - in /subversion/branches/pristines-on-demand-on-mwf: ./ subversion/include/ subversion/libsvn_client/ subversion/libsvn_wc/ subversion/svn/ subversion/tests/cmdline/ subversion/tests/cmdline/getopt_tests_data/

Author: julianfoad
Date: Thu Feb 24 16:19:04 2022
New Revision: 1898379

URL: http://svn.apache.org/viewvc?rev=1898379&view=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: sync with trunk@1898378.

Modified:
    subversion/branches/pristines-on-demand-on-mwf/   (props changed)
    subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_client.h
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/checkout.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/upgrade.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc.h
    subversion/branches/pristines-on-demand-on-mwf/subversion/svn/help-cmd.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/svn/svn.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/davautocheck.sh
    subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout
    subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout

Propchange: subversion/branches/pristines-on-demand-on-mwf/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1898192-1898378

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_client.h?rev=1898379&r1=1898378&r2=1898379&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_client.h (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_client.h Thu Feb 24 16:19:04 2022
@@ -1243,8 +1243,8 @@ svn_client_args_to_target_array(apr_arra
  * @param[in] wc_format_version is the version number of the Subversion
  *              client that supports the metadata format of the
  *              created working copy; @c NULL means the library's default
- *              format. The earliest supported version is returned by
- *              svn_client_supported_wc_version().
+ *              format. See svn_client_default_wc_version(),
+ *              svn_client_supported_wc_formats().
  * @param[in] ctx   The standard client context, used for authentication and
  *              notification.
  * @param[in] pool  Used for any temporary allocation.
@@ -4401,8 +4401,8 @@ svn_client_cleanup(const char *dir,
  *
  * @a wc_format_version is the version number of the Subversion client
  * that supports a given WC metadata format; @c NULL means the library's
- * default format. The earliest supported version is returned by
- * svn_client_supported_wc_version().
+ * default format. See svn_client_default_wc_version(),
+ * svn_client_supported_wc_formats().
  *
  * Use @a scratch_pool for any temporary allocations.
  *
@@ -4428,13 +4428,40 @@ svn_client_upgrade(const char *wcroot_di
                    apr_pool_t *scratch_pool);
 
 /**
- * Returns the version related to the earliest supported
+ * Returns the version related to the library's default
  * working copy metadata format.
  *
  * @since New in 1.15.
  */
 const svn_version_t *
-svn_client_supported_wc_version(void);
+svn_client_default_wc_version(apr_pool_t *result_pool);
+
+/**
+ * Information about a WC version.
+ *
+ * Only the @c .major and @c .minor version fields are significant: so a
+ * version_max value of 1.15.0 for example means "up to 1.15.x".
+ */
+typedef struct svn_client_wc_format_t {
+    /* Oldest version of svn libraries known to support this WC version */
+    const svn_version_t *version_min;
+    /* Newest version of svn libraries known to support this WC version. */
+    const svn_version_t *version_max;
+    /* The WC format number of this format, as defined by libsvn_wc. */
+    int wc_format;
+} svn_client_wc_format_t;
+
+/**
+ * Returns a list of the WC formats supported by the client library.
+ *
+ * The list is sorted from oldest to newest, and terminated by an entry
+ * containing all null/zero fields.
+ *
+ * The returned data are allocated in @a result_pool and/or statically.
+ */
+const svn_client_wc_format_t *
+svn_client_supported_wc_formats(apr_pool_t *result_pool,
+                                apr_pool_t *scratch_pool);
 
 /** @} */
 

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=1898379&r1=1898378&r2=1898379&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 Thu Feb 24 16:19:04 2022
@@ -239,7 +239,7 @@ svn_client_checkout4(svn_revnum_t *resul
 
   /* A NULL wc_format_version translates to the default version. */
   if (!wc_format_version)
-    wc_format_version = svn_client_supported_wc_version();
+    wc_format_version = svn_client_default_wc_version(pool);
 
   err = svn_client__checkout_internal(result_rev, &sleep_here,
                                       URL, local_abspath,

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=1898379&r1=1898378&r2=1898379&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 Thu Feb 24 16:19:04 2022
@@ -41,6 +41,7 @@
 
 #include "svn_private_config.h"
 #include "private/svn_wc_private.h"
+#include "../libsvn_wc/wc.h"
 
 
 /*** Code. ***/
@@ -203,11 +204,25 @@ svn_client_upgrade2(const char *path,
   return SVN_NO_ERROR;
 }
 
+const svn_client_wc_format_t *
+svn_client_supported_wc_formats(apr_pool_t *result_pool,
+                                apr_pool_t *scratch_pool)
+{
+  static const svn_version_t version_1_8 = { 1, 8, 0, NULL };
+  static const svn_version_t version_1_15 = { 1, 15, 0, NULL };
+  static const svn_client_wc_format_t versions[] = {
+    { &version_1_8,   &version_1_15,  SVN_WC__SUPPORTED_VERSION },
+    { &version_1_15,  &version_1_15,  SVN_WC__VERSION           },
+    { NULL,           NULL,           0 }
+  };
+  return versions;
+}
+
 const svn_version_t *
-svn_client_supported_wc_version(void)
+svn_client_default_wc_version(apr_pool_t *result_pool)
 {
   /* NOTE: For consistency, always return the version of the client
-     that first introduced the earliest supported format. */
+     that first introduced the format. */
   static const svn_version_t version = { 1, 8, 0, NULL };
   return &version;
 }

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql?rev=1898379&r1=1898378&r2=1898379&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql Thu Feb 24 16:19:04 2022
@@ -785,6 +785,13 @@ PRAGMA user_version = 32;
 /* -- STMT_UPGRADE_TO_33
 PRAGMA user_version = 33; */
 
+/* ------------------------------------------------------------------------- */
+/* When bumping the format, also update:
+ *
+ *   * subversion/tests/libsvn_wc/wc-queries-test.c
+ *     (schema_statements, create_memory_db)
+ */
+
 
 /* ------------------------------------------------------------------------- */
 

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=1898379&r1=1898378&r2=1898379&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 Thu Feb 24 16:19:04 2022
@@ -169,7 +169,8 @@ extern "C" {
 #define SVN_WC__VERSION 32
 
 /* The minimum WC version supported by the client.
-   IMPORTANT: Update the implementation of svn_client_supported_wc_version()
+   IMPORTANT: Update the implementation of svn_client_default_wc_version()
+              and svn_client_supported_wc_formats()
               whenever you change this value! */
 #define SVN_WC__SUPPORTED_VERSION 31
 

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/svn/help-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/svn/help-cmd.c?rev=1898379&r1=1898378&r2=1898379&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/svn/help-cmd.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/svn/help-cmd.c Thu Feb 24 16:19:04 2022
@@ -41,6 +41,47 @@
 
 /*** Code. ***/
 
+/* Append a textual list of the supported WC formats to OUTPUT. */
+static svn_error_t *
+print_supported_wc_formats(svn_stringbuf_t *output,
+                           const char *prefix,
+                           apr_pool_t *pool)
+{
+  const svn_client_wc_format_t *wc_formats
+    = svn_client_supported_wc_formats(pool, pool);
+  int i;
+
+  for (i = 0; wc_formats[i].version_min; i++)
+    {
+      const svn_client_wc_format_t *v = &wc_formats[i];
+      const char *s;
+
+      if (v->version_min->major == v->version_min->major &&
+          v->version_min->minor == v->version_max->minor)
+        {
+          s = apr_psprintf(
+                pool,
+                _("%scompatible with Subversion v%d.%d (WC format %d)\n"),
+                prefix,
+                v->version_min->major, v->version_min->minor,
+                v->wc_format);
+        }
+      else
+        {
+          s = apr_psprintf(
+                pool,
+                _("%scompatible with Subversion v%d.%d to v%d.%d (WC format %d)\n"),
+                prefix,
+                v->version_min->major, v->version_min->minor,
+                v->version_max->major, v->version_max->minor,
+                v->wc_format);
+        }
+
+      svn_stringbuf_appendcstr(output, s);
+    }
+  return SVN_NO_ERROR;
+}
+
 /* This implements the `svn_opt_subcommand_t' interface. */
 svn_error_t *
 svn_cl__help(apr_getopt_t *os,
@@ -50,9 +91,6 @@ svn_cl__help(apr_getopt_t *os,
   svn_cl__opt_state_t *opt_state = NULL;
   svn_stringbuf_t *version_footer = svn_stringbuf_create_empty(pool);
   const char *config_path;
-  const svn_version_t* min_wc_version;
-  const svn_version_t* max_wc_version;
-  const char *wc_version_footer;
 
   char help_header[] =
   N_("usage: svn <subcommand> [options] [args]\n"
@@ -133,27 +171,17 @@ svn_cl__help(apr_getopt_t *os,
       opt_state = cmd_baton->opt_state;
     }
 
-  min_wc_version = svn_client_supported_wc_version();
-  max_wc_version = svn_client_version();
-  if (min_wc_version->major == max_wc_version->major
-      && min_wc_version->minor == max_wc_version->minor)
-    {
-      wc_version_footer =
-        apr_psprintf(pool,
-                     _("Supported working copy (WC) version: %d.%d\n\n"),
-                     min_wc_version->major, min_wc_version->minor);
-    }
-  else
-    {
-      wc_version_footer =
-        apr_psprintf(
-            pool,
-            _("Supported working copy (WC) versions: from %d.%d to %d.%d\n\n"),
-            min_wc_version->major, min_wc_version->minor,
-            max_wc_version->major, max_wc_version->minor);
-    }
-  svn_stringbuf_appendcstr(version_footer, wc_version_footer);
-
+  /*
+   * Show supported working copy versions.
+   */
+  svn_stringbuf_appendcstr(version_footer,
+                           _("Supported working copy (WC) formats:\n\n"));
+  SVN_ERR(print_supported_wc_formats(version_footer, "* ", pool));
+  svn_stringbuf_appendcstr(version_footer, "\n");
+
+  /*
+   * Show available repository access modules.
+   */
   svn_stringbuf_appendcstr(
       version_footer,
       _("The following repository access (RA) modules are available:\n\n"));

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/svn/svn.c?rev=1898379&r1=1898378&r2=1898379&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/svn/svn.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/svn/svn.c Thu Feb 24 16:19:04 2022
@@ -2031,11 +2031,12 @@ parse_compatible_version(svn_cl__opt_sta
   const char *utf8_opt_arg;
   svn_version_t *target;
 
-  /* Get the the latest and oldest supported version from the current
-     libsvn_client versions. WC formats are always defined by a X.Y.0
-     release, and svn_client_supported_wc_version() should return such
+  /* Get the supported WC formats.  WC formats are always defined by a X.Y.0
+     release, and svn_client_supported_wc_formats() should return such
      a value. */
-  const svn_version_t *supported = svn_client_supported_wc_version();
+  const svn_client_wc_format_t *formats_supported
+    = svn_client_supported_wc_formats(result_pool, result_pool);
+  const svn_version_t *supported = formats_supported[0].version_min;
   const svn_version_t *current = svn_client_version();
   const svn_version_t latest = {current->major, current->minor, 0, NULL};
 

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/davautocheck.sh?rev=1898379&r1=1898378&r2=1898379&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/davautocheck.sh Thu Feb 24 16:19:04 2022
@@ -88,7 +88,7 @@ PYTHON=${PYTHON:-python}
 
 SCRIPTDIR=$(dirname $0)
 SCRIPT=$(basename $0)
-STOPSCRIPT=$SCRIPTDIR/.$SCRIPT.stop
+STOPSCRIPT=$(pwd)/.$SCRIPT.stop
 
 trap stop_httpd_and_die HUP TERM INT
 

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout?rev=1898379&r1=1898378&r2=1898379&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout Thu Feb 24 16:19:04 2022
@@ -6,7 +6,10 @@ This software consists of contributions
 see the NOTICE file for more information.
 Subversion is open source software, see http://subversion.apache.org/
 
-Supported working copy (WC) versions: from 1.8 to 1.15
+Supported working copy (WC) formats:
+
+* compatible with Subversion v1.8 to v1.15 (WC format 31)
+* compatible with Subversion v1.15 (WC format 32)
 
 The following repository access (RA) modules are available:
 

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout?rev=1898379&r1=1898378&r2=1898379&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout Thu Feb 24 16:19:04 2022
@@ -6,7 +6,10 @@ This software consists of contributions
 see the NOTICE file for more information.
 Subversion is open source software, see http://subversion.apache.org/
 
-Supported working copy (WC) versions: from 1.8 to 1.15
+Supported working copy (WC) formats:
+
+* compatible with Subversion v1.8 to v1.15 (WC format 31)
+* compatible with Subversion v1.15 (WC format 32)
 
 The following repository access (RA) modules are available: