You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2014/11/04 12:40:19 UTC
svn commit: r1636544 [13/13] - in
/subversion/branches/remove-log-addressing: ./
subversion/bindings/javahl/tests/org/apache/subversion/javahl/
subversion/include/ subversion/include/private/ subversion/libsvn_client/
subversion/libsvn_delta/ subversio...
Modified: subversion/branches/remove-log-addressing/subversion/svnsync/svnsync.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/svnsync/svnsync.c?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/svnsync/svnsync.c (original)
+++ subversion/branches/remove-log-addressing/subversion/svnsync/svnsync.c Tue Nov 4 11:40:16 2014
@@ -68,6 +68,11 @@ enum svnsync__opt {
svnsync_opt_disable_locking,
svnsync_opt_version,
svnsync_opt_trust_server_cert,
+ svnsync_opt_trust_server_cert_unknown_ca,
+ svnsync_opt_trust_server_cert_cn_mismatch,
+ svnsync_opt_trust_server_cert_expired,
+ svnsync_opt_trust_server_cert_not_yet_valid,
+ svnsync_opt_trust_server_cert_other_failure,
svnsync_opt_allow_non_empty,
svnsync_opt_steal_lock
};
@@ -78,6 +83,11 @@ enum svnsync__opt {
svnsync_opt_auth_username, \
svnsync_opt_auth_password, \
svnsync_opt_trust_server_cert, \
+ svnsync_opt_trust_server_cert_unknown_ca, \
+ svnsync_opt_trust_server_cert_cn_mismatch, \
+ svnsync_opt_trust_server_cert_expired, \
+ svnsync_opt_trust_server_cert_not_yet_valid, \
+ svnsync_opt_trust_server_cert_other_failure, \
svnsync_opt_source_username, \
svnsync_opt_source_password, \
svnsync_opt_sync_username, \
@@ -194,11 +204,29 @@ static const apr_getopt_option_t svnsync
" "
"see --source-password and --sync-password)") },
{"trust-server-cert", svnsync_opt_trust_server_cert, 0,
- N_("accept SSL server certificates from unknown\n"
- " "
- "certificate authorities without prompting (but only\n"
- " "
- "with '--non-interactive')") },
+ N_("deprecated; same as --trust-unknown-ca")},
+ {"trust-unknown-ca", svnsync_opt_trust_server_cert_unknown_ca, 0,
+ N_("with --non-interactive, accept SSL server\n"
+ " "
+ "certificates from unknown certificate authorities")},
+ {"trust-cn-mismatch", svnsync_opt_trust_server_cert_cn_mismatch, 0,
+ N_("with --non-interactive, accept SSL server\n"
+ " "
+ "certificates even if the server hostname does not\n"
+ " "
+ "match the certificate's common name attribute")},
+ {"trust-expired", svnsync_opt_trust_server_cert_expired, 0,
+ N_("with --non-interactive, accept expired SSL server\n"
+ " "
+ "certificates")},
+ {"trust-not-yet-valid", svnsync_opt_trust_server_cert_not_yet_valid, 0,
+ N_("with --non-interactive, accept SSL server\n"
+ " "
+ "certificates from the future")},
+ {"trust-other-failure", svnsync_opt_trust_server_cert_other_failure, 0,
+ N_("with --non-interactive, accept SSL server\n"
+ " "
+ "certificates with failures other than the above")},
{"source-username", svnsync_opt_source_username, 1,
N_("connect to source repository with username ARG") },
{"source-password", svnsync_opt_source_password, 1,
@@ -252,7 +280,11 @@ static const apr_getopt_option_t svnsync
typedef struct opt_baton_t {
svn_boolean_t non_interactive;
- svn_boolean_t trust_server_cert;
+ svn_boolean_t trust_server_cert_unknown_ca;
+ svn_boolean_t trust_server_cert_cn_mismatch;
+ svn_boolean_t trust_server_cert_expired;
+ svn_boolean_t trust_server_cert_not_yet_valid;
+ svn_boolean_t trust_server_cert_other_failure;
svn_boolean_t no_auth_cache;
svn_auth_baton_t *source_auth_baton;
svn_auth_baton_t *sync_auth_baton;
@@ -1969,8 +2001,25 @@ sub_main(int *exit_code, int argc, const
force_interactive = TRUE;
break;
- case svnsync_opt_trust_server_cert:
- opt_baton.trust_server_cert = TRUE;
+ case svnsync_opt_trust_server_cert: /* backwards compat */
+ case svnsync_opt_trust_server_cert_unknown_ca:
+ opt_baton.trust_server_cert_unknown_ca = TRUE;
+ break;
+
+ case svnsync_opt_trust_server_cert_cn_mismatch:
+ opt_baton.trust_server_cert_cn_mismatch = TRUE;
+ break;
+
+ case svnsync_opt_trust_server_cert_expired:
+ opt_baton.trust_server_cert_expired = TRUE;
+ break;
+
+ case svnsync_opt_trust_server_cert_not_yet_valid:
+ opt_baton.trust_server_cert_not_yet_valid = TRUE;
+ break;
+
+ case svnsync_opt_trust_server_cert_other_failure:
+ opt_baton.trust_server_cert_other_failure = TRUE;
break;
case svnsync_opt_no_auth_cache:
@@ -2156,12 +2205,29 @@ sub_main(int *exit_code, int argc, const
"mutually exclusive"));
}
- /* --trust-server-cert can only be used with --non-interactive */
- if (opt_baton.trust_server_cert && !opt_baton.non_interactive)
+ /* --trust-* can only be used with --non-interactive */
+ if (!opt_baton.non_interactive)
{
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-server-cert requires "
- "--non-interactive"));
+ if (opt_baton.trust_server_cert_unknown_ca)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--trust-unknown-ca requires "
+ "--non-interactive"));
+ if (opt_baton.trust_server_cert_cn_mismatch)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--trust-cn-mismatch requires "
+ "--non-interactive"));
+ if (opt_baton.trust_server_cert_expired)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--trust-expired requires "
+ "--non-interactive"));
+ if (opt_baton.trust_server_cert_not_yet_valid)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--trust-not-yet-valid requires "
+ "--non-interactive"));
+ if (opt_baton.trust_server_cert_other_failure)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--trust-other-failure requires "
+ "--non-interactive"));
}
SVN_ERR(svn_config_ensure(opt_baton.config_dir, pool));
@@ -2273,27 +2339,37 @@ sub_main(int *exit_code, int argc, const
apr_signal(SIGXFSZ, SIG_IGN);
#endif
- err = svn_cmdline_create_auth_baton(&opt_baton.source_auth_baton,
- opt_baton.non_interactive,
- opt_baton.source_username,
- opt_baton.source_password,
- opt_baton.config_dir,
- opt_baton.no_auth_cache,
- opt_baton.trust_server_cert,
- config,
- check_cancel, NULL,
- pool);
+ err = svn_cmdline_create_auth_baton2(
+ &opt_baton.source_auth_baton,
+ opt_baton.non_interactive,
+ opt_baton.source_username,
+ opt_baton.source_password,
+ opt_baton.config_dir,
+ opt_baton.no_auth_cache,
+ opt_baton.trust_server_cert_unknown_ca,
+ opt_baton.trust_server_cert_cn_mismatch,
+ opt_baton.trust_server_cert_expired,
+ opt_baton.trust_server_cert_not_yet_valid,
+ opt_baton.trust_server_cert_other_failure,
+ config,
+ check_cancel, NULL,
+ pool);
if (! err)
- err = svn_cmdline_create_auth_baton(&opt_baton.sync_auth_baton,
- opt_baton.non_interactive,
- opt_baton.sync_username,
- opt_baton.sync_password,
- opt_baton.config_dir,
- opt_baton.no_auth_cache,
- opt_baton.trust_server_cert,
- config,
- check_cancel, NULL,
- pool);
+ err = svn_cmdline_create_auth_baton2(
+ &opt_baton.sync_auth_baton,
+ opt_baton.non_interactive,
+ opt_baton.sync_username,
+ opt_baton.sync_password,
+ opt_baton.config_dir,
+ opt_baton.no_auth_cache,
+ opt_baton.trust_server_cert_unknown_ca,
+ opt_baton.trust_server_cert_cn_mismatch,
+ opt_baton.trust_server_cert_expired,
+ opt_baton.trust_server_cert_not_yet_valid,
+ opt_baton.trust_server_cert_other_failure,
+ config,
+ check_cancel, NULL,
+ pool);
if (! err)
err = (*subcommand->cmd_func)(os, &opt_baton, pool);
if (err)
Modified: subversion/branches/remove-log-addressing/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/cmdline/externals_tests.py?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/cmdline/externals_tests.py Tue Nov 4 11:40:16 2014
@@ -2795,23 +2795,26 @@ def include_immediate_dir_externals(sbox
@Issue(4085)
-@XFail()
def shadowing(sbox):
"external shadows an existing dir"
- sbox.build(read_only=True)
+ sbox.build()
wc_dir = sbox.wc_dir
# Setup external: /A/B/F as 'C' child of /A
externals_prop = "^/A/B/F C\n"
+ change_external(sbox.ospath('A'), externals_prop, commit=False)
+
+ # An update errors out because the external is shadowed by an existing dir
+ svntest.main.run_svn("W205011: Error handling externals definition for '%s'"
+ % (sbox.wc_dir) + "/A/C", 'update', wc_dir)
+
+ # Remove the shadowed directory to unblock the external
+ svntest.main.run_svn(None, 'rm', sbox.repo_url + '/A/C', '-m', 'remove A/C')
+
+ # The next update should fetch the external and not error out
+ sbox.simple_update()
- raised = False
- try:
- change_external(sbox.ospath('A'), externals_prop, commit=False)
- except:
- raised = True
- if not raised:
- raise svntest.Failure("Creating conflicting child 'C' of 'A' didn't error")
# Test for issue #4093 'remapping a file external can segfault due to
# "deleted" props'.
Modified: subversion/branches/remove-log-addressing/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Tue Nov 4 11:40:16 2014
@@ -122,9 +122,18 @@ Global options:
only if standard input is a terminal device)
--force-interactive : do interactive prompting even if standard input
is not a terminal device
- --trust-server-cert : accept SSL server certificates from unknown
- certificate authorities without prompting (but only
- with '--non-interactive')
+ --trust-server-cert : deprecated; same as --trust-unknown-ca
+ --trust-unknown-ca : with --non-interactive, accept SSL server
+ certificates from unknown certificate authorities
+ --trust-cn-mismatch : with --non-interactive, accept SSL server
+ certificates even if the server hostname does not
+ match the certificate's common name attribute
+ --trust-expired : with --non-interactive, accept expired SSL server
+ certificates
+ --trust-not-yet-valid : with --non-interactive, accept SSL server
+ certificates from the future
+ --trust-other-failure : with --non-interactive, accept SSL server
+ certificates with failures other than the above
--config-dir ARG : read user configuration files from directory ARG
--config-option ARG : set user configuration option in the format:
FILE:SECTION:OPTION=[VALUE]
@@ -206,9 +215,18 @@ Global options:
only if standard input is a terminal device)
--force-interactive : do interactive prompting even if standard input
is not a terminal device
- --trust-server-cert : accept SSL server certificates from unknown
- certificate authorities without prompting (but only
- with '--non-interactive')
+ --trust-server-cert : deprecated; same as --trust-unknown-ca
+ --trust-unknown-ca : with --non-interactive, accept SSL server
+ certificates from unknown certificate authorities
+ --trust-cn-mismatch : with --non-interactive, accept SSL server
+ certificates even if the server hostname does not
+ match the certificate's common name attribute
+ --trust-expired : with --non-interactive, accept expired SSL server
+ certificates
+ --trust-not-yet-valid : with --non-interactive, accept SSL server
+ certificates from the future
+ --trust-other-failure : with --non-interactive, accept SSL server
+ certificates with failures other than the above
--config-dir ARG : read user configuration files from directory ARG
--config-option ARG : set user configuration option in the format:
FILE:SECTION:OPTION=[VALUE]
Modified: subversion/branches/remove-log-addressing/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/cmdline/svnadmin_tests.py?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/cmdline/svnadmin_tests.py Tue Nov 4 11:40:16 2014
@@ -86,12 +86,6 @@ def check_hotcopy_fsfs_fsx(src, dst):
"source" % src_dirent)
# Compare all files in this directory
for src_file in src_files:
- # Exclude temporary files
- if src_file == 'rev-prop-atomics.shm':
- continue
- if src_file == 'rev-prop-atomics.mutex':
- continue
-
# Ignore auto-created empty lock files as they may or may not
# be present and are neither required by nor do they harm to
# the destination repository.
@@ -143,7 +137,7 @@ def check_hotcopy_fsfs_fsx(src, dst):
# the hotcopy destination (i.e. a fresh cache generation)
if src_file == 'revprop-generation':
f2 = open(dst_path, 'r')
- revprop_gen = int(f2.read().strip())
+ revprop_gen = int(f2.read().strip().split()[1])
if revprop_gen != 0:
raise svntest.Failure("Hotcopy destination has non-zero " +
"revprop generation")
@@ -2036,8 +2030,8 @@ def verify_keep_going(sbox):
sbox.repo_dir)
exp_out = svntest.verify.RegexListOutput([".*Verified revision 0.",
- ".*Verified revision 1.",
- ".*Error verifying revision 2."])
+ ".*Verified revision 1.",
+ ".*Error verifying revision 2."])
if (svntest.main.fs_has_rep_sharing()):
exp_out.insert(0, ".*Verifying repository metadata.*")
Modified: subversion/branches/remove-log-addressing/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/cmdline/switch_tests.py?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/cmdline/switch_tests.py Tue Nov 4 11:40:16 2014
@@ -2860,6 +2860,49 @@ def switch_keywords(sbox):
None, expected_disk, expected_status,
None, None, None, None, None)
+@Issue(4524)
+def switch_moves(sbox):
+ "switch moves on wc checkpoint"
+
+ sbox.build()
+
+ sbox.simple_move('A/B', 'B')
+ sbox.simple_rm('A')
+
+ branch_url = sbox.repo_url + '/branch'
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'cp', sbox.wc_dir, branch_url,
+ '-m', '')
+
+ expected_disk = svntest.wc.State('', {
+ 'B/E/alpha' : Item(contents="This is the file 'alpha'.\n"),
+ 'B/E/beta' : Item(contents="This is the file 'beta'.\n"),
+ 'B/lambda' : Item(contents="This is the file 'lambda'.\n"),
+ 'B/F' : Item(),
+ 'iota' : Item(contents="This is the file 'iota'.\n"),
+ })
+
+ expected_status = svntest.wc.State(sbox.wc_dir, {
+ '' : Item(status=' ', wc_rev='2'),
+ 'B' : Item(status='R ', copied='+', treeconflict='C', wc_rev='-'),
+ 'B/lambda' : Item(status=' ', copied='+', wc_rev='-'),
+ 'B/F' : Item(status=' ', copied='+', wc_rev='-'),
+ 'B/E' : Item(status=' ', copied='+', wc_rev='-'),
+ 'B/E/beta' : Item(status=' ', copied='+', wc_rev='-'),
+ 'B/E/alpha' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A' : Item(status='! ', treeconflict='C'),
+ 'iota' : Item(status=' ', wc_rev='2'),
+ })
+
+ # In Subversion 1.8 this scenario causes an Sqlite row not found error.
+ # It would be nice if we could handle the tree conflict more intelligent, as
+ # the working copy matches the incomming change.
+ svntest.actions.run_and_verify_switch(sbox.wc_dir, sbox.ospath(''), branch_url,
+ None, expected_disk, expected_status,
+ None, None, None, None, None)
+
+
########################################################################
# Run the tests
@@ -2903,6 +2946,7 @@ test_list = [ None,
switch_to_spaces,
switch_across_replacement,
switch_keywords,
+ switch_moves,
]
if __name__ == '__main__':
Modified: subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs/fs-test.c?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs/fs-test.c Tue Nov 4 11:40:16 2014
@@ -41,6 +41,7 @@
#include "svn_private_config.h"
#include "private/svn_fs_util.h"
#include "private/svn_fs_private.h"
+#include "private/svn_fspath.h"
#include "../svn_test_fs.h"
@@ -207,24 +208,35 @@ reopen_trivial_transaction(const svn_tes
{
svn_fs_t *fs;
svn_fs_txn_t *txn;
+ svn_fs_root_t *root;
const char *txn_name;
apr_pool_t *subpool = svn_pool_create(pool);
SVN_ERR(svn_test__create_fs(&fs, "test-repo-reopen-trivial-txn",
opts, pool));
- /* Begin a new transaction that is based on revision 0. */
+ /* Create a first transaction - we don't want that one to reopen. */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, subpool));
+
+ /* Begin a second transaction that is based on revision 0. */
SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, subpool));
/* Don't use the subpool, txn_name must persist beyond the current txn */
SVN_ERR(svn_fs_txn_name(&txn_name, txn, pool));
+ /* Create a third transaction - we don't want that one to reopen. */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, subpool));
+
/* Close the transaction. */
svn_pool_clear(subpool);
/* Reopen the transaction by name */
SVN_ERR(svn_fs_open_txn(&txn, fs, txn_name, subpool));
+ /* Does it have the same name? */
+ SVN_ERR(svn_fs_txn_root(&root, txn, subpool));
+ SVN_TEST_STRING_ASSERT(svn_fs_txn_root_name(root, subpool), txn_name);
+
/* Close the transaction ... again. */
svn_pool_destroy(subpool);
@@ -1126,6 +1138,8 @@ basic_commit(const svn_test_opts_t *opts
/* Create the greek tree. */
SVN_ERR(svn_test__create_greek_tree(txn_root, pool));
+ SVN_TEST_ASSERT(svn_fs_is_txn_root(txn_root));
+ SVN_TEST_ASSERT(!svn_fs_is_revision_root(txn_root));
/* Commit it. */
SVN_ERR(svn_fs_commit_txn(&conflict, &after_rev, txn, pool));
@@ -1139,6 +1153,8 @@ basic_commit(const svn_test_opts_t *opts
/* Get root of the revision */
SVN_ERR(svn_fs_revision_root(&revision_root, fs, after_rev, pool));
+ SVN_TEST_ASSERT(!svn_fs_is_txn_root(revision_root));
+ SVN_TEST_ASSERT(svn_fs_is_revision_root(revision_root));
/* Check the tree. */
SVN_ERR(svn_test__check_greek_tree(revision_root, pool));
@@ -1580,6 +1596,10 @@ merging_commit(const svn_test_opts_t *op
SVN_ERR(svn_fs_make_file(txn_root, "theta", pool));
SVN_ERR(svn_test__set_file_contents
(txn_root, "theta", "This is another file 'theta'.\n", pool));
+
+ /* TXN must actually be based upon revisions[4] (instead of HEAD). */
+ SVN_TEST_ASSERT(svn_fs_txn_base_revision(txn) == revisions[4]);
+
SVN_ERR(test_commit_txn(&failed_rev, txn, "/theta", pool));
SVN_ERR(svn_fs_abort_txn(txn, pool));
@@ -1603,6 +1623,9 @@ merging_commit(const svn_test_opts_t *op
SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
SVN_ERR(svn_fs_delete(txn_root, "A/D/H", pool));
+ /* TXN must actually be based upon revisions[1] (instead of HEAD). */
+ SVN_TEST_ASSERT(svn_fs_txn_base_revision(txn) == revisions[1]);
+
/* We used to create the revision like this before fixing issue
#2751 -- Directory prop mods reverted in overlapping commits scenario.
@@ -4171,6 +4194,12 @@ check_related(const svn_test_opts_t *opt
{ "E", 7 }, { "E", 8 }, { "F", 9 }, { "F", 10 }
};
+ /* Latest revision that touched the respective path. */
+ struct path_rev_t latest_changes[6] = {
+ { "A", 4 }, { "B", 6 }, { "C", 6 },
+ { "D", 7 }, { "E", 8 }, { "F", 10 }
+ };
+
int related_matrix[16][16] = {
/* A1 ... F10 across the top here*/
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0 }, /* A1 */
@@ -4200,14 +4229,16 @@ check_related(const svn_test_opts_t *opt
struct path_rev_t pr2 = path_revs[j];
const svn_fs_id_t *id1, *id2;
int related = 0;
+ svn_fs_node_relation_t relation;
+ svn_fs_root_t *rev_root1, *rev_root2;
/* Get the ID for the first path/revision combination. */
- SVN_ERR(svn_fs_revision_root(&rev_root, fs, pr1.rev, subpool));
- SVN_ERR(svn_fs_node_id(&id1, rev_root, pr1.path, subpool));
+ SVN_ERR(svn_fs_revision_root(&rev_root1, fs, pr1.rev, subpool));
+ SVN_ERR(svn_fs_node_id(&id1, rev_root1, pr1.path, subpool));
/* Get the ID for the second path/revision combination. */
- SVN_ERR(svn_fs_revision_root(&rev_root, fs, pr2.rev, subpool));
- SVN_ERR(svn_fs_node_id(&id2, rev_root, pr2.path, subpool));
+ SVN_ERR(svn_fs_revision_root(&rev_root2, fs, pr2.rev, subpool));
+ SVN_ERR(svn_fs_node_id(&id2, rev_root2, pr2.path, subpool));
/* <exciting> Now, run the relationship check! </exciting> */
related = svn_fs_check_related(id1, id2) ? 1 : 0;
@@ -4230,9 +4261,74 @@ check_related(const svn_test_opts_t *opt
pr1.path, (int)pr1.rev, pr2.path, (int)pr2.rev);
}
+ /* Asking directly, i.e. without involving the noderev IDs as
+ * an intermediate, should yield the same results. */
+ SVN_ERR(svn_fs_node_relation(&relation, rev_root1, pr1.path,
+ rev_root2, pr2.path, subpool));
+ if (i == j)
+ {
+ /* Identical note. */
+ if (!related || relation != svn_fs_node_same)
+ {
+ return svn_error_createf
+ (SVN_ERR_TEST_FAILED, NULL,
+ "expected '%s:%d' to be the same as '%s:%d';"
+ " it was not",
+ pr1.path, (int)pr1.rev, pr2.path, (int)pr2.rev);
+ }
+ }
+ else if (related && relation != svn_fs_node_common_ancestor)
+ {
+ return svn_error_createf
+ (SVN_ERR_TEST_FAILED, NULL,
+ "expected '%s:%d' to have a common ancestor with '%s:%d';"
+ " it had not",
+ pr1.path, (int)pr1.rev, pr2.path, (int)pr2.rev);
+ }
+ else if (!related && relation != svn_fs_node_unrelated)
+ {
+ return svn_error_createf
+ (SVN_ERR_TEST_FAILED, NULL,
+ "expected '%s:%d' to not be related to '%s:%d'; it was",
+ pr1.path, (int)pr1.rev, pr2.path, (int)pr2.rev);
+ }
+
svn_pool_clear(subpool);
} /* for ... */
} /* for ... */
+
+ /* Verify that the noderevs stay the same after their last change. */
+ for (i = 0; i < 6; ++i)
+ {
+ const char *path = latest_changes[i].path;
+ svn_revnum_t latest = latest_changes[i].rev;
+ svn_fs_root_t *latest_root;
+ svn_revnum_t rev;
+ svn_fs_node_relation_t relation;
+
+ /* FS root of the latest change. */
+ svn_pool_clear(subpool);
+ SVN_ERR(svn_fs_revision_root(&latest_root, fs, latest, subpool));
+
+ /* All future revisions. */
+ for (rev = latest + 1; rev <= 10; ++rev)
+ {
+ /* Query their noderev relationship to the latest change. */
+ SVN_ERR(svn_fs_revision_root(&rev_root, fs, rev, subpool));
+ SVN_ERR(svn_fs_node_relation(&relation, latest_root, path,
+ rev_root, path, subpool));
+
+ /* They shall use the same noderevs */
+ if (relation != svn_fs_node_same)
+ {
+ return svn_error_createf
+ (SVN_ERR_TEST_FAILED, NULL,
+ "expected '%s:%d' to be the same as '%s:%d';"
+ " it was not",
+ path, (int)latest, path, (int)rev);
+ }
+ } /* for ... */
+ } /* for ... */
}
/* Destroy the subpool. */
@@ -4320,22 +4416,49 @@ branch_test(const svn_test_opts_t *opts,
}
+/* Verify that file FILENAME under ROOT has the same contents checksum
+ * as CONTENTS when comparing the checksums of the given TYPE.
+ * Use POOL for temporary allocations. */
+static svn_error_t *
+verify_file_checksum(svn_stringbuf_t *contents,
+ svn_fs_root_t *root,
+ const char *filename,
+ svn_checksum_kind_t type,
+ apr_pool_t *pool)
+{
+ svn_checksum_t *expected_checksum, *actual_checksum;
+
+ /* Write a file, compare the repository's idea of its checksum
+ against our idea of its checksum. They should be the same. */
+ SVN_ERR(svn_checksum(&expected_checksum, type, contents->data,
+ contents->len, pool));
+ SVN_ERR(svn_fs_file_checksum(&actual_checksum, type, root, filename, TRUE,
+ pool));
+ if (!svn_checksum_match(expected_checksum, actual_checksum))
+ return svn_error_createf
+ (SVN_ERR_FS_GENERAL, NULL,
+ "verify-checksum: checksum mismatch:\n"
+ " expected: %s\n"
+ " actual: %s\n",
+ svn_checksum_to_cstring(expected_checksum, pool),
+ svn_checksum_to_cstring(actual_checksum, pool));
+
+ return SVN_NO_ERROR;
+}
+
static svn_error_t *
verify_checksum(const svn_test_opts_t *opts,
apr_pool_t *pool)
{
svn_fs_t *fs;
svn_fs_txn_t *txn;
- svn_fs_root_t *txn_root;
+ svn_fs_root_t *txn_root, *rev_root;
svn_stringbuf_t *str;
- svn_checksum_t *expected_checksum, *actual_checksum;
+ svn_revnum_t rev;
/* Write a file, compare the repository's idea of its checksum
against our idea of its checksum. They should be the same. */
-
str = svn_stringbuf_create("My text editor charges me rent.", pool);
- SVN_ERR(svn_checksum(&expected_checksum, svn_checksum_md5, str->data,
- str->len, pool));
SVN_ERR(svn_test__create_fs(&fs, "test-repo-verify-checksum",
opts, pool));
@@ -4343,17 +4466,20 @@ verify_checksum(const svn_test_opts_t *o
SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
SVN_ERR(svn_fs_make_file(txn_root, "fact", pool));
SVN_ERR(svn_test__set_file_contents(txn_root, "fact", str->data, pool));
- SVN_ERR(svn_fs_file_checksum(&actual_checksum, svn_checksum_md5, txn_root,
- "fact", TRUE, pool));
- if (!svn_checksum_match(expected_checksum, actual_checksum))
- return svn_error_createf
- (SVN_ERR_FS_GENERAL, NULL,
- "verify-checksum: checksum mismatch:\n"
- " expected: %s\n"
- " actual: %s\n",
- svn_checksum_to_cstring(expected_checksum, pool),
- svn_checksum_to_cstring(actual_checksum, pool));
+ /* Do it for the txn. */
+ SVN_ERR(verify_file_checksum(str, txn_root, "fact", svn_checksum_md5,
+ pool));
+ SVN_ERR(verify_file_checksum(str, txn_root, "fact", svn_checksum_sha1,
+ pool));
+
+ /* Do it again - this time for the revision. */
+ SVN_ERR(svn_fs_commit_txn(NULL, &rev, txn, pool));
+ SVN_ERR(svn_fs_revision_root(&rev_root, fs, rev, pool));
+ SVN_ERR(verify_file_checksum(str, rev_root, "fact", svn_checksum_md5,
+ pool));
+ SVN_ERR(verify_file_checksum(str, rev_root, "fact", svn_checksum_sha1,
+ pool));
return SVN_NO_ERROR;
}
@@ -5410,7 +5536,7 @@ upgrade_while_committing(const svn_test_
svn_fs_t *fs;
svn_revnum_t head_rev = 0;
svn_fs_root_t *root;
- svn_fs_txn_t *txn;
+ svn_fs_txn_t *txn1, *txn2;
const char *fs_path;
apr_hash_t *fs_config = apr_hash_make(pool);
@@ -5430,30 +5556,518 @@ upgrade_while_committing(const svn_test_
svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_SHARD_SIZE, "2");
SVN_ERR(svn_test__create_fs2(&fs, fs_path, opts, fs_config, pool));
- SVN_ERR(svn_fs_open(&fs, fs_path, NULL, pool));
+ SVN_ERR(svn_fs_begin_txn(&txn1, fs, head_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&root, txn1, pool));
+ SVN_ERR(svn_test__create_greek_tree(root, pool));
+ SVN_ERR(test_commit_txn(&head_rev, txn1, NULL, pool));
+
+ /* Create txn with changes. */
+ SVN_ERR(svn_fs_begin_txn(&txn1, fs, head_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&root, txn1, pool));
+ SVN_ERR(svn_fs_make_dir(root, "/foo", pool));
+
+ /* Upgrade filesystem, but keep existing svn_fs_t object. */
+ SVN_ERR(svn_fs_upgrade(fs_path, pool));
+
+ /* Creating a new txn for the old svn_fs_t object shall fail. */
+ SVN_TEST_ASSERT_ANY_ERROR(svn_fs_begin_txn(&txn2, fs, head_rev, pool));
+
+ /* Committing the already existing txn shall fail as well. */
+ SVN_TEST_ASSERT_ANY_ERROR(test_commit_txn(&head_rev, txn1, NULL, pool));
+
+ /* Verify filesystem content. */
+ SVN_ERR(svn_fs_verify(fs_path, NULL, 0, SVN_INVALID_REVNUM, NULL, NULL,
+ NULL, NULL, pool));
+
+ return SVN_NO_ERROR;
+}
+
+/* Utility method for test_paths_changed. Verify that REV in FS changes
+ * exactly one path and that that change is a property change. Expect
+ * the MERGEINFO_MOD flag of the change to have the given value.
+ */
+static svn_error_t *
+verify_root_prop_change(svn_fs_t *fs,
+ svn_revnum_t rev,
+ svn_tristate_t mergeinfo_mod,
+ apr_pool_t *pool)
+{
+ svn_fs_path_change2_t *change;
+ svn_fs_root_t *root;
+ apr_hash_t *changes;
+
+ SVN_ERR(svn_fs_revision_root(&root, fs, rev, pool));
+ SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
+ SVN_TEST_ASSERT(apr_hash_count(changes) == 1);
+ change = svn_hash_gets(changes, "/");
+
+ SVN_TEST_ASSERT(change->node_rev_id);
+ SVN_TEST_ASSERT(change->change_kind == svn_fs_path_change_modify);
+ SVN_TEST_ASSERT( change->node_kind == svn_node_dir
+ || change->node_kind == svn_node_unknown);
+ SVN_TEST_ASSERT(change->text_mod == FALSE);
+ SVN_TEST_ASSERT(change->prop_mod == TRUE);
+
+ if (change->copyfrom_known)
+ {
+ SVN_TEST_ASSERT(change->copyfrom_rev == SVN_INVALID_REVNUM);
+ SVN_TEST_ASSERT(change->copyfrom_path == NULL);
+ }
+
+ SVN_TEST_ASSERT(change->mergeinfo_mod == mergeinfo_mod);
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+test_paths_changed(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ svn_revnum_t head_rev = 0;
+ svn_fs_root_t *root;
+ svn_fs_txn_t *txn;
+ const char *fs_path;
+ apr_hash_t *changes;
+ svn_boolean_t has_mergeinfo_mod = FALSE;
+ apr_hash_index_t *hi;
+ int i;
+
+ /* The "mergeinfo_mod flag will say "unknown" until recently. */
+ if ( strcmp(opts->fs_type, "bdb") != 0
+ && (!opts->server_minor_version || (opts->server_minor_version >= 9)))
+ has_mergeinfo_mod = TRUE;
+
+ /* Create test repository with greek tree. */
+ fs_path = "test-paths-changed";
+
+ SVN_ERR(svn_test__create_fs2(&fs, fs_path, opts, NULL, pool));
+
SVN_ERR(svn_fs_begin_txn(&txn, fs, head_rev, pool));
SVN_ERR(svn_fs_txn_root(&root, txn, pool));
SVN_ERR(svn_test__create_greek_tree(root, pool));
SVN_ERR(test_commit_txn(&head_rev, txn, NULL, pool));
- /* Upgrade filesystem, but keep existing svn_fs_t object. */
- SVN_ERR(svn_fs_upgrade(fs_path, pool));
+ /* Create txns with various prop changes. */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, head_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&root, txn, pool));
+ SVN_ERR(svn_fs_change_node_prop(root, "/", "propname",
+ svn_string_create("propval", pool), pool));
+ SVN_ERR(test_commit_txn(&head_rev, txn, NULL, pool));
- /* Create txn with changes. */
SVN_ERR(svn_fs_begin_txn(&txn, fs, head_rev, pool));
SVN_ERR(svn_fs_txn_root(&root, txn, pool));
- SVN_ERR(svn_fs_make_dir(root, "/foo", pool));
+ SVN_ERR(svn_fs_change_node_prop(root, "/", "svn:mergeinfo",
+ svn_string_create("/: 1\n", pool), pool));
+ SVN_ERR(test_commit_txn(&head_rev, txn, NULL, pool));
+
+ /* Verify changed path lists. */
+
+ /* Greek tree creation rev. */
+ SVN_ERR(svn_fs_revision_root(&root, fs, head_rev - 2, pool));
+ SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
+
+ /* Reports all paths? */
+ for (i = 0; svn_test__greek_tree_nodes[i].path; ++i)
+ {
+ const char *path
+ = svn_fspath__canonicalize(svn_test__greek_tree_nodes[i].path, pool);
+
+ SVN_TEST_ASSERT(svn_hash_gets(changes, path));
+ }
+
+ SVN_TEST_ASSERT(apr_hash_count(changes) == i);
+
+ /* Verify per-path info. */
+ for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
+ {
+ svn_fs_path_change2_t *change = apr_hash_this_val(hi);
+
+ SVN_TEST_ASSERT(change->node_rev_id);
+ SVN_TEST_ASSERT(change->change_kind == svn_fs_path_change_add);
+ SVN_TEST_ASSERT( change->node_kind == svn_node_file
+ || change->node_kind == svn_node_dir
+ || change->node_kind == svn_node_unknown);
- /* Commit txn. */
+ if (change->node_kind != svn_node_unknown)
+ SVN_TEST_ASSERT(change->text_mod == ( change->node_kind
+ == svn_node_file));
+
+ SVN_TEST_ASSERT(change->prop_mod == FALSE);
+
+ if (change->copyfrom_known)
+ {
+ SVN_TEST_ASSERT(change->copyfrom_rev == SVN_INVALID_REVNUM);
+ SVN_TEST_ASSERT(change->copyfrom_path == NULL);
+ }
+
+ if (has_mergeinfo_mod)
+ SVN_TEST_ASSERT(change->mergeinfo_mod == svn_tristate_false);
+ else
+ SVN_TEST_ASSERT(change->mergeinfo_mod == svn_tristate_unknown);
+ }
+
+ /* Propset rev. */
+ SVN_ERR(verify_root_prop_change(fs, head_rev - 1,
+ has_mergeinfo_mod ? svn_tristate_false
+ : svn_tristate_unknown,
+ pool));
+
+ /* Mergeinfo set rev. */
+ SVN_ERR(verify_root_prop_change(fs, head_rev,
+ has_mergeinfo_mod ? svn_tristate_true
+ : svn_tristate_unknown,
+ pool));
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+test_delete_replaced_paths_changed(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ svn_revnum_t head_rev = 0;
+ svn_fs_root_t *root;
+ svn_fs_txn_t *txn;
+ const char *fs_path;
+ apr_hash_t *changes;
+ svn_fs_path_change2_t *change;
+ const svn_fs_id_t *file_id;
+
+ /* Create test repository with greek tree. */
+ fs_path = "test-delete-replace-paths-changed";
+
+ SVN_ERR(svn_test__create_fs2(&fs, fs_path, opts, NULL, pool));
+
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, head_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&root, txn, pool));
+ SVN_ERR(svn_test__create_greek_tree(root, pool));
SVN_ERR(test_commit_txn(&head_rev, txn, NULL, pool));
- /* Verify filesystem content. */
- SVN_ERR(svn_fs_verify(fs_path, NULL, 0, SVN_INVALID_REVNUM, NULL, NULL,
- NULL, NULL, pool));
+ /* Create that replaces a file with a folder and then deletes that
+ * replacement. Start with the deletion. */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, head_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&root, txn, pool));
+ SVN_ERR(svn_fs_delete(root, "/iota", pool));
+
+ /* The change list should now report a deleted file. */
+ SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
+ change = svn_hash_gets(changes, "/iota");
+ file_id = change->node_rev_id;
+ SVN_TEST_ASSERT( change->node_kind == svn_node_file
+ || change->node_kind == svn_node_unknown);
+ SVN_TEST_ASSERT(change->change_kind == svn_fs_path_change_delete);
+
+ /* Add a replacement. */
+ SVN_ERR(svn_fs_make_dir(root, "/iota", pool));
+
+ /* The change list now reports a replacement by a directory. */
+ SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
+ change = svn_hash_gets(changes, "/iota");
+ SVN_TEST_ASSERT( change->node_kind == svn_node_dir
+ || change->node_kind == svn_node_unknown);
+ SVN_TEST_ASSERT(change->change_kind == svn_fs_path_change_replace);
+ SVN_TEST_ASSERT(svn_fs_compare_ids(change->node_rev_id, file_id) != 0);
+
+ /* Delete the replacement again. */
+ SVN_ERR(svn_fs_delete(root, "/iota", pool));
+
+ /* The change list should now be reported as a deleted file again. */
+ SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
+ change = svn_hash_gets(changes, "/iota");
+ SVN_TEST_ASSERT( change->node_kind == svn_node_file
+ || change->node_kind == svn_node_unknown);
+ SVN_TEST_ASSERT(change->change_kind == svn_fs_path_change_delete);
+ SVN_TEST_ASSERT(svn_fs_compare_ids(change->node_rev_id, file_id) == 0);
+
+ /* Finally, commit the change. */
+ SVN_ERR(test_commit_txn(&head_rev, txn, NULL, pool));
+
+ /* The committed revision should still report the same change. */
+ SVN_ERR(svn_fs_revision_root(&root, fs, head_rev, pool));
+ SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
+ change = svn_hash_gets(changes, "/iota");
+ SVN_TEST_ASSERT( change->node_kind == svn_node_file
+ || change->node_kind == svn_node_unknown);
+ SVN_TEST_ASSERT(change->change_kind == svn_fs_path_change_delete);
return SVN_NO_ERROR;
}
+/* Get rid of transaction NAME in FS. This function deals with backend-
+ * specific behavior as permitted by the API. */
+static svn_error_t *
+cleanup_txn(svn_fs_t *fs,
+ const char *name,
+ apr_pool_t *scratch_pool)
+{
+ /* Get rid of the txns one at a time. */
+ svn_error_t *err = svn_fs_purge_txn(fs, name, scratch_pool);
+
+ /* Some backends (BDB) don't support purging transactions that have never
+ * seen an abort or commit attempt. Simply abort those txns. */
+ if (err && err->apr_err == SVN_ERR_FS_TRANSACTION_NOT_DEAD)
+ {
+ svn_fs_txn_t *txn;
+ svn_error_clear(err);
+ err = SVN_NO_ERROR;
+
+ SVN_ERR(svn_fs_open_txn(&txn, fs, name, scratch_pool));
+ SVN_ERR(svn_fs_abort_txn(txn, scratch_pool));
+
+ /* Should be gone now ... */
+ SVN_TEST_ASSERT_ERROR(svn_fs_open_txn(&txn, fs, name, scratch_pool),
+ SVN_ERR_FS_NO_SUCH_TRANSACTION);
+ }
+
+ return svn_error_trace(err);
+}
+
+/* Make sure we get txn lists correctly. */
+static svn_error_t *
+purge_txn_test(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ svn_fs_txn_t *txn;
+ const char *name1, *name2;
+ apr_array_header_t *txn_list;
+ apr_pool_t *subpool = svn_pool_create(pool);
+
+ SVN_ERR(svn_test__create_fs(&fs, "test-repo-purge-txn",
+ opts, pool));
+
+ /* Begin a new transaction, get its name (in the top pool), close it. */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, subpool));
+ SVN_ERR(svn_fs_txn_name(&name1, txn, pool));
+
+ /* Begin *another* transaction, get its name (in the top pool), close it. */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, subpool));
+ SVN_ERR(svn_fs_txn_name(&name2, txn, pool));
+ svn_pool_clear(subpool);
+
+ /* Get rid of the txns one at a time. */
+ SVN_ERR(cleanup_txn(fs, name1, pool));
+
+ /* There should be exactly one left. */
+ SVN_ERR(svn_fs_list_transactions(&txn_list, fs, pool));
+
+ /* Check the list. It should have *exactly* one entry. */
+ SVN_TEST_ASSERT( txn_list->nelts == 1
+ && !strcmp(name2, APR_ARRAY_IDX(txn_list, 0, const char *)));
+
+ /* Get rid of the other txn as well. */
+ SVN_ERR(cleanup_txn(fs, name2, pool));
+
+ /* There should be exactly one left. */
+ SVN_ERR(svn_fs_list_transactions(&txn_list, fs, pool));
+
+ /* Check the list. It should have no entries. */
+ SVN_TEST_ASSERT(txn_list->nelts == 0);
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+compare_contents(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ svn_fs_txn_t *txn;
+ svn_fs_root_t *txn_root, *root1, *root2;
+ const char *original = "original contents";
+ svn_revnum_t rev;
+ int i;
+ apr_pool_t *iterpool = svn_pool_create(pool);
+
+ /* Two similar but different texts that yield the same MD5 digest. */
+ const char *evil_text1
+ = "\xd1\x31\xdd\x02\xc5\xe6\xee\xc4\x69\x3d\x9a\x06\x98\xaf\xf9\x5c"
+ "\x2f\xca\xb5\x87\x12\x46\x7e\xab\x40\x04\x58\x3e\xb8\xfb\x7f\x89"
+ "\x55\xad\x34\x06\x09\xf4\xb3\x02\x83\xe4\x88\x83\x25\x71\x41\x5a"
+ "\x08\x51\x25\xe8\xf7\xcd\xc9\x9f\xd9\x1d\xbd\xf2\x80\x37\x3c\x5b"
+ "\xd8\x82\x3e\x31\x56\x34\x8f\x5b\xae\x6d\xac\xd4\x36\xc9\x19\xc6"
+ "\xdd\x53\xe2\xb4\x87\xda\x03\xfd\x02\x39\x63\x06\xd2\x48\xcd\xa0"
+ "\xe9\x9f\x33\x42\x0f\x57\x7e\xe8\xce\x54\xb6\x70\x80\xa8\x0d\x1e"
+ "\xc6\x98\x21\xbc\xb6\xa8\x83\x93\x96\xf9\x65\x2b\x6f\xf7\x2a\x70";
+ const char *evil_text2
+ = "\xd1\x31\xdd\x02\xc5\xe6\xee\xc4\x69\x3d\x9a\x06\x98\xaf\xf9\x5c"
+ "\x2f\xca\xb5\x07\x12\x46\x7e\xab\x40\x04\x58\x3e\xb8\xfb\x7f\x89"
+ "\x55\xad\x34\x06\x09\xf4\xb3\x02\x83\xe4\x88\x83\x25\xf1\x41\x5a"
+ "\x08\x51\x25\xe8\xf7\xcd\xc9\x9f\xd9\x1d\xbd\x72\x80\x37\x3c\x5b"
+ "\xd8\x82\x3e\x31\x56\x34\x8f\x5b\xae\x6d\xac\xd4\x36\xc9\x19\xc6"
+ "\xdd\x53\xe2\x34\x87\xda\x03\xfd\x02\x39\x63\x06\xd2\x48\xcd\xa0"
+ "\xe9\x9f\x33\x42\x0f\x57\x7e\xe8\xce\x54\xb6\x70\x80\x28\x0d\x1e"
+ "\xc6\x98\x21\xbc\xb6\xa8\x83\x93\x96\xf9\x65\xab\x6f\xf7\x2a\x70";
+ svn_checksum_t *checksum1, *checksum2;
+
+ /* (path, rev) pairs to compare plus the expected API return values */
+ struct
+ {
+ svn_revnum_t rev1;
+ const char *path1;
+ svn_revnum_t rev2;
+ const char *path2;
+
+ svn_boolean_t different; /* result of svn_fs_*_different */
+ svn_tristate_t changed; /* result of svn_fs_*_changed */
+ } to_compare[] =
+ {
+ /* same representation */
+ { 1, "foo", 2, "foo", FALSE, svn_tristate_false },
+ { 1, "foo", 2, "bar", FALSE, svn_tristate_false },
+ { 2, "foo", 2, "bar", FALSE, svn_tristate_false },
+
+ /* different content but MD5 check is not reliable */
+ { 3, "foo", 3, "bar", TRUE, svn_tristate_true },
+
+ /* different contents */
+ { 1, "foo", 3, "bar", TRUE, svn_tristate_true },
+ { 1, "foo", 3, "foo", TRUE, svn_tristate_true },
+ { 3, "foo", 4, "bar", TRUE, svn_tristate_true },
+ { 3, "foo", 4, "bar", TRUE, svn_tristate_true },
+ { 2, "bar", 3, "bar", TRUE, svn_tristate_true },
+ { 3, "bar", 4, "bar", TRUE, svn_tristate_true },
+
+ /* variations on the same theme: same content, possibly different rep */
+ { 4, "foo", 4, "bar", FALSE, svn_tristate_unknown },
+ { 1, "foo", 4, "bar", FALSE, svn_tristate_unknown },
+ { 2, "foo", 4, "bar", FALSE, svn_tristate_unknown },
+ { 1, "foo", 4, "foo", FALSE, svn_tristate_unknown },
+ { 2, "foo", 4, "foo", FALSE, svn_tristate_unknown },
+ { 2, "bar", 4, "bar", FALSE, svn_tristate_unknown },
+
+ /* EOL */
+ { 0 },
+ };
+
+ /* Same same, but different.
+ * Just checking that we actually have an MD5 collision. */
+ SVN_ERR(svn_checksum(&checksum1, svn_checksum_md5, evil_text1,
+ strlen(evil_text1), pool));
+ SVN_ERR(svn_checksum(&checksum2, svn_checksum_md5, evil_text2,
+ strlen(evil_text2), pool));
+ SVN_TEST_ASSERT(svn_checksum_match(checksum1, checksum1));
+ SVN_TEST_ASSERT(strcmp(evil_text1, evil_text2));
+
+ /* Now, build up our test repo. */
+ SVN_ERR(svn_test__create_fs(&fs, "test-repo-compare-contents",
+ opts, pool));
+
+ /* Rev 1: create a file. */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, iterpool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, iterpool));
+ SVN_ERR(svn_fs_make_file(txn_root, "foo", iterpool));
+ SVN_ERR(svn_test__set_file_contents(txn_root, "foo", original, iterpool));
+ SVN_ERR(svn_fs_change_node_prop(txn_root, "foo", "prop",
+ svn_string_create(original, iterpool),
+ iterpool));
+ SVN_ERR(svn_fs_commit_txn(NULL, &rev, txn, iterpool));
+ SVN_TEST_ASSERT(rev == 1);
+ svn_pool_clear(iterpool);
+
+ /* Rev 2: copy that file. */
+ SVN_ERR(svn_fs_revision_root(&root1, fs, rev, iterpool));
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, iterpool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, iterpool));
+ SVN_ERR(svn_fs_copy(root1, "foo", txn_root, "bar", iterpool));
+ SVN_ERR(svn_fs_commit_txn(NULL, &rev, txn, iterpool));
+ SVN_TEST_ASSERT(rev == 2);
+ svn_pool_clear(iterpool);
+
+ /* Rev 3: modify both files.
+ * The new contents differs for both files but has the same length and MD5.
+ */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, rev, iterpool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, iterpool));
+ SVN_ERR(svn_test__set_file_contents(txn_root, "foo", evil_text1, iterpool));
+ SVN_ERR(svn_test__set_file_contents(txn_root, "bar", evil_text2, iterpool));
+ SVN_ERR(svn_fs_change_node_prop(txn_root, "foo", "prop",
+ svn_string_create(evil_text1, iterpool),
+ iterpool));
+ SVN_ERR(svn_fs_change_node_prop(txn_root, "bar", "prop",
+ svn_string_create(evil_text2, iterpool),
+ iterpool));
+ SVN_ERR(svn_fs_commit_txn(NULL, &rev, txn, iterpool));
+ SVN_TEST_ASSERT(rev == 3);
+ svn_pool_clear(iterpool);
+
+ /* Rev 4: revert both file contents.
+ */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, rev, iterpool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, iterpool));
+ SVN_ERR(svn_test__set_file_contents(txn_root, "foo", original, iterpool));
+ SVN_ERR(svn_test__set_file_contents(txn_root, "bar", original, iterpool));
+ SVN_ERR(svn_fs_change_node_prop(txn_root, "foo", "prop",
+ svn_string_create(original, iterpool),
+ iterpool));
+ SVN_ERR(svn_fs_change_node_prop(txn_root, "bar", "prop",
+ svn_string_create(original, iterpool),
+ iterpool));
+ SVN_ERR(svn_fs_commit_txn(NULL, &rev, txn, iterpool));
+ SVN_TEST_ASSERT(rev == 4);
+ svn_pool_clear(iterpool);
+
+ /* Perform all comparisons listed in TO_COMPARE. */
+ for (i = 0; to_compare[i].rev1 > 0; ++i)
+ {
+ svn_boolean_t text_different;
+ svn_boolean_t text_changed;
+ svn_boolean_t props_different;
+ svn_boolean_t props_changed;
+
+ svn_pool_clear(iterpool);
+ SVN_ERR(svn_fs_revision_root(&root1, fs, to_compare[i].rev1, iterpool));
+ SVN_ERR(svn_fs_revision_root(&root2, fs, to_compare[i].rev2, iterpool));
+
+ /* Compare node texts. */
+ SVN_ERR(svn_fs_contents_different(&text_different,
+ root1, to_compare[i].path1,
+ root2, to_compare[i].path2,
+ iterpool));
+ SVN_ERR(svn_fs_contents_changed(&text_changed,
+ root1, to_compare[i].path1,
+ root2, to_compare[i].path2,
+ iterpool));
+
+ /* Compare properties. */
+ SVN_ERR(svn_fs_props_different(&props_different,
+ root1, to_compare[i].path1,
+ root2, to_compare[i].path2,
+ iterpool));
+ SVN_ERR(svn_fs_props_changed(&props_changed,
+ root1, to_compare[i].path1,
+ root2, to_compare[i].path2,
+ iterpool));
+
+ /* Check results. */
+ SVN_TEST_ASSERT(text_different == to_compare[i].different);
+ SVN_TEST_ASSERT(props_different == to_compare[i].different);
+
+ switch (to_compare[i].changed)
+ {
+ case svn_tristate_true:
+ SVN_TEST_ASSERT(text_changed);
+ SVN_TEST_ASSERT(props_changed);
+ break;
+
+ case svn_tristate_false:
+ SVN_TEST_ASSERT(!text_changed);
+ SVN_TEST_ASSERT(!props_changed);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ svn_pool_destroy(iterpool);
+
+ return SVN_NO_ERROR;
+}
+
+
/* ------------------------------------------------------------------------ */
/* The test table. */
@@ -5553,6 +6167,14 @@ static struct svn_test_descriptor_t test
"txn_dir_cache fail in FSFS"),
SVN_TEST_OPTS_PASS(upgrade_while_committing,
"upgrade while committing"),
+ SVN_TEST_OPTS_PASS(test_paths_changed,
+ "test svn_fs_paths_changed"),
+ SVN_TEST_OPTS_PASS(test_delete_replaced_paths_changed,
+ "test deletion after replace in changed paths list"),
+ SVN_TEST_OPTS_PASS(purge_txn_test,
+ "test purging transactions"),
+ SVN_TEST_OPTS_PASS(compare_contents,
+ "compare contents of different nodes"),
SVN_TEST_NULL
};
Propchange: subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Nov 4 11:40:16 2014
@@ -4,6 +4,7 @@ Release
test-repo-*
upgrade_*
fs-pack-test
+fs-fs-fuzzy-test
fs-fs-pack-test
test-get-set-revprop-packed-fs
get_set_multiple_huge_revprops_packed_fs
Propchange: subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c Tue Nov 4 11:40:16 2014
@@ -275,14 +275,14 @@ pack_filesystem(const svn_test_opts_t *o
return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
"Expected pack file '%s' not found", path);
- path = svn_dirent_join_many(pool, REPO_NAME, "revs",
- apr_psprintf(pool, "%d.pack", i / SHARD_SIZE),
- "manifest", SVN_VA_NULL);
- SVN_ERR(svn_io_check_path(path, &kind, pool));
- if (kind != svn_node_file)
- return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
- "Expected manifest file '%s' not found",
- path);
+ path = svn_dirent_join_many(pool, REPO_NAME, "revs",
+ apr_psprintf(pool, "%d.pack", i / SHARD_SIZE),
+ "manifest", SVN_VA_NULL);
+ SVN_ERR(svn_io_check_path(path, &kind, pool));
+ if (kind != svn_node_file)
+ return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
+ "Expected manifest file '%s' not found",
+ path);
/* This directory should not exist. */
path = svn_dirent_join_many(pool, REPO_NAME, "revs",
@@ -493,7 +493,7 @@ get_set_large_revprop_packed_fs(const sv
* files but do not exceed the pack size limit. */
for (rev = 0; rev <= MAX_REV; ++rev)
SVN_ERR(svn_fs_change_rev_prop(fs, rev, SVN_PROP_REVISION_LOG,
- large_log(rev, 15000, pool),
+ large_log(rev, 1000, pool),
pool));
/* verify */
@@ -502,20 +502,20 @@ get_set_large_revprop_packed_fs(const sv
SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
SVN_PROP_REVISION_LOG, pool));
SVN_TEST_STRING_ASSERT(prop_value->data,
- large_log(rev, 15000, pool)->data);
+ large_log(rev, 1000, pool)->data);
}
/* Put a larger revprop into the last, some middle and the first revision
* of a pack. This should cause the packs to split in the middle. */
SVN_ERR(svn_fs_change_rev_prop(fs, 3, SVN_PROP_REVISION_LOG,
/* rev 0 is not packed */
- large_log(3, 37000, pool),
+ large_log(3, 2400, pool),
pool));
SVN_ERR(svn_fs_change_rev_prop(fs, 5, SVN_PROP_REVISION_LOG,
- large_log(5, 25000, pool),
+ large_log(5, 1500, pool),
pool));
SVN_ERR(svn_fs_change_rev_prop(fs, 8, SVN_PROP_REVISION_LOG,
- large_log(8, 25000, pool),
+ large_log(8, 1500, pool),
pool));
/* verify */
@@ -526,13 +526,13 @@ get_set_large_revprop_packed_fs(const sv
if (rev == 3)
SVN_TEST_STRING_ASSERT(prop_value->data,
- large_log(rev, 37000, pool)->data);
+ large_log(rev, 2400, pool)->data);
else if (rev == 5 || rev == 8)
SVN_TEST_STRING_ASSERT(prop_value->data,
- large_log(rev, 25000, pool)->data);
+ large_log(rev, 1500, pool)->data);
else
SVN_TEST_STRING_ASSERT(prop_value->data,
- large_log(rev, 15000, pool)->data);
+ large_log(rev, 1000, pool)->data);
}
return SVN_NO_ERROR;
@@ -780,7 +780,7 @@ pack_shard_size_one(const svn_test_opts_
#undef SHARD_SIZE
#undef MAX_REV
/* ------------------------------------------------------------------------ */
-#define REPO_NAME "get_set_multiple_huge_revprops_packed_fs"
+#define REPO_NAME "test-repo-get_set_multiple_huge_revprops_packed_fs"
#define SHARD_SIZE 4
#define MAX_REV 9
static svn_error_t *
@@ -1015,7 +1015,7 @@ upgrade_txns_to_log_addressing(const svn
}
#undef SHARD_SIZE
-#define REPO_NAME "upgrade_new_txns_to_log_addressing"
+#define REPO_NAME "test-repo-upgrade_new_txns_to_log_addressing"
#define MAX_REV 8
static svn_error_t *
upgrade_new_txns_to_log_addressing(const svn_test_opts_t *opts,
@@ -1030,7 +1030,7 @@ upgrade_new_txns_to_log_addressing(const
#undef MAX_REV
/* ------------------------------------------------------------------------ */
-#define REPO_NAME "upgrade_old_txns_to_log_addressing"
+#define REPO_NAME "test-repo-upgrade_old_txns_to_log_addressing"
#define MAX_REV 8
static svn_error_t *
upgrade_old_txns_to_log_addressing(const svn_test_opts_t *opts,
@@ -1047,7 +1047,7 @@ upgrade_old_txns_to_log_addressing(const
/* ------------------------------------------------------------------------ */
-#define REPO_NAME "revprop_caching_on_off"
+#define REPO_NAME "test-repo-revprop_caching_on_off"
static svn_error_t *
revprop_caching_on_off(const svn_test_opts_t *opts,
apr_pool_t *pool)
Copied: subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c (from r1636534, subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c)
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c?p2=subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c&p1=subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c&r1=1636534&r2=1636544&rev=1636544&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c Tue Nov 4 11:40:16 2014
@@ -261,160 +261,6 @@ get_repo_stats(const svn_test_opts_t *op
#undef REPO_NAME
-/* ------------------------------------------------------------------------ */
-
-#define REPO_NAME "test-repo-dump-index-test"
-
-typedef struct dump_baton_t
-{
- /* Number of callback invocations so far */
- int invocations;
-
- /* Rev file location we expect to be reported next */
- apr_off_t offset;
-
- /* All items must be from this revision. */
- svn_revnum_t revision;
-
- /* Track the item numbers we have already seen. */
- svn_bit_array__t *numbers_seen;
-} dump_baton_t;
-
-static svn_error_t *
-dump_index_entry(const svn_fs_fs__p2l_entry_t *entry,
- void *baton_p,
- apr_pool_t *scratch_pool)
-{
- dump_baton_t *baton = baton_p;
-
- /* Count invocations. */
- baton->invocations++;
-
- /* We expect a report of contiguous non-empty items. */
- SVN_TEST_ASSERT(entry->offset == baton->offset);
- SVN_TEST_ASSERT(entry->size > 0 && entry->size < 1000);
- baton->offset += entry->size;
-
- /* Type must be valid. */
- SVN_TEST_ASSERT( entry->type > SVN_FS_FS__ITEM_TYPE_UNUSED
- && entry->type <= SVN_FS_FS__ITEM_TYPE_CHANGES);
-
- /* We expect all items to be from the specified revision. */
- SVN_TEST_ASSERT(entry->item.revision == baton->revision);
-
- /* Item numnber must be plausibly small and unique. */
- SVN_TEST_ASSERT(entry->item.number < 100);
- SVN_TEST_ASSERT(!svn_bit_array__get(baton->numbers_seen,
- (apr_size_t)entry->item.number));
- svn_bit_array__set(baton->numbers_seen, (apr_size_t)entry->item.number, 1);
-
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-dump_index(const svn_test_opts_t *opts,
- apr_pool_t *pool)
-{
- svn_repos_t *repos;
- svn_revnum_t rev;
- dump_baton_t baton;
-
- /* Bail (with success) on known-untestable scenarios */
- if (strcmp(opts->fs_type, "fsfs") != 0)
- return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
- "this will test FSFS repositories only");
-
- if (opts->server_minor_version && (opts->server_minor_version < 9))
- return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
- "pre-1.9 SVN doesn't have FSFS indexes");
-
- /* Create a filesystem */
- SVN_ERR(create_greek_repo(&repos, &rev, opts, REPO_NAME, pool, pool));
-
- /* Read the index data for REV from that repo. */
- baton.invocations = 0;
- baton.offset = 0;
- baton.revision = rev;
- baton.numbers_seen = svn_bit_array__create(100, pool);
- SVN_ERR(svn_fs_fs__dump_index(svn_repos_fs(repos), rev, dump_index_entry,
- &baton, NULL, NULL, pool));
-
- /* Check that we've got all data (20 noderevs + 20 reps + 1 changes list). */
- SVN_TEST_ASSERT(baton.invocations == 41);
-
- return SVN_NO_ERROR;
-}
-
-#undef REPO_NAME
-
-/* ------------------------------------------------------------------------ */
-
-#define REPO_NAME "test-repo-load-index-test"
-
-static svn_error_t *
-receive_index(const svn_fs_fs__p2l_entry_t *entry,
- void *baton,
- apr_pool_t *scratch_pool)
-{
- apr_array_header_t *entries = baton;
- APR_ARRAY_PUSH(entries, svn_fs_fs__p2l_entry_t *)
- = apr_pmemdup(entries->pool, entry, sizeof(*entry));
-
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-load_index(const svn_test_opts_t *opts,
- apr_pool_t *pool)
-{
- svn_repos_t *repos;
- svn_revnum_t rev;
- apr_array_header_t *entries = apr_array_make(pool, 41, sizeof(void *));
- apr_array_header_t *alt_entries = apr_array_make(pool, 1, sizeof(void *));
- svn_fs_fs__p2l_entry_t entry;
-
- /* Bail (with success) on known-untestable scenarios */
- if (strcmp(opts->fs_type, "fsfs") != 0)
- return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
- "this will test FSFS repositories only");
-
- if (opts->server_minor_version && (opts->server_minor_version < 9))
- return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
- "pre-1.9 SVN doesn't have FSFS indexes");
-
- /* Create a filesystem */
- SVN_ERR(create_greek_repo(&repos, &rev, opts, REPO_NAME, pool, pool));
-
- /* Read the original index contents for REV in ENTRIES. */
- SVN_ERR(svn_fs_fs__dump_index(svn_repos_fs(repos), rev, receive_index,
- entries, NULL, NULL, pool));
-
- /* Replace it with an empty index.
- * Note that the API requires at least one entry. Give it a dummy. */
- entry.offset = 0;
- entry.size = 0;
- entry.type = SVN_FS_FS__ITEM_TYPE_UNUSED;
- entry.item.number = SVN_FS_FS__ITEM_INDEX_UNUSED;
- entry.item.revision = SVN_INVALID_REVNUM;
- APR_ARRAY_PUSH(alt_entries, svn_fs_fs__p2l_entry_t *) = &entry;
-
- SVN_ERR(svn_fs_fs__load_index(svn_repos_fs(repos), rev, alt_entries, pool));
- SVN_TEST_ASSERT_ERROR(svn_repos_verify_fs3(repos, rev, rev,
- FALSE, FALSE, FALSE,
- NULL, NULL, NULL, NULL, pool),
- SVN_ERR_REPOS_CORRUPTED);
-
- /* Restore the original index. */
- SVN_ERR(svn_fs_fs__load_index(svn_repos_fs(repos), rev, entries, pool));
- SVN_ERR(svn_repos_verify_fs3(repos, rev, rev, FALSE, FALSE, FALSE,
- NULL, NULL, NULL, NULL, pool));
-
- return SVN_NO_ERROR;
-}
-
-#undef REPO_NAME
-
-
/* The test table. */
static int max_threads = 0;
@@ -424,10 +270,6 @@ static struct svn_test_descriptor_t test
SVN_TEST_NULL,
SVN_TEST_OPTS_PASS(get_repo_stats,
"get statistics on a FSFS filesystem"),
- SVN_TEST_OPTS_PASS(dump_index,
- "dump the P2L index"),
- SVN_TEST_OPTS_PASS(load_index,
- "load the P2L index"),
SVN_TEST_NULL
};
Propchange: subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_x/
------------------------------------------------------------------------------
Merged /subversion/trunk/subversion/tests/libsvn_fs_x:r1623969-1636534
Modified: subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_x/fs-x-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_x/fs-x-pack-test.c?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_x/fs-x-pack-test.c (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_x/fs-x-pack-test.c Tue Nov 4 11:40:16 2014
@@ -294,30 +294,12 @@ pack_filesystem(const svn_test_opts_t *o
apr_psprintf(pool, "%d.pack", i / SHARD_SIZE),
"pack", SVN_VA_NULL);
- /* These files should exist. */
+ /* This file should exist. */
SVN_ERR(svn_io_check_path(path, &kind, pool));
if (kind != svn_node_file)
return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
"Expected pack file '%s' not found", path);
- path = svn_dirent_join_many(pool, REPO_NAME, "revs",
- apr_psprintf(pool, "%d.pack", i / SHARD_SIZE),
- "pack.l2p", SVN_VA_NULL);
- SVN_ERR(svn_io_check_path(path, &kind, pool));
- if (kind != svn_node_file)
- return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
- "Expected log-to-phys index file '%s' not found",
- path);
-
- path = svn_dirent_join_many(pool, REPO_NAME, "revs",
- apr_psprintf(pool, "%d.pack", i / SHARD_SIZE),
- "pack.p2l", SVN_VA_NULL);
- SVN_ERR(svn_io_check_path(path, &kind, pool));
- if (kind != svn_node_file)
- return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
- "Expected phys-to-log index file '%s' not found",
- path);
-
/* This directory should not exist. */
path = svn_dirent_join_many(pool, REPO_NAME, "revs",
apr_psprintf(pool, "%d", i / SHARD_SIZE),
Modified: subversion/branches/remove-log-addressing/subversion/tests/libsvn_subr/skel-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/libsvn_subr/skel-test.c?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/libsvn_subr/skel-test.c (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/libsvn_subr/skel-test.c Tue Nov 4 11:40:16 2014
@@ -59,7 +59,7 @@ get_empty_string(apr_pool_t *pool)
{
svn_pool_clear(pool);
- return svn_stringbuf_ncreate(0, 0, pool);
+ return svn_stringbuf_create_empty(pool);
}
/* Parse a skeleton from a Subversion string. */
Modified: subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/wc-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/wc-test.c?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/wc-test.c (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/wc-test.c Tue Nov 4 11:40:16 2014
@@ -23,6 +23,9 @@
#include <apr_pools.h>
#include <apr_general.h>
+#include <apr_md5.h>
+
+#define SVN_DEPRECATED
#include "svn_types.h"
#include "svn_io.h"
@@ -305,6 +308,132 @@ test_externals_parse_erratic(apr_pool_t
return SVN_NO_ERROR;
}
+static svn_error_t *
+test_legacy_commit1(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+ svn_test__sandbox_t b;
+ svn_wc_adm_access_t *adm_access;
+ const char *lambda;
+
+ SVN_ERR(svn_test__sandbox_create(&b, "legacy_commit1", opts, pool));
+ SVN_ERR(sbox_add_and_commit_greek_tree(&b));
+
+ SVN_ERR(sbox_wc_copy(&b, "A", "A_copied"));
+
+ lambda = sbox_wc_path(&b, "A_copied/B/lambda");
+
+
+ SVN_ERR(svn_io_remove_file2(lambda, FALSE, pool));
+ SVN_ERR(svn_io_copy_file(sbox_wc_path(&b, "iota"), lambda, FALSE, pool));
+ SVN_ERR(svn_wc_adm_open3(&adm_access, NULL, b.wc_abspath, TRUE, -1,
+ NULL, NULL, pool));
+
+ {
+ svn_wc_status2_t *status;
+
+ SVN_ERR(svn_wc_status2(&status, lambda, adm_access, pool));
+
+ SVN_TEST_ASSERT(status != NULL);
+ SVN_TEST_ASSERT(status->text_status == svn_wc_status_modified);
+ SVN_TEST_ASSERT(status->copied == TRUE);
+ }
+
+ /* Simulate a very old style svn ci . -m "QQQ" on the WC root */
+ SVN_ERR(svn_wc_process_committed4(sbox_wc_path(&b, "A_copied"), adm_access,
+ TRUE, 12, "2014-10-01T19:00:50.966679Z",
+ "me", NULL, TRUE, TRUE,
+ NULL, pool));
+
+ {
+ unsigned char digest[APR_MD5_DIGESTSIZE];
+
+ /* Use the fact that iota has the same checksum to ease committing */
+
+ SVN_ERR(svn_io_file_checksum (digest, lambda, pool));
+
+ SVN_ERR(svn_wc_process_committed4(lambda, adm_access,
+ TRUE, 12, "2014-10-01T19:00:50.966679Z",
+ "me", NULL, TRUE, TRUE,
+ digest, pool));
+ }
+
+ {
+ svn_wc_status2_t *status;
+
+ SVN_ERR(svn_wc_status2(&status, lambda, adm_access, pool));
+
+ /* Node is still modified, as we didn't change the text base! */
+ SVN_TEST_ASSERT(status != NULL);
+ SVN_TEST_ASSERT(status->text_status == svn_wc_status_normal);
+ SVN_TEST_ASSERT(status->copied == FALSE);
+ }
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+test_legacy_commit2(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+ svn_test__sandbox_t b;
+ svn_wc_adm_access_t *adm_access;
+ const char *lambda;
+ svn_wc_committed_queue_t *queue;
+
+ SVN_ERR(svn_test__sandbox_create(&b, "legacy_commit2", opts, pool));
+ SVN_ERR(sbox_add_and_commit_greek_tree(&b));
+
+ SVN_ERR(sbox_wc_copy(&b, "A", "A_copied"));
+
+ lambda = sbox_wc_path(&b, "A_copied/B/lambda");
+
+ SVN_ERR(svn_io_remove_file2(lambda, FALSE, pool));
+ SVN_ERR(svn_io_copy_file(sbox_wc_path(&b, "iota"), lambda, FALSE, pool));
+
+ SVN_ERR(svn_wc_adm_open3(&adm_access, NULL, b.wc_abspath, TRUE, -1,
+ NULL, NULL, pool));
+
+ {
+ svn_wc_status2_t *status;
+
+ SVN_ERR(svn_wc_status2(&status, lambda, adm_access, pool));
+
+ SVN_TEST_ASSERT(status != NULL);
+ SVN_TEST_ASSERT(status->text_status == svn_wc_status_modified);
+ SVN_TEST_ASSERT(status->copied == TRUE);
+ }
+
+ /* Simulate an old style svn ci . -m "QQQ" on the WC root */
+ queue = svn_wc_committed_queue_create(pool);
+ SVN_ERR(svn_wc_queue_committed(&queue, sbox_wc_path(&b, "A_copied"), adm_access,
+ TRUE, NULL, FALSE, FALSE, NULL, pool));
+ {
+ unsigned char digest[APR_MD5_DIGESTSIZE];
+
+ /* Use the fact that iota has the same checksum to ease committing */
+
+ SVN_ERR(svn_io_file_checksum(digest, lambda, pool));
+
+ SVN_ERR(svn_wc_queue_committed(&queue, lambda, adm_access, FALSE, NULL,
+ FALSE, FALSE, digest, pool));
+ }
+
+ SVN_ERR(svn_wc_process_committed_queue(queue, adm_access,
+ 12, "2014-10-01T19:00:50.966679Z",
+ "me", pool));
+
+ {
+ svn_wc_status2_t *status;
+
+ SVN_ERR(svn_wc_status2(&status, lambda, adm_access, pool));
+
+ /* Node is still modified, as we didn't change the text base! */
+ SVN_TEST_ASSERT(status != NULL);
+ SVN_TEST_ASSERT(status->text_status == svn_wc_status_normal);
+ SVN_TEST_ASSERT(status->copied == FALSE);
+ }
+
+ return SVN_NO_ERROR;
+}
/* ---------------------------------------------------------------------- */
/* The list of test functions */
@@ -322,6 +451,10 @@ static struct svn_test_descriptor_t test
"test svn_wc_parse_externals_description3"),
SVN_TEST_PASS2(test_externals_parse_erratic,
"parse erratic externals definition"),
+ SVN_TEST_OPTS_PASS(test_legacy_commit1,
+ "test legacy commit1"),
+ SVN_TEST_OPTS_PASS(test_legacy_commit2,
+ "test legacy commit2"),
SVN_TEST_NULL
};
Modified: subversion/branches/remove-log-addressing/subversion/tests/svn_test.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/svn_test.h?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/svn_test.h (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/svn_test.h Tue Nov 4 11:40:16 2014
@@ -74,6 +74,23 @@ extern "C" {
svn_error_clear(err__); \
} while (0)
+/** Handy macro for testing that an svn_error_t is returned.
+ * The result must be neither SVN_NO_ERROR nor SVN_ERR_ASSERTION_FAIL.
+ * The error returned by EXPR will be cleared.
+ */
+#define SVN_TEST_ASSERT_ANY_ERROR(expr) \
+ do { \
+ svn_error_t *err__ = (expr); \
+ if (err__ == SVN_NO_ERROR || err__->apr_err == SVN_ERR_ASSERTION_FAIL)\
+ return err__ ? svn_error_createf(SVN_ERR_TEST_FAILED, err__, \
+ "Expected error but got %s", \
+ "SVN_ERR_ASSERTION_FAIL") \
+ : svn_error_createf(SVN_ERR_TEST_FAILED, err__, \
+ "Expected error but got %s", \
+ "SVN_NO_ERROR"); \
+ svn_error_clear(err__); \
+ } while (0)
+
/** Handy macro for testing string equality.
*
* EXPR and/or EXPECTED_EXPR may be NULL which compares equal to NULL and
Modified: subversion/branches/remove-log-addressing/subversion/tests/svn_test_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/svn_test_fs.c?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/svn_test_fs.c (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/svn_test_fs.c Tue Nov 4 11:40:16 2014
@@ -371,10 +371,19 @@ validate_tree_entry(svn_fs_root_t *root,
{
svn_stream_t *rstream;
svn_stringbuf_t *rstring;
- svn_boolean_t is_dir;
+ svn_node_kind_t kind;
+ svn_boolean_t is_dir, is_file;
- /* Verify that this is the expected type of node */
+ /* Verify that node types are reported consistently. */
+ SVN_ERR(svn_fs_check_path(&kind, root, path, pool));
SVN_ERR(svn_fs_is_dir(&is_dir, root, path, pool));
+ SVN_ERR(svn_fs_is_file(&is_file, root, path, pool));
+
+ SVN_TEST_ASSERT(!is_dir || kind == svn_node_dir);
+ SVN_TEST_ASSERT(!is_file || kind == svn_node_file);
+ SVN_TEST_ASSERT(is_dir || is_file);
+
+ /* Verify that this is the expected type of node */
if ((!is_dir && !contents) || (is_dir && contents))
return svn_error_createf
(SVN_ERR_FS_GENERAL, NULL,
@@ -384,10 +393,17 @@ validate_tree_entry(svn_fs_root_t *root,
/* Verify that the contents are as expected (files only) */
if (! is_dir)
{
+ svn_stringbuf_t *expected = svn_stringbuf_create(contents, pool);
+
+ /* File lengths. */
+ svn_filesize_t length;
+ SVN_ERR(svn_fs_file_length(&length, root, path, pool));
+ SVN_TEST_ASSERT(expected->len == length);
+
+ /* Text contents. */
SVN_ERR(svn_fs_file_contents(&rstream, root, path, pool));
SVN_ERR(svn_test__stream_to_string(&rstring, rstream, pool));
- if (! svn_stringbuf_compare(rstring,
- svn_stringbuf_create(contents, pool)))
+ if (! svn_stringbuf_compare(rstring, expected))
return svn_error_createf
(SVN_ERR_FS_GENERAL, NULL,
"node '%s' in tree had unexpected contents",
@@ -417,6 +433,9 @@ svn_test__validate_tree(svn_fs_root_t *r
apr_hash_index_t *hi;
int i;
+ /* There should be no entry with this name. */
+ const char *na_name = "es-vee-en";
+
/* Create a hash for storing our expected entries */
expected_entries = apr_hash_make(subpool);
@@ -505,6 +524,23 @@ svn_test__validate_tree(svn_fs_root_t *r
svn_stringbuf_appendcstr(extra_entries, "\n");
}
+ /* Test that non-existent paths will not be found.
+ * Skip this test if somebody sneakily added NA_NAME. */
+ if (!svn_hash_gets(expected_entries, na_name))
+ {
+ svn_node_kind_t kind;
+ svn_boolean_t is_dir, is_file;
+
+ /* Verify that the node is reported as "n/a". */
+ SVN_ERR(svn_fs_check_path(&kind, root, na_name, subpool));
+ SVN_ERR(svn_fs_is_dir(&is_dir, root, na_name, subpool));
+ SVN_ERR(svn_fs_is_file(&is_file, root, na_name, subpool));
+
+ SVN_TEST_ASSERT(kind == svn_node_none);
+ SVN_TEST_ASSERT(!is_file);
+ SVN_TEST_ASSERT(!is_dir);
+ }
+
if (missing_entries || extra_entries || corrupt_entries)
{
return svn_error_createf
Modified: subversion/branches/remove-log-addressing/tools/client-side/bash_completion
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/tools/client-side/bash_completion?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/tools/client-side/bash_completion (original)
+++ subversion/branches/remove-log-addressing/tools/client-side/bash_completion Tue Nov 4 11:40:16 2014
@@ -1038,7 +1038,8 @@ _svnadmin ()
cur=${COMP_WORDS[COMP_CWORD]}
# Possible expansions, without pure-prefix abbreviations such as "h".
- cmds='crashtest create deltify dump freeze help hotcopy info list-dblogs \
+ cmds='crashtest create delrevprop deltify dump freeze help hotcopy \
+ info list-dblogs \
list-unused-dblogs load lock lslocks lstxns pack recover rmlocks \
rmtxns setlog setrevprop setuuid unlock upgrade verify --version'
@@ -1101,8 +1102,9 @@ _svnadmin ()
setlog)
cmdOpts="-r --revision --bypass-hooks"
;;
- setrevprop)
- cmdOpts="-r --revision --use-pre-revprop-change-hook \
+ setrevprop|delrevprop)
+ cmdOpts="-r --revision -t --transaction \
+ --use-pre-revprop-change-hook \
--use-post-revprop-change-hook"
;;
verify)
@@ -1134,6 +1136,8 @@ _svnadmin ()
--help) cmdOpts=${cmdOpts/ -h / } ;;
-r) cmdOpts=${cmdOpts/ --revision / } ;;
--revision) cmdOpts=${cmdOpts/ -r / } ;;
+ -t) cmdOpts=${cmdOpts/ --transaction / } ;;
+ --transaction) cmdOpts=${cmdOpts/ -t / } ;;
-F) cmdOpts=${cmdOpts/ --file / } ;;
--file) cmdOpts=${cmdOpts/ -F / } ;;
-M) cmdOpts=${cmdOpts/ --memory-cache-size / } ;;
Modified: subversion/branches/remove-log-addressing/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/tools/dev/unix-build/Makefile.svn?rev=1636544&r1=1636543&r2=1636544&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/remove-log-addressing/tools/dev/unix-build/Makefile.svn Tue Nov 4 11:40:16 2014
@@ -74,7 +74,7 @@ GNU_ICONV_VER = 1.14
APR_UTIL_VER = 1.5.3
HTTPD_VER = 2.2.29
NEON_VER = 0.30.0
-SERF_VER = 1.3.7
+SERF_VER = 1.3.8
SERF_OLD_VER = 0.3.1
CYRUS_SASL_VER = 2.1.25
SQLITE_VER = 3080500
@@ -638,6 +638,14 @@ $(HTTPD_OBJDIR)/.retrieved: $(DISTDIR)/$
sed 's/^\(#if (OPENSSL_VERSION_NUMBER >= 0x00908000)\)$$/\1 \&\& !defined(OPENSSL_NO_COMP)/' \
< $(HTTPD_SRCDIR)/modules/ssl/ssl_engine_vars.c.orig \
> $(HTTPD_SRCDIR)/modules/ssl/ssl_engine_vars.c
+ cp $(HTTPD_SRCDIR)/modules/ssl/ssl_engine_init.c \
+ $(HTTPD_SRCDIR)/modules/ssl/ssl_engine_init.c.orig
+ $(foreach f, ssl_engine_init.c ssl_util_ssl.c ssl_util_ssl.h, \
+ cp $(HTTPD_SRCDIR)/modules/ssl/${f} $(HTTPD_SRCDIR)/modules/ssl/${f}.orig; \
+ sed 's/SSL_CTX_use_certificate_chain/_SSL_CTX_use_certificate_chain/' \
+ < $(HTTPD_SRCDIR)/modules/ssl/${f}.orig \
+ > $(HTTPD_SRCDIR)/modules/ssl/${f};\
+ )
touch $@
# configure httpd