3264
/* Notification receiver for test_dump_bad_mergeinfo(). This does not
3265
need to do anything, it just needs to exist.
3268
dump_r0_mergeinfo_notifier(void *baton,
3269
const svn_repos_notify_t *notify,
3270
apr_pool_t *scratch_pool)
3274
/* Regression test for part the 'dump' part of issue #4476 "Mergeinfo
3275
containing r0 makes svnsync and svnadmin dump fail". */
3276
static svn_error_t *
3277
test_dump_r0_mergeinfo(const svn_test_opts_t *opts,
3283
svn_fs_root_t *txn_root;
3284
svn_revnum_t youngest_rev = 0;
3285
const svn_string_t *bad_mergeinfo = svn_string_create("/foo:0", pool);
3287
SVN_ERR(svn_test__create_repos(&repos, "test-repo-dump-r0-mergeinfo",
3289
fs = svn_repos_fs(repos);
3291
/* Revision 1: Any commit will do, here */
3292
SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, pool));
3293
SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
3294
SVN_ERR(svn_fs_make_dir(txn_root, "/bar", pool));
3295
SVN_ERR(svn_repos_fs_commit_txn(NULL, repos, &youngest_rev, txn, pool));
3296
SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(youngest_rev));
3298
/* Revision 2: Add bad mergeinfo */
3299
SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, pool));
3300
SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
3301
SVN_ERR(svn_fs_change_node_prop(txn_root, "/bar", "svn:mergeinfo", bad_mergeinfo, pool));
3302
SVN_ERR(svn_repos_fs_commit_txn(NULL, repos, &youngest_rev, txn, pool));
3303
SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(youngest_rev));
3305
/* Test that a dump completes without error. In order to exercise the
3306
functionality under test -- that is, in order for the dump to try to
3307
parse the mergeinfo it is dumping -- the dump must start from a
3308
revision greater than 1 and must take a notification callback. */
3310
svn_stringbuf_t *stringbuf = svn_stringbuf_create_empty(pool);
3311
svn_stream_t *stream = svn_stream_from_stringbuf(stringbuf, pool);
3313
SVN_ERR(svn_repos_dump_fs3(repos, stream, 2, SVN_INVALID_REVNUM,
3315
dump_r0_mergeinfo_notifier, NULL,
3320
return SVN_NO_ERROR;
3264
3323
/* The test table. */
3266
3325
struct svn_test_descriptor_t test_funcs[] =
3306
3365
"test svn_repos_delete"),
3307
3366
SVN_TEST_OPTS_PASS(filename_with_control_chars,
3308
3367
"test filenames with control characters"),
3368
SVN_TEST_OPTS_PASS(test_dump_r0_mergeinfo,
3369
"test dumping with r0 mergeinfo"),