You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ko...@apache.org on 2023/03/22 15:08:01 UTC
svn commit: r1908636 [2/2] - in /subversion/branches/pristine-checksum-kind: ./ build/ build/ac-macros/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_fs/ subversion/libsvn_fs_x/ subversion/libsvn_subr/ s...
Modified: subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/store_pristine_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/store_pristine_tests.py?rev=1908636&r1=1908635&r2=1908636&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/store_pristine_tests.py (original)
+++ subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/store_pristine_tests.py Wed Mar 22 15:08:00 2023
@@ -59,7 +59,6 @@ def simple_checkout_with_pristine(sbox):
'info', '--show-item=store-pristine', '--no-newline',
sbox.wc_dir)
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
def simple_checkout_without_pristine(sbox):
"simple checkout without pristine"
@@ -108,7 +107,6 @@ def simple_commit_with_pristine(sbox):
expected_output,
expected_status)
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
def simple_commit_without_pristine(sbox):
"simple commit without pristine"
@@ -181,7 +179,6 @@ def simple_update_with_pristine(sbox):
[], False,
'-r1', sbox.wc_dir)
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
def simple_update_without_pristine(sbox):
"simple update without pristine"
@@ -278,7 +275,6 @@ def simple_status_with_pristine(sbox):
svntest.actions.run_and_verify_status(sbox.wc_dir,
expected_status)
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
def simple_status_without_pristine(sbox):
"simple status without pristine"
@@ -366,7 +362,6 @@ def simple_diff_with_pristine(sbox):
svntest.actions.run_and_verify_svn(diff_output, [],
'diff', sbox.ospath('file'))
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
def simple_diff_without_pristine(sbox):
"simple diff without pristine"
@@ -431,7 +426,6 @@ def simple_revert_with_pristine(sbox):
svntest.actions.run_and_verify_status(sbox.wc_dir,
expected_status)
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
def simple_revert_without_pristine(sbox):
"simple revert without pristine"
@@ -508,7 +502,6 @@ def update_modified_file_with_pristine(s
expected_disk,
expected_status)
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
def update_modified_file_without_pristine(sbox):
"update locally modified file without pristine"
@@ -586,7 +579,6 @@ def simple_copy_with_pristine(sbox):
svntest.actions.run_and_verify_status(sbox.wc_dir,
expected_status)
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
def simple_copy_without_pristine(sbox):
"simple copy without pristine"
@@ -655,7 +647,6 @@ def copy_modified_file_with_pristine(sbo
svntest.actions.run_and_verify_status(sbox.wc_dir,
expected_status)
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
def copy_modified_file_without_pristine(sbox):
"copy locally modified file without pristine"
@@ -724,7 +715,6 @@ def simple_move_with_pristine(sbox):
svntest.actions.run_and_verify_status(sbox.wc_dir,
expected_status)
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
def simple_move_without_pristine(sbox):
"simple move without pristine"
@@ -793,7 +783,6 @@ def move_modified_file_with_pristine(sbo
svntest.actions.run_and_verify_status(sbox.wc_dir,
expected_status)
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
def move_modified_file_without_pristine(sbox):
"move locally modified file without pristine"
@@ -829,7 +818,6 @@ def move_modified_file_without_pristine(
svntest.actions.run_and_verify_status(sbox.wc_dir,
expected_status)
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
def checkout_incompatible_setting(sbox):
"checkout with incompatible pristine setting"
@@ -862,6 +850,100 @@ def checkout_incompatible_setting(sbox):
'info', '--show-item=store-pristine', '--no-newline',
sbox.wc_dir)
+def copy_cross_wc_without_src_pristine(sbox):
+ "cross-wc copy without src pristine"
+
+ sbox.build(empty=True, create_wc=False)
+
+ expected_output = svntest.wc.State(sbox.wc_dir, {})
+ expected_wc = svntest.wc.State('', {})
+ svntest.actions.run_and_verify_checkout(sbox.repo_url,
+ sbox.wc_dir,
+ expected_output,
+ expected_wc,
+ [],
+ '--store-pristine=no')
+ svntest.actions.run_and_verify_svn(
+ ['no'], [],
+ 'info', '--show-item=store-pristine', '--no-newline',
+ sbox.wc_dir)
+
+ sbox.simple_append('file', 'foo')
+ sbox.simple_add('file')
+ sbox.simple_commit(message='r1')
+
+ wc_dir2 = sbox.add_wc_path("other")
+ expected_output = svntest.wc.State(wc_dir2, {})
+ expected_wc = svntest.wc.State('', {})
+ svntest.actions.run_and_verify_checkout(sbox.repo_url,
+ wc_dir2,
+ expected_output,
+ expected_wc,
+ [],
+ '--store-pristine=yes', '-r0')
+ svntest.actions.run_and_verify_svn(
+ ['yes'], [],
+ 'info', '--show-item=store-pristine', '--no-newline',
+ wc_dir2)
+
+ svntest.actions.run_and_verify_svn(None, [], 'copy',
+ sbox.ospath('file'),
+ wc_dir2)
+
+ expected_status = svntest.wc.State(wc_dir2, {
+ '' : Item(status=' ', wc_rev=0),
+ 'file' : Item(status='A ', wc_rev='-', copied='+'),
+ })
+ svntest.actions.run_and_verify_status(wc_dir2,
+ expected_status)
+
+def copy_cross_wc_without_dst_pristine(sbox):
+ "cross-wc copy without dst pristine"
+
+ sbox.build(empty=True, create_wc=False)
+
+ expected_output = svntest.wc.State(sbox.wc_dir, {})
+ expected_wc = svntest.wc.State('', {})
+ svntest.actions.run_and_verify_checkout(sbox.repo_url,
+ sbox.wc_dir,
+ expected_output,
+ expected_wc,
+ [],
+ '--store-pristine=yes')
+ svntest.actions.run_and_verify_svn(
+ ['yes'], [],
+ 'info', '--show-item=store-pristine', '--no-newline',
+ sbox.wc_dir)
+
+ sbox.simple_append('file', 'foo')
+ sbox.simple_add('file')
+ sbox.simple_commit(message='r1')
+
+ wc_dir2 = sbox.add_wc_path("other")
+ expected_output = svntest.wc.State(wc_dir2, {})
+ expected_wc = svntest.wc.State('', {})
+ svntest.actions.run_and_verify_checkout(sbox.repo_url,
+ wc_dir2,
+ expected_output,
+ expected_wc,
+ [],
+ '--store-pristine=no', '-r0')
+ svntest.actions.run_and_verify_svn(
+ ['no'], [],
+ 'info', '--show-item=store-pristine', '--no-newline',
+ wc_dir2)
+
+ svntest.actions.run_and_verify_svn(None, [], 'copy',
+ sbox.ospath('file'),
+ wc_dir2)
+
+ expected_status = svntest.wc.State(wc_dir2, {
+ '' : Item(status=' ', wc_rev=0),
+ 'file' : Item(status='A ', wc_rev='-', copied='+'),
+ })
+ svntest.actions.run_and_verify_status(wc_dir2,
+ expected_status)
+
########################################################################
# Run the tests
@@ -891,6 +973,8 @@ test_list = [ None,
move_modified_file_with_pristine,
move_modified_file_without_pristine,
checkout_incompatible_setting,
+ copy_cross_wc_without_src_pristine,
+ copy_cross_wc_without_dst_pristine,
]
serial_only = True
Modified: subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/svntest/main.py?rev=1908636&r1=1908635&r2=1908636&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/svntest/main.py Wed Mar 22 15:08:00 2023
@@ -211,6 +211,9 @@ svnauthz_validate_binary = os.path.abspa
)
svnmover_binary = os.path.abspath('../../../tools/dev/svnmover/svnmover' + _exe)
+# Where to find the libtool script created during build
+libtool_script = os.path.abspath('../../../libtool')
+
# Location to the pristine repository, will be calculated from test_area_url
# when we know what the user specified for --url.
pristine_greek_repos_url = None
@@ -508,6 +511,13 @@ def open_pipe(command, bufsize=-1, stdin
if command[0].endswith('.py'):
command.insert(0, sys.executable)
+ if options.valgrind:
+ if os.path.basename(command[0]) in options.valgrind.split(','):
+ valgrind = [libtool_script, '--mode=execute', 'valgrind', '--quiet']
+ if options.valgrind_opts is not None:
+ valgrind += options.valgrind_opts.split(' ')
+ command = valgrind + command
+
command_string = command[0] + ' ' + ' '.join(map(_quote_arg, command[1:]))
if not stdin:
@@ -691,7 +701,7 @@ def run_command_stdin(command, error_exp
def create_config_dir(cfgdir, config_contents=None, server_contents=None,
ssl_cert=None, ssl_url=None, http_proxy=None,
- exclusive_wc_locks=None):
+ exclusive_wc_locks=None, wc_format_version=None):
"Create config directories and files"
# config file names
@@ -711,12 +721,14 @@ password-stores =
[miscellany]
interactive-conflicts = false
-"""
- if exclusive_wc_locks:
- config_contents += """
+
[working-copy]
-exclusive-locking = true
"""
+ if exclusive_wc_locks:
+ config_contents += "exclusive-locking = true\n"
+ if wc_format_version:
+ config_contents += ("compatible-version = %s\n" % wc_format_version)
+
# define default server file contents if none provided
if server_contents is None:
http_library_str = ""
@@ -812,18 +824,6 @@ def _with_store_pristine(args):
return args + ('--store-pristine', options.store_pristine)
return args
-def _with_wc_format_version(args):
- if '--compatible-version' in args \
- or any(str(one_arg).startswith('--compatible-version=') for one_arg in args) \
- or options.wc_format_version is None:
- return args
- non_opt_args = [a for a in args if not str(a).startswith('-')]
- if non_opt_args:
- subcommand = non_opt_args[0]
- if subcommand in ['co', 'checkout', 'upgrade']:
- return args + ('--compatible-version', options.wc_format_version)
- return args
-
def _with_config_dir(args):
if '--config-dir' in args:
return args
@@ -859,8 +859,8 @@ def run_svn(error_expected, *varargs):
you're just checking that something does/doesn't come out of
stdout/stderr, you might want to use actions.run_and_verify_svn()."""
return run_command(svn_binary, error_expected, False,
- *(_with_store_pristine(_with_wc_format_version(
- _with_auth(_with_config_dir(varargs))))))
+ *(_with_store_pristine(
+ _with_auth(_with_config_dir(varargs)))))
# For running svnadmin. Ignores the output.
def run_svnadmin(*varargs):
@@ -1405,7 +1405,7 @@ def write_restrictive_svnserve_conf(repo
fp.write("groups-db = groups\n")
if options.enable_sasl:
fp.write("realm = svntest\n"
- "[sasl]\n",
+ "[sasl]\n"
"use-sasl = true\n");
else:
fp.write("password-db = passwd\n")
@@ -1778,12 +1778,6 @@ def wc_format(ver=None):
return 31
raise Exception("Unrecognized version number '%s'" % (ver,))
-def wc_supports_optional_pristine():
- if options.wc_format_version is None:
- return True
- else:
- return wc_format(options.wc_format_version) >= 32
-
######################################################################
@@ -1872,6 +1866,10 @@ class TestSpawningThread(threading.Threa
args.append('--bin=' + options.svn_bin)
if options.store_pristine:
args.append('--store-pristine=' + options.store_pristine)
+ if options.valgrind:
+ args.append('--valgrind=' + options.valgrind)
+ if options.valgrind_opts:
+ args.append('--valgrind-opts=' + options.valgrind_opts)
result, stdout_lines, stderr_lines = spawn_process(command, 0, False, None,
*args)
@@ -2313,6 +2311,10 @@ def _create_parser(usage=None):
help='Run tests that connect to remote HTTP(S) servers')
parser.add_option('--store-pristine', action='store', type='str',
help='Set the WC pristine mode')
+ parser.add_option('--valgrind', action='store',
+ help='programs to run under valgrind')
+ parser.add_option('--valgrind-opts', action='store',
+ help='options to pass to valgrind')
# most of the defaults are None, but some are other values, set them here
parser.set_defaults(
@@ -2671,7 +2673,8 @@ def execute_tests(test_list, serial_only
ssl_cert=options.ssl_cert,
ssl_url=options.test_area_url,
http_proxy=options.http_proxy,
- exclusive_wc_locks=options.exclusive_wc_locks)
+ exclusive_wc_locks=options.exclusive_wc_locks,
+ wc_format_version=options.wc_format_version)
# Setup the pristine repositories
svntest.actions.setup_pristine_repositories()
Modified: subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/upgrade_tests.py?rev=1908636&r1=1908635&r2=1908636&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/upgrade_tests.py Wed Mar 22 15:08:00 2023
@@ -1583,8 +1583,6 @@ def upgrade_1_0_with_externals(sbox):
})
run_and_verify_status_no_server(sbox.wc_dir, expected_status)
-@XFail()
-@SkipUnless(lambda: svntest.main.options.wc_format_version is None)
def upgrade_latest_format(sbox):
"upgrade latest format without arguments"
@@ -1599,11 +1597,59 @@ def upgrade_latest_format(sbox):
[],
'--compatible-version',
latest_ver)
- # XFAIL:
+ # This used to fail with the following error:
# svn: E155021: Working copy '...' is already at version 1.15 (format 32)
# and cannot be downgraded to version 1.8 (format 31)
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
+ check_format(sbox, svntest.main.wc_format(latest_ver))
+
+def upgrade_compatible_version_arg(sbox):
+ "upgrade with compatible-version from arg"
+
+ sbox.build(empty=True, create_wc=False)
+ expected_output = svntest.wc.State(sbox.wc_dir, {})
+ expected_disk = svntest.wc.State('', {})
+ svntest.actions.run_and_verify_checkout(
+ sbox.repo_url, sbox.wc_dir, expected_output, expected_disk, [],
+ '--compatible-version', '1.8', '--store-pristine=yes')
+ svntest.actions.run_and_verify_svn(
+ ['1.8'], [],
+ 'info', '--show-item=wc-compatible-version', '--no-newline',
+ sbox.wc_dir)
+
+ svntest.actions.run_and_verify_svn(
+ None, [], 'upgrade',
+ '--compatible-version', '1.15',
+ sbox.wc_dir)
+ svntest.actions.run_and_verify_svn(
+ ['1.15'], [],
+ 'info', '--show-item=wc-compatible-version', '--no-newline',
+ sbox.wc_dir)
+
+def upgrade_compatible_version_config(sbox):
+ "upgrade with compatible-version from config"
+
+ sbox.build(empty=True, create_wc=False)
+ expected_output = svntest.wc.State(sbox.wc_dir, {})
+ expected_disk = svntest.wc.State('', {})
+ svntest.actions.run_and_verify_checkout(
+ sbox.repo_url, sbox.wc_dir, expected_output, expected_disk, [],
+ '--compatible-version', '1.8', '--store-pristine=yes')
+ svntest.actions.run_and_verify_svn(
+ ['1.8'], [],
+ 'info', '--show-item=wc-compatible-version', '--no-newline',
+ sbox.wc_dir)
+
+ svntest.actions.run_and_verify_svn(
+ None, [], 'upgrade',
+ '--config-option', 'config:working-copy:compatible-version=1.15',
+ sbox.wc_dir)
+ svntest.actions.run_and_verify_svn(
+ ['1.15'], [],
+ 'info', '--show-item=wc-compatible-version', '--no-newline',
+ sbox.wc_dir)
+
########################################################################
# Run the tests
@@ -1661,6 +1707,8 @@ test_list = [ None,
auto_analyze,
upgrade_1_0_with_externals,
upgrade_latest_format,
+ upgrade_compatible_version_arg,
+ upgrade_compatible_version_config,
]
Modified: subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_client/client-test.c?rev=1908636&r1=1908635&r2=1908636&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_client/client-test.c Wed Mar 22 15:08:00 2023
@@ -449,6 +449,7 @@ test_wc_add_scenarios(const svn_test_opt
const char *ex_file_path;
const char *ex_dir_path;
const char *ex2_dir_path;
+ svn_boolean_t store_pristine;
/* Create a filesystem and repository containing the Greek tree. */
SVN_ERR(create_greek_repos(&repos_url, "test-wc-add-repos", opts, pool));
@@ -472,6 +473,12 @@ test_wc_add_scenarios(const svn_test_opt
opts->store_pristine,
ctx, pool));
+ SVN_ERR(svn_wc__get_settings(NULL, &store_pristine, NULL, ctx->wc_ctx,
+ wc_path, pool));
+ if (!store_pristine)
+ return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
+ "Test assumes a working copy with pristine");
+
/* Now checkout again as wc_path/NEW */
new_dir_path = svn_dirent_join(wc_path, "NEW", pool);
SVN_ERR(svn_client_checkout4(NULL, repos_url, new_dir_path, &peg_rev, &rev,
Modified: subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_fs/fs-test.c?rev=1908636&r1=1908635&r2=1908636&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_fs/fs-test.c Wed Mar 22 15:08:00 2023
@@ -4990,10 +4990,17 @@ unordered_txn_dirprops(const svn_test_op
/* Commit the second one first. */
SVN_ERR(test_commit_txn(&new_rev, txn2, NULL, pool));
- /* Then commit the first -- but expect a conflict due to the
- propchanges made by the other txn. */
- SVN_ERR(test_commit_txn(¬_rev, txn, "/A/B", pool));
- SVN_ERR(svn_fs_abort_txn(txn, pool));
+ if (is_bdb)
+ {
+ /* Then commit the first -- but expect a conflict due to the
+ propchanges made by the other txn. */
+ SVN_ERR(test_commit_txn(¬_rev, txn, "/A/B", pool));
+ SVN_ERR(svn_fs_abort_txn(txn, pool));
+ }
+ else
+ {
+ SVN_ERR(test_commit_txn(&new_rev, txn, NULL, pool));
+ }
/* Now, let's try those in reverse. Open two transactions */
SVN_ERR(svn_fs_begin_txn(&txn, fs, new_rev, pool));
@@ -5641,16 +5648,16 @@ dir_prop_merge(const svn_test_opts_t *op
{
SVN_ERR(test_commit_txn(&head_rev, top_txn, "/A", pool));
SVN_ERR(svn_fs_abort_txn(top_txn, pool));
+
+ SVN_ERR(test_commit_txn(&head_rev, sub_txn, "/A/D", pool));
+ SVN_ERR(svn_fs_abort_txn(sub_txn, pool));
}
else
{
SVN_ERR(test_commit_txn(&head_rev, top_txn, NULL, pool));
+ SVN_ERR(test_commit_txn(&head_rev, sub_txn, NULL, pool));
}
- /* The inverted case is not that trivial to handle. Hence, conflict.
- Depending on the checking order, the reported conflict path differs. */
- SVN_ERR(test_commit_txn(&head_rev, sub_txn, is_bdb ? "/A/D" : "/A", pool));
- SVN_ERR(svn_fs_abort_txn(sub_txn, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_wc/wc-queries-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1908636&r1=1908635&r2=1908636&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_wc/wc-queries-test.c Wed Mar 22 15:08:00 2023
@@ -247,12 +247,9 @@ stmt_matches_wc_format(int stmt_num,
case STMT_INSERT_OR_IGNORE_PRISTINE_F31:
case STMT_UPSERT_PRISTINE_F31:
case STMT_SELECT_PRISTINE_F31:
- case STMT_SELECT_COPY_PRISTINES_F31:
- return (wc_format <= 31);
case STMT_INSERT_OR_IGNORE_PRISTINE_F32:
case STMT_UPSERT_PRISTINE_F32:
case STMT_SELECT_PRISTINE_F32:
- case STMT_SELECT_COPY_PRISTINES_F32:
case STMT_UPDATE_PRISTINE_HYDRATED:
case STMT_TEXTBASE_ADD_REF:
case STMT_TEXTBASE_REMOVE_REF: