Author: danielsh
Date: Tue Mar 8 18:33:54 2022
New Revision: 1898740
URL: http://svn.apache.org/viewvc?rev=1898740&view=rev
Log:
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.
Modified:
subversion/branches/pristines-on-demand-on-mwf/subversion/svn/upgrade-cmd.c
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py
Modified:
subversion/branches/pristines-on-demand-on-mwf/subversion/svn/upgrade-cmd.c
URL:
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/svn/upgrade-cmd.c?rev=1898740&r1=1898739&r2=1898740&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/svn/upgrade-cmd.c
(original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/svn/upgrade-cmd.c
Tue Mar 8 18:33:54 2022
@@ -83,11 +83,9 @@ 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)
Modified:
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py
URL:
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py?rev=1898740&r1=1898739&r2=1898740&view=diff
==============================================================================
---
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py
(original)
+++
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py
Tue Mar 8 18:33:54 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'),
@@ -1039,8 +1048,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, {