subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1820090 - in /subversion/branches/better-pristines/subversion: svn/help-cmd.c tests/cmdline/getopt_tests.py tests/cmdline/getopt_tests_data/svn--version--verbose_stdout tests/cmdline/getopt_tests_data/svn--version_stdout
Date Thu, 04 Jan 2018 13:26:07 GMT
Author: brane
Date: Thu Jan  4 13:26:07 2018
New Revision: 1820090

URL: http://svn.apache.org/viewvc?rev=1820090&view=rev
Log:
On the better-pristines branch: Show supported WC versions in help output.

* subversion/svn/help-cmd.c (svn_cl__help):
   Add a line to the 'svn --version' output that shows supported WC versions.

* subversion/tests/cmdline/getopt_tests.py
  (warn_line_re): Anchor the regular expression at the beginning of the line.
  (rep_lines_res): Canonicalize the supported WC versions line.

* subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout,
  subversion/tests/cmdline/getopt_tests_data/svn--version_stdout:
   Update expected output.

Modified:
    subversion/branches/better-pristines/subversion/svn/help-cmd.c
    subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests.py
    subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout
    subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout

Modified: subversion/branches/better-pristines/subversion/svn/help-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/svn/help-cmd.c?rev=1820090&r1=1820089&r2=1820090&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/svn/help-cmd.c (original)
+++ subversion/branches/better-pristines/subversion/svn/help-cmd.c Thu Jan  4 13:26:07 2018
@@ -32,6 +32,8 @@
 #include "svn_config.h"
 #include "svn_dirent_uri.h"
 #include "svn_error.h"
+#include "svn_version.h"
+#include "svn_client.h"
 #include "cl.h"
 
 #include "svn_private_config.h"
@@ -46,8 +48,11 @@ svn_cl__help(apr_getopt_t *os,
              apr_pool_t *pool)
 {
   svn_cl__opt_state_t *opt_state = NULL;
-  svn_stringbuf_t *version_footer = 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"
@@ -67,9 +72,6 @@ svn_cl__help(apr_getopt_t *os,
   N_("Subversion is a tool for version control.\n"
      "For additional information, see http://subversion.apache.org/\n");
 
-  const char *ra_desc_start
-    = _("The following repository access (RA) modules are available:\n\n");
-
   if (baton)
     {
       svn_cl__cmd_baton_t *const cmd_baton = baton;
@@ -121,10 +123,9 @@ svn_cl__help(apr_getopt_t *os,
 
       if (store_plaintext_passwords && store_auth_creds && store_passwords)
         {
-          version_footer = svn_stringbuf_create(
-              _("WARNING: Plaintext password storage is enabled!\n\n"),
-              pool);
-          svn_stringbuf_appendcstr(version_footer, ra_desc_start);
+          svn_stringbuf_appendcstr(
+              version_footer,
+              _("WARNING: Plaintext password storage is enabled!\n\n"));
         }
 #  endif /* !WIN32 */
 #endif /* !SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE */
@@ -132,8 +133,30 @@ svn_cl__help(apr_getopt_t *os,
       opt_state = cmd_baton->opt_state;
     }
 
-  if (!version_footer)
-    version_footer = svn_stringbuf_create(ra_desc_start, pool);
+  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);
+
+  svn_stringbuf_appendcstr(
+      version_footer,
+      _("The following repository access (RA) modules are available:\n\n"));
   SVN_ERR(svn_ra_print_modules(version_footer, pool));
 
   /*

Modified: subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests.py?rev=1820090&r1=1820089&r2=1820090&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests.py (original)
+++ subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests.py Thu Jan
 4 13:26:07 2018
@@ -60,7 +60,7 @@ def load_expected_output(basename):
   return exp_stdout, exp_stderr
 
 # With plaintext password storage enabled, `svn --version' emits a warning:
-warn_line_re = re.compile("WARNING: Plaintext password storage")
+warn_line_re = re.compile("^WARNING: Plaintext password storage")
 
 # This is a list of lines to delete.
 del_lines_res = [
@@ -99,6 +99,10 @@ rep_lines_res = [
                  # In 'svn --version --quiet', we print only the version
                  # number in a single line.
                  (re.compile(r'^\d+\.\d+\.\d+(-[a-zA-Z0-9]+)?$'), 'X.Y.Z\n'),
+
+                 # In svn --version, the supported WC versions vary.
+                 (re.compile(r'^Supported working copy (WC) version.*$'),
+                  'Supported working copy (WC) versions: from X.Y to X.Y')
                 ]
 
 # This is a trigger pattern that selects the secondary set of

Modified: subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout?rev=1820090&r1=1820089&r2=1820090&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout
(original)
+++ subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout
Thu Jan  4 13:26:07 2018
@@ -6,6 +6,8 @@ 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.11
+
 The following repository access (RA) modules are available:
 
 * ra_svn : Module for accessing a repository using the svn network protocol.

Modified: subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout?rev=1820090&r1=1820089&r2=1820090&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout
(original)
+++ subversion/branches/better-pristines/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout
Thu Jan  4 13:26:07 2018
@@ -6,6 +6,8 @@ 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.11
+
 The following repository access (RA) modules are available:
 
 * ra_svn : Module for accessing a repository using the svn network protocol.



Mime
View raw message