Author: danielsh
Date: Thu Mar 17 21:00:18 2022
New Revision: 1899003
URL: http://svn.apache.org/viewvc?rev=1899003&view=rev
Log:
On trunk, cherry-pick r1898739, r1898740, r1898741 from the
pristines-on-demand-on-mwf branch.
------------------------------------------------------------------------
r1898739 | danielsh | 2022-03-08 17:41:51 +0000 (Tue, 08 Mar 2022) | 13
lines
On the pristines-on-demand-on-mwf branch: Add the WC format and version to
`svn
info`'s other output modes.
This finishes SVN-4884.
* subversion/svn/info-cmd.c
(print_info_xml,
print_info): Emit the equivalents of --show-item=wc-version and
--show-item=wc-compatible-version.
* subversion/svn/schema/info.rnc
(wc-info): New children wc-compatible-version and wc-format.
(wc-compatible-version, wc-format): New elements.
------------------------------------------------------------------------
r1898740 | danielsh | 2022-03-08 18:33:54 +0000 (Tue, 08 Mar 2022) | 12
lines
On the pristines-on-demand-on-mwf branch, show an informational message in
more cases.
Part of SVN-4885.
* subversion/svn/upgrade-cmd.c
(svn_cl__upgrade): Show the "You can upgrade further" message even when
the
command was a no-op.
* subversion/tests/cmdline/upgrade_tests.py
(dirs_only_upgrade, upgrade_with_missing_subdir): Ensure the message is
not
generated by passing --compatible-version's default value explicitly.
(target_ver): New helper function.
------------------------------------------------------------------------
r1898741 | danielsh | 2022-03-08 18:36:38 +0000 (Tue, 08 Mar 2022) | 9 lines
On the pristines-on-demand-on-mwf branch, copyedit an informational message.
Part of SVN-4885, but the discussion there did not account for the fact that
there is no single working copy (target) name available in this context.
* subversion/svn/upgrade-cmd.c
(svn_cl__upgrade): Have the output identify the program that generated
it. Use plural since this is an overall message relevant to one or
more targets.
------------------------------------------------------------------------
Modified:
subversion/trunk/ (props changed)
subversion/trunk/subversion/svn/info-cmd.c
subversion/trunk/subversion/svn/schema/info.rnc
subversion/trunk/subversion/svn/upgrade-cmd.c
subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
Propchange: subversion/trunk/
------------------------------------------------------------------------------
Merged /subversion/branches/pristines-on-demand-on-mwf:r1898739-1898741
Modified: subversion/trunk/subversion/svn/info-cmd.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/info-cmd.c?rev=1899003&r1=1899002&r2=1899003&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/info-cmd.c (original)
+++ subversion/trunk/subversion/svn/info-cmd.c Thu Mar 17 21:00:18 2022
@@ -592,6 +592,21 @@ print_info_xml(void *baton,
svn_cl__xml_tagged_cdata(&sb, pool, "wcroot-abspath",
info->wc_info->wcroot_abspath);
+ /* "<wc-compatible-version> xx </wc-compatible-version>" */
+ /* "<wc-format> xx </wc-format>" */
+ if (info->wc_info->wc_format > 0)
+ {
+ const svn_version_t *wc_ver
+ = svn_client_wc_version_from_format(info->wc_info->wc_format,
pool);
+
+ svn_cl__xml_tagged_cdata(&sb, pool, "wc-compatible-version",
+ apr_psprintf(pool, "%d.%d", wc_ver->major,
+ wc_ver->minor));
+ svn_cl__xml_tagged_cdata(&sb, pool, "wc-format",
+ apr_psprintf(pool, "%d",
+ info->wc_info->wc_format));
+ }
+
/* "<schedule> xx </schedule>" */
svn_cl__xml_tagged_cdata(&sb, pool, "schedule",
schedule_str(info->wc_info->schedule));
@@ -737,6 +752,18 @@ print_info(void *baton,
info->wc_info->wcroot_abspath,
pool)));
+ if (info->wc_info && info->wc_info->wc_format > 0)
+ {
+ const svn_version_t *wc_ver
+ = svn_client_wc_version_from_format(info->wc_info->wc_format, pool);
+
+ SVN_ERR(svn_cmdline_printf(pool, _("Working Copy Compatible With
Version: %d.%d\n"),
+ wc_ver->major, wc_ver->minor));
+ SVN_ERR(svn_cmdline_printf(pool, _("Working Copy Format: %d\n"),
+ info->wc_info->wc_format));
+ }
+
+
if (info->URL)
SVN_ERR(svn_cmdline_printf(pool, _("URL: %s\n"), info->URL));
Modified: subversion/trunk/subversion/svn/schema/info.rnc
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/schema/info.rnc?rev=1899003&r1=1899002&r2=1899003&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/schema/info.rnc (original)
+++ subversion/trunk/subversion/svn/schema/info.rnc Thu Mar 17 21:00:18 2022
@@ -57,6 +57,8 @@ uuid = element uuid { uuid.type }
wc-info =
element wc-info {
wcroot-abspath?,
+ wc-compatible-version?,
+ wc-format?,
schedule?,
changelist?,
copy-from-url?,
@@ -70,6 +72,8 @@ wc-info =
}
wcroot-abspath = element wcroot-abspath { string }
+wc-compatible-version = element wc-compatible-version { string }
+wc-format = element wc-format { xsd:nonNegativeInteger }
schedule =
element schedule { "normal" | "add" | "delete" | "replace" | "none" }
Modified: subversion/trunk/subversion/svn/upgrade-cmd.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/upgrade-cmd.c?rev=1899003&r1=1899002&r2=1899003&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/upgrade-cmd.c (original)
+++ subversion/trunk/subversion/svn/upgrade-cmd.c Thu Mar 17 21:00:18 2022
@@ -83,18 +83,16 @@ svn_cl__upgrade(apr_getopt_t *os,
svn_pool_destroy(iterpool);
/* Remind the user they can upgrade further if:
- * - no upgrade was performed
* - the user did not specify compatible-version explicitly
* - a higher version is available. */
- if (! svn_cl__notifier_get_wc_was_upgraded(ctx->notify_baton2)
- && ! opt_state->compatible_version
+ if (! opt_state->compatible_version
&& ! svn_version__at_least(default_version,
latest_version->major, latest_version->minor,
0)
&& ! opt_state->quiet)
{
const char *msg
- = _("Working copy is already at version %d.%d. "
- "The highest version supported by this client can be "
+ = _("svn: The target working copies are already at version %d.%d; "
+ "the highest version supported by this client can be "
"specified with '--compatible-version=%d.%d'.\n");
SVN_ERR(svn_cmdline_printf(scratch_pool, msg,
default_version->major,
default_version->minor,
Modified: subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/upgrade_tests.py?rev=1899003&r1=1899002&r2=1899003&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/upgrade_tests.py Thu Mar 17
21:00:18 2022
@@ -58,6 +58,11 @@ def get_current_format():
"""Get the expected WC format."""
return svntest.main.wc_format()
+def target_ver():
+ """Get the default value of --compatible-version to use.
+
+ Compare svntest.main.wc_format()."""
+ return (svntest.main.options.wc_format_version or
svntest.main.DEFAULT_COMPATIBLE_VERSION)
def replace_sbox_with_tarfile(sbox, tar_filename,
dir=None):
@@ -772,8 +777,12 @@ def dirs_only_upgrade(sbox):
expected_output = ["Upgraded '%s'\n" % (sbox.ospath('').rstrip(os.path.sep)),
"Upgraded '%s'\n" % (sbox.ospath('A'))]
+ # Pass --compatible-version explicitly to silence the "You upgraded to
+ # a version other than the latest" message.
svntest.actions.run_and_verify_svn(expected_output, [],
- 'upgrade', sbox.wc_dir)
+ 'upgrade', sbox.wc_dir,
+ '--compatible-version',
+ target_ver())
expected_status = svntest.wc.State(sbox.wc_dir, {
'' : Item(status=' ', wc_rev='1'),
@@ -1038,8 +1047,12 @@ def upgrade_with_missing_subdir(sbox):
"Upgraded '%s'\n" % sbox.ospath('A/D/G'),
"Upgraded '%s'\n" % sbox.ospath('A/D/H'),
])
+ # Pass --compatible-version explicitly to silence the "You upgraded to
+ # a version other than the latest" message.
svntest.actions.run_and_verify_svn(expected_output, [],
- 'upgrade', sbox.wc_dir)
+ 'upgrade', sbox.wc_dir,
+ '--compatible-version',
+ target_ver())
# And now perform an update. (This used to fail with an assertion)
expected_output = svntest.wc.State(wc_dir, {