svn commit: r1898427 - /subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

2022-02-25 Thread danielsh
Author: danielsh
Date: Fri Feb 25 20:00:16 2022
New Revision: 1898427

URL: http://svn.apache.org/viewvc?rev=1898427=rev
Log:
Follow-up to r1898397:

* subversion/libsvn_wc/wc-metadata.sql
  (latest format): Add svn_client_latest_wc_version() to the list of places to
update upon creating a new format.

Modified:
subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1898427=1898426=1898427=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Fri Feb 25 20:00:16 
2022
@@ -720,6 +720,7 @@ PRAGMA user_version = 32;
  *
  *   * subversion/tests/libsvn_wc/wc-queries-test.c
  * (schema_statements, create_memory_db)
+ *   * The implementation of svn_client_latest_wc_version()
  */
 
 




Re: svn commit: r1898389 - in /subversion/trunk/subversion: include/svn_client.h libsvn_client/upgrade.c svn/info-cmd.c svn/svn.c

2022-02-25 Thread Daniel Shahaf
julianf...@apache.org wrote on Thu, Feb 24, 2022 at 20:06:32 -:
> Multi-WC-format, issue #4884: add svn info --show-item=wc-compatible-version.
> 
> +++ subversion/trunk/subversion/include/svn_client.h Thu Feb 24 20:06:32 2022
> @@ -4451,6 +4451,14 @@ typedef struct svn_client_wc_format_t {
> +/** Return the version of the Subversion library that first supported
> + * the given WC format, @a wc_format.
> + */
> +const svn_version_t *
> +svn_client__wc_version_from_format(int wc_format,
> +   apr_pool_t *result_pool,
> +   apr_pool_t *scratch_pool);
> +
> +++ subversion/trunk/subversion/libsvn_client/upgrade.c Thu Feb 24 20:06:32 
> 2022
> @@ -200,6 +200,34 @@ svn_client_upgrade2(const char *path,
> +const svn_version_t *
> +svn_client__wc_version_from_format(int wc_format,
> +   apr_pool_t *result_pool,
> +   apr_pool_t *scratch_pool)
> +{
> +  static const svn_version_t
> +version_1_0  = { 1, 0, 0, NULL },
> +version_1_4  = { 1, 4, 0, NULL },
> +version_1_5  = { 1, 5, 0, NULL },
> +version_1_6  = { 1, 6, 0, NULL },
> +version_1_7  = { 1, 7, 0, NULL },
> +version_1_8  = { 1, 8, 0, NULL },
> +version_1_15 = { 1, 15, 0, NULL };
> +
> +  switch (wc_format)
> +{
> +  case  4: return _1_0;
> +  case  8: return _1_4;
> +  case  9: return _1_5;
> +  case 10: return _1_6;
> +  case SVN_WC__WC_NG_VERSION: return _1_7;

SVN_WC__WC_NG_VERSION is declared in wc.h, which this file isn't allowed
to use.

Why does this function special-case f12 over all other format numbers
only created by unreleased trunk revisions?  Why is f12 handled
differently to f6, f11, f13, f25, and f30?  It seems to me we should
either return NULL for all of them, or return the appropriate
svn_version_t value for each of them (and for all other integers between
11 and 28), as needed.

> +  case 29: return _1_7;
> +  case 31: return _1_8;
> +  case 32: return _1_15;
> +}
> +  return NULL;
> +}

> +++ subversion/trunk/subversion/svn/info-cmd.c Thu Feb 24 20:06:32 2022
> @@ -397,6 +399,8 @@ static const info_item_map_t info_item_m
>  { SVN__STATIC_STRING("depth"),   info_item_depth },
>  { SVN__STATIC_STRING("changelist"),  info_item_changelist },
>  { SVN__STATIC_STRING("wc-format"),   info_item_wc_format },
> +{ SVN__STATIC_STRING("wc-compatible-version"),
> + 
> info_item_wc_compatible_version },

The trailing comma is not C89-compatible and used to break the Windows
build.

>};

Cheers,

Daniel


Re: svn commit: r1898378 - in /subversion/trunk/subversion: include/ libsvn_client/ libsvn_wc/ svn/ tests/cmdline/getopt_tests_data/

2022-02-25 Thread Daniel Shahaf
julianf...@apache.org wrote on Thu, Feb 24, 2022 at 15:58:11 -:
> Multi-WC-format: Clarify the supported versions display.
> 
> This patch:
> 
>   - Changes the APIs for querying the default WC format and the supported WC
> formats;
>   - clarifies the display of supported WC formats in 'svn --version'.
> 
> API changes:
> 
>   - Remove svn_client_supported_wc_version().
>   - Add svn_client_default_wc_version().
>   - Add svn_client_supported_wc_formats() and a type it returns.
> 

Looks good.  Just a few comments:

> CLI changes:
> 
>   Old display in 'svn --version':
> 
>   | Supported working copy (WC) versions: from 1.8 to 1.15
> 
>   New display in 'svn --version':
> 
>   | Supported working copy (WC) versions:
>   |
>   | * compatible with Subversion v1.8 to v1.15 (WC format 31)
>   | * compatible with Subversion v1.15 (WC format 32)

Nice!

> The list style, along with inclusion of the WC format number, helps show
> that each line describes a distinct format. Users sometimes also need to
> know about WC format numbers, and the 'version' command is an appropriate
> place to show these. The presentation style matches that used for the lists
> of RA modules and credential caches.
> 
> * subversion/include/svn_client.h,
>   subversion/libsvn_client/upgrade.c
>   (svn_client_checkout4,
>svn_client_upgrade2): Update doc string.
>   (svn_client_supported_wc_version): Remove.
>   (svn_client_default_wc_version,
>svn_client_wc_format_t,
>svn_client_supported_wc_formats): New.
> 
> * subversion/libsvn_client/checkout.c
>   (svn_client_checkout4): Update caller: use svn_client_default_wc_version().
> 
> * subversion/libsvn_wc/wc.h
>   (SVN_WC__SUPPORTED_VERSION): Update doc string.
> 
> * subversion/svn/help-cmd.c
>   (print_supported_wc_formats): New.
>   (svn_cl__help): Use it to display supported WC formats as a list.
> 
> * subversion/svn/svn.c
>   (parse_compatible_version): Update caller: use
> svn_client_supported_wc_formats().
> 
> * subversion/tests/cmdline/getopt_tests_data/svn--version_stdout,
>   subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout
> Update expected output.

> +++ subversion/trunk/subversion/include/svn_client.h Thu Feb 24 15:58:10 2022
> @@ -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".

Missing @since.

Missing warning not to manually allocate structs of this type since
fields may be added in the future.

> + */
> +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.

Missing @since.

> + */
> +const svn_client_wc_format_t *
> +svn_client_supported_wc_formats(apr_pool_t *result_pool,
> +apr_pool_t *scratch_pool);

> +++ subversion/trunk/subversion/libsvn_client/upgrade.c Thu Feb 24 15:58:10 
> 2022
> @@ -41,6 +41,7 @@
>  
>  #include "svn_private_config.h"
>  #include "private/svn_wc_private.h"
> +#include "../libsvn_wc/wc.h"

I don't think libsvn_client is allowed to use this header.

libsvn_foo/bar.h headers are for internal use by libsvn_foo, not for
interlibrary use; that would be include/private/.  We generally follow
this, too:

% grep -R 'include.*[.][.]/libsvn' subversion/lib* | grep -Eo '[<"].*[">]' | 
sort | uniq -c 
 14 "../../libsvn_fs/fs-loader.h"
  2 "../libsvn_delta/delta.h"
 53 "../libsvn_fs/fs-loader.h"
  1 "../libsvn_fs_base/fs_init.h"
  1 "../libsvn_fs_fs/fs_init.h"
  1 "../libsvn_fs_x/fs_init.h"
 24 "../libsvn_ra/ra_loader.h"
  3 "../libsvn_ra/wrapper_template.h"
% 

The RA/FS ones are presumably related to the pluggable design of those
layers.  (Sorry, I haven't got time to confirm this in detail.)

The delta.h one is in FSFS/FSX, which, as the comment there claims, use
SVN_DELTA_WINDOW_SIZE and nothing else declared or #define'd in that