You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/05/07 15:26:27 UTC
svn commit: r1479901 [7/7] - in /subversion/branches/wc-collate-path: ./
build/ac-macros/ build/generator/ build/generator/templates/
contrib/server-side/fsfsfixer/ contrib/server-side/fsfsfixer/fixer/
subversion/bindings/ctypes-python/ subversion/bind...
Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_delta/range-index-test.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_delta/range-index-test.h?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_delta/range-index-test.h (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_delta/range-index-test.h Tue May 7 13:26:25 2013
@@ -27,7 +27,7 @@
#include "../../libsvn_delta/compose_delta.c"
static range_index_node_t *prev_node, *prev_prev_node;
-static apr_off_t
+static apr_size_t
walk_range_index(range_index_node_t *node, const char **msg)
{
apr_off_t ret;
@@ -70,19 +70,18 @@ print_node_data(range_index_node_t *node
{
if (-node->target_offset == ndx)
{
- printf(" * Node: [%3"APR_OFF_T_FMT
- ",%3"APR_OFF_T_FMT
- ") = %-5"APR_OFF_T_FMT"%s\n",
+ printf(" * Node: [%3"APR_SIZE_T_FMT
+ ",%3"APR_SIZE_T_FMT
+ ") = %-5"APR_SIZE_T_FMT"%s\n",
node->offset, node->limit, -node->target_offset, msg);
}
else
{
- printf(" Node: [%3"APR_OFF_T_FMT
- ",%3"APR_OFF_T_FMT
- ") = %"APR_OFF_T_FMT"\n",
+ printf(" Node: [%3"APR_SIZE_T_FMT
+ ",%3"APR_SIZE_T_FMT
+ ") = %"APR_SIZE_T_FMT"\n",
node->offset, node->limit,
- (node->target_offset < 0
- ? -node->target_offset : node->target_offset));
+ node->target_offset);
}
}
@@ -154,13 +153,13 @@ random_range_index_test(apr_pool_t *pool
ndx = create_range_index(pool);
for (i = 1; i <= iterations; ++i)
{
- apr_off_t offset = svn_test_rand(&seed) % 47;
- apr_off_t limit = offset + svn_test_rand(&seed) % 16 + 1;
+ apr_size_t offset = svn_test_rand(&seed) % 47;
+ apr_size_t limit = offset + svn_test_rand(&seed) % 16 + 1;
range_list_node_t *list, *r;
- apr_off_t ret;
+ apr_size_t ret;
const char *msg2;
- printf("%3d: Inserting [%3"APR_OFF_T_FMT",%3"APR_OFF_T_FMT") ...",
+ printf("%3d: Inserting [%3"APR_SIZE_T_FMT",%3"APR_SIZE_T_FMT") ...",
i, offset, limit);
splay_range_index(offset, ndx);
list = build_range_list(offset, limit, ndx);
@@ -170,7 +169,7 @@ random_range_index_test(apr_pool_t *pool
if (ret == 0)
{
for (r = list; r; r = r->next)
- printf(" %s[%3"APR_OFF_T_FMT",%3"APR_OFF_T_FMT")",
+ printf(" %s[%3"APR_SIZE_T_FMT",%3"APR_SIZE_T_FMT")",
(r->kind == range_from_source ?
(++src_cp, "S") : (++tgt_cp, "T")),
r->offset, r->limit);
Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_fs/fs-test.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_fs/fs-test.c Tue May 7 13:26:25 2013
@@ -2074,7 +2074,7 @@ copy_test(const svn_test_opts_t *opts,
svn_revnum_t after_rev;
/* Prepare a filesystem. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-copy-test",
+ SVN_ERR(svn_test__create_fs(&fs, "test-repo-copy",
opts, pool));
/* In first txn, create and commit the greek tree. */
@@ -4237,7 +4237,7 @@ branch_test(const svn_test_opts_t *opts,
svn_revnum_t youngest_rev = 0;
/* Create a filesystem and repository. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-branch-test",
+ SVN_ERR(svn_test__create_fs(&fs, "test-repo-branch",
opts, pool));
/*** Revision 1: Create the greek tree in revision. ***/
@@ -4984,7 +4984,6 @@ filename_trailing_newline(const svn_test
return SVN_NO_ERROR;
}
-#ifdef SVN_FS_INFO
static svn_error_t *
test_fs_info_format(const svn_test_opts_t *opts,
apr_pool_t *pool)
@@ -5005,7 +5004,6 @@ test_fs_info_format(const svn_test_opts_
return SVN_NO_ERROR;
}
-#endif
/* ------------------------------------------------------------------------ */
@@ -5089,9 +5087,7 @@ struct svn_test_descriptor_t test_funcs[
"test svn_fs_delete_fs"),
SVN_TEST_OPTS_PASS(filename_trailing_newline,
"filenames with trailing \\n might be rejected"),
-#ifdef SVN_FS_INFO
SVN_TEST_OPTS_PASS(test_fs_info_format,
"test svn_fs_info_format"),
-#endif
SVN_TEST_NULL
};
Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_fs_fs/fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_fs_fs/fs-pack-test.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_fs_fs/fs-pack-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_fs_fs/fs-pack-test.c Tue May 7 13:26:25 2013
@@ -788,6 +788,50 @@ file_hint_at_shard_boundary(const svn_te
#undef SHARD_SIZE
/* ------------------------------------------------------------------------ */
+#define REPO_NAME "test-repo-fsfs-info"
+#define SHARD_SIZE 3
+#define MAX_REV 5
+static svn_error_t *
+test_info(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ const svn_fs_fsfs_info_t *fsfs_info;
+ const svn_fs_info_placeholder_t *info;
+
+ SVN_ERR(create_packed_filesystem(REPO_NAME, opts, MAX_REV, SHARD_SIZE,
+ pool));
+
+ SVN_ERR(svn_fs_open(&fs, REPO_NAME, NULL, pool));
+ SVN_ERR(svn_fs_info(&info, fs, pool, pool));
+ info = svn_fs_info_dup(info, pool, pool);
+
+ SVN_TEST_STRING_ASSERT(opts->fs_type, info->fs_type);
+
+ /* Bail (with success) on known-untestable scenarios */
+ if (strcmp(opts->fs_type, "fsfs") != 0)
+ return SVN_NO_ERROR;
+
+ fsfs_info = (const void *)info;
+ if (opts->server_minor_version && (opts->server_minor_version < 6))
+ {
+ SVN_TEST_ASSERT(fsfs_info->shard_size == 0);
+ SVN_TEST_ASSERT(fsfs_info->min_unpacked_rev == 0);
+ }
+ else
+ {
+ SVN_TEST_ASSERT(fsfs_info->shard_size == SHARD_SIZE);
+ SVN_TEST_ASSERT(fsfs_info->min_unpacked_rev
+ == (MAX_REV + 1) / SHARD_SIZE * SHARD_SIZE);
+ }
+
+ return SVN_NO_ERROR;
+}
+#undef REPO_NAME
+#undef SHARD_SIZE
+#undef MAX_REV
+
+/* ------------------------------------------------------------------------ */
/* The test table. */
@@ -812,5 +856,7 @@ struct svn_test_descriptor_t test_funcs[
"recover a fully packed filesystem"),
SVN_TEST_OPTS_PASS(file_hint_at_shard_boundary,
"test file hint at shard boundary"),
+ SVN_TEST_OPTS_PASS(test_info,
+ "test svn_fs_info"),
SVN_TEST_NULL
};
Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_repos/repos-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_repos/repos-test.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_repos/repos-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_repos/repos-test.c Tue May 7 13:26:25 2013
@@ -3259,7 +3259,6 @@ filename_with_control_chars(const svn_te
return SVN_NO_ERROR;
}
-#ifdef SVN_FS_INFO
static svn_error_t *
test_repos_info(const svn_test_opts_t *opts,
apr_pool_t *pool)
@@ -3297,7 +3296,6 @@ test_repos_info(const svn_test_opts_t *o
return SVN_NO_ERROR;
}
-#endif
/* The test table. */
@@ -3345,9 +3343,7 @@ struct svn_test_descriptor_t test_funcs[
"test svn_repos_delete"),
SVN_TEST_OPTS_PASS(filename_with_control_chars,
"test filenames with control characters"),
-#ifdef SVN_FS_INFO
SVN_TEST_OPTS_PASS(test_repos_info,
"test svn_repos_info_*"),
-#endif
SVN_TEST_NULL
};
Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/cache-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/cache-test.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/cache-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/cache-test.c Tue May 7 13:26:25 2013
@@ -155,8 +155,8 @@ test_memcache_basic(const svn_test_opts_
if (opts->config_file)
{
- SVN_ERR(svn_config_read2(&config, opts->config_file,
- TRUE, FALSE, pool));
+ SVN_ERR(svn_config_read3(&config, opts->config_file,
+ TRUE, FALSE, FALSE, pool));
SVN_ERR(svn_cache__make_memcache_from_config(&memcache, config, pool));
}
@@ -223,8 +223,8 @@ test_memcache_long_key(const svn_test_op
if (opts->config_file)
{
- SVN_ERR(svn_config_read2(&config, opts->config_file,
- TRUE, FALSE, pool));
+ SVN_ERR(svn_config_read3(&config, opts->config_file,
+ TRUE, FALSE, FALSE, pool));
SVN_ERR(svn_cache__make_memcache_from_config(&memcache, config, pool));
}
Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/config-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/config-test.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/config-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/config-test.c Tue May 7 13:26:25 2013
@@ -109,7 +109,7 @@ test_text_retrieval(apr_pool_t *pool)
SVN_ERR(init_params(pool));
cfg_file = apr_pstrcat(pool, srcdir, "/", "config-test.cfg", (char *)NULL);
- SVN_ERR(svn_config_read2(&cfg, cfg_file, TRUE, FALSE, pool));
+ SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, FALSE, FALSE, pool));
/* Test values retrieved from our ConfigParser instance against
values retrieved using svn_config. */
@@ -160,7 +160,7 @@ test_boolean_retrieval(apr_pool_t *pool)
SVN_ERR(init_params(pool));
cfg_file = apr_pstrcat(pool, srcdir, "/", "config-test.cfg", (char *)NULL);
- SVN_ERR(svn_config_read2(&cfg, cfg_file, TRUE, FALSE, pool));
+ SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, FALSE, FALSE, pool));
for (i = 0; true_keys[i] != NULL; i++)
{
@@ -220,7 +220,7 @@ test_has_section_case_insensitive(apr_po
SVN_ERR(init_params(pool));
cfg_file = apr_pstrcat(pool, srcdir, "/", "config-test.cfg", (char *)NULL);
- SVN_ERR(svn_config_read2(&cfg, cfg_file, TRUE, FALSE, pool));
+ SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, FALSE, FALSE, pool));
if (! svn_config_has_section(cfg, "section1"))
return fail(pool, "Failed to find section1");
@@ -250,7 +250,7 @@ test_has_section_case_sensitive(apr_pool
SVN_ERR(init_params(pool));
cfg_file = apr_pstrcat(pool, srcdir, "/", "config-test.cfg", (char *)NULL);
- SVN_ERR(svn_config_read2(&cfg, cfg_file, TRUE, TRUE, pool));
+ SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, TRUE, FALSE, pool));
if (! svn_config_has_section(cfg, "section1"))
return fail(pool, "Failed to find section1");
@@ -271,6 +271,48 @@ test_has_section_case_sensitive(apr_pool
}
static svn_error_t *
+test_has_option_case_sensitive(apr_pool_t *pool)
+{
+ svn_config_t *cfg;
+ const char *cfg_file;
+ apr_int64_t value;
+ int i;
+
+ static struct test_dataset {
+ const char *option;
+ apr_int64_t value;
+ } const test_data[] = {
+ { "a", 1 },
+ { "A", 2 },
+ { "B", 3 },
+ { "b", 4 }
+ };
+ static const int test_data_size = sizeof(test_data)/sizeof(*test_data);
+
+ if (!srcdir)
+ SVN_ERR(init_params(pool));
+
+ cfg_file = apr_pstrcat(pool, srcdir, "/", "config-test.cfg", (char *)NULL);
+ SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, TRUE, TRUE, pool));
+
+ for (i = 0; i < test_data_size; ++i)
+ {
+ SVN_ERR(svn_config_get_int64(cfg, &value, "case-sensitive-option",
+ test_data[i].option, -1));
+ if (test_data[i].value != value)
+ return fail(pool,
+ apr_psprintf(pool,
+ "case-sensitive-option.%s != %"
+ APR_INT64_T_FMT" but %"APR_INT64_T_FMT,
+ test_data[i].option,
+ test_data[i].value,
+ value));
+ }
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
test_stream_interface(apr_pool_t *pool)
{
svn_config_t *cfg;
@@ -283,7 +325,7 @@ test_stream_interface(apr_pool_t *pool)
cfg_file = apr_pstrcat(pool, srcdir, "/", "config-test.cfg", (char *)NULL);
SVN_ERR(svn_stream_open_readonly(&stream, cfg_file, pool, pool));
- SVN_ERR(svn_config_parse(&cfg, stream, TRUE, pool));
+ SVN_ERR(svn_config_parse(&cfg, stream, TRUE, TRUE, pool));
/* nominal test to make sure cfg is populated with something since
* svn_config_parse will happily return an empty cfg if the stream is
@@ -313,6 +355,8 @@ struct svn_test_descriptor_t test_funcs[
"test svn_config_has_section (case insensitive)"),
SVN_TEST_PASS2(test_has_section_case_sensitive,
"test svn_config_has_section (case sensitive)"),
+ SVN_TEST_PASS2(test_has_option_case_sensitive,
+ "test case-sensitive option name lookup"),
SVN_TEST_PASS2(test_stream_interface,
"test svn_config_parse"),
SVN_TEST_NULL
Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/config-test.cfg
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/config-test.cfg?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/config-test.cfg (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/config-test.cfg Tue May 7 13:26:25 2013
@@ -55,3 +55,9 @@ false2 = no
false3 = oFf
false4 = 0
bad_false = nyet!
+
+[case-sensitive-option]
+a = 1
+A = 2
+B = 3
+b = 4
Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_wc/conflict-data-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_wc/conflict-data-test.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_wc/conflict-data-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_wc/conflict-data-test.c Tue May 7 13:26:25 2013
@@ -28,6 +28,7 @@
#include <apr_hash.h>
#include <apr_tables.h>
+#include "svn_props.h"
#include "svn_pools.h"
#include "svn_hash.h"
#include "svn_types.h"
@@ -54,42 +55,128 @@ fail(apr_pool_t *pool, const char *fmt,
return svn_error_create(SVN_ERR_TEST_FAILED, 0, msg);
}
-/* Raise a test error if EXPECTED and ACTUAL differ. */
+/* Assert that two integers are equal. Return an error if not. */
+#define ASSERT_INT_EQ(a, b) \
+ do { \
+ if ((a) != (b)) \
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL, \
+ "failed: ASSERT_INT_EQ(" #a ", " #b ") " \
+ "-> (%d == %d)", a, b); \
+ } while (0)
+
+/* Assert that two strings are equal or both null. Return an error if not. */
+#define ASSERT_STR_EQ(a, b) \
+ SVN_TEST_STRING_ASSERT(a, b)
+
+/* Assert that two version_t's are equal or both null. Return an error if not. */
+static svn_error_t *
+compare_version(const svn_wc_conflict_version_t *actual,
+ const svn_wc_conflict_version_t *expected)
+{
+ if (actual == NULL && expected == NULL)
+ return SVN_NO_ERROR;
+
+ SVN_TEST_ASSERT(actual && expected);
+ ASSERT_STR_EQ(actual->repos_url, expected->repos_url);
+ ASSERT_INT_EQ((int)actual->peg_rev, (int)expected->peg_rev);
+ ASSERT_STR_EQ(actual->path_in_repos, expected->path_in_repos);
+ ASSERT_INT_EQ(actual->node_kind, expected->node_kind);
+ return SVN_NO_ERROR;
+}
+
+/* Assert that two conflict descriptions contain exactly the same data
+ * (including names of temporary files), or are both NULL. Return an
+ * error if not. */
+static svn_error_t *
+compare_conflict(const svn_wc_conflict_description2_t *actual,
+ const svn_wc_conflict_description2_t *expected)
+{
+ if (actual == NULL && expected == NULL)
+ return SVN_NO_ERROR;
+
+ SVN_TEST_ASSERT(actual && expected);
+
+ ASSERT_INT_EQ(actual->kind, expected->kind);
+ ASSERT_STR_EQ(actual->local_abspath, expected->local_abspath);
+ ASSERT_INT_EQ(actual->node_kind, expected->node_kind);
+ ASSERT_STR_EQ(actual->property_name, expected->property_name);
+ ASSERT_INT_EQ(actual->is_binary, expected->is_binary);
+ ASSERT_STR_EQ(actual->mime_type, expected->mime_type);
+ ASSERT_INT_EQ(actual->action, expected->action);
+ ASSERT_INT_EQ(actual->reason, expected->reason);
+ ASSERT_STR_EQ(actual->base_abspath, expected->base_abspath);
+ ASSERT_STR_EQ(actual->their_abspath, expected->their_abspath);
+ ASSERT_STR_EQ(actual->my_abspath, expected->my_abspath);
+ ASSERT_STR_EQ(actual->merged_file, expected->merged_file);
+ ASSERT_INT_EQ(actual->operation, expected->operation);
+ SVN_ERR(compare_version(actual->src_left_version,
+ expected->src_left_version));
+ SVN_ERR(compare_version(actual->src_right_version,
+ expected->src_right_version));
+ return SVN_NO_ERROR;
+}
+
+/* Assert that a file contains the expected data. Return an
+ * error if not. */
static svn_error_t *
-compare_version(const svn_wc_conflict_version_t *expected,
- const svn_wc_conflict_version_t *actual)
+compare_file_content(const char *file_abspath,
+ const char *expected_val,
+ apr_pool_t *scratch_pool)
{
- SVN_TEST_STRING_ASSERT(expected->repos_url, actual->repos_url);
- SVN_TEST_ASSERT(expected->peg_rev == actual->peg_rev);
- SVN_TEST_STRING_ASSERT(expected->path_in_repos, actual->path_in_repos);
- SVN_TEST_ASSERT(expected->node_kind == actual->node_kind);
+ svn_stringbuf_t *actual_val;
+
+ SVN_ERR(svn_stringbuf_from_file2(&actual_val, file_abspath, scratch_pool));
+ ASSERT_STR_EQ(actual_val->data, expected_val);
return SVN_NO_ERROR;
}
-/* Raise a test error if EXPECTED and ACTUAL differ or if ACTUAL is NULL. */
-static svn_error_t *
-compare_conflict(const svn_wc_conflict_description2_t *expected,
- const svn_wc_conflict_description2_t *actual)
-{
- SVN_TEST_ASSERT(actual != NULL);
-
- SVN_TEST_STRING_ASSERT(expected->local_abspath, actual->local_abspath);
- SVN_TEST_ASSERT(expected->node_kind == actual->node_kind);
- SVN_TEST_ASSERT(expected->kind == actual->kind);
- SVN_TEST_STRING_ASSERT(expected->property_name, actual->property_name);
- SVN_TEST_ASSERT(expected->is_binary == actual->is_binary);
- SVN_TEST_STRING_ASSERT(expected->mime_type, actual->mime_type);
- SVN_TEST_ASSERT(expected->action == actual->action);
- SVN_TEST_ASSERT(expected->reason == actual->reason);
- SVN_TEST_STRING_ASSERT(expected->base_abspath, actual->base_abspath);
- SVN_TEST_STRING_ASSERT(expected->their_abspath, actual->their_abspath);
- SVN_TEST_STRING_ASSERT(expected->my_abspath, actual->my_abspath);
- SVN_TEST_STRING_ASSERT(expected->merged_file, actual->merged_file);
- SVN_TEST_ASSERT(expected->operation == actual->operation);
- SVN_ERR(compare_version(expected->src_left_version,
- actual->src_left_version));
- SVN_ERR(compare_version(expected->src_right_version,
- actual->src_right_version));
+/* Assert that ACTUAL and EXPECTED both represent the same property
+ * conflict, or are both NULL. Return an error if not.
+ *
+ * Compare the property values found in files named by
+ * ACTUAL->base_abspath, ACTUAL->my_abspath, ACTUAL->merged_abspath
+ * with EXPECTED_BASE_VAL, EXPECTED_MY_VAL, EXPECTED_THEIR_VAL
+ * respectively, ignoring the corresponding fields in EXPECTED. */
+static svn_error_t *
+compare_prop_conflict(const svn_wc_conflict_description2_t *actual,
+ const svn_wc_conflict_description2_t *expected,
+ const char *expected_base_val,
+ const char *expected_my_val,
+ const char *expected_their_val,
+ apr_pool_t *scratch_pool)
+{
+ if (actual == NULL && expected == NULL)
+ return SVN_NO_ERROR;
+
+ SVN_TEST_ASSERT(actual && expected);
+ ASSERT_INT_EQ(actual->kind, svn_wc_conflict_kind_property);
+ ASSERT_INT_EQ(expected->kind, svn_wc_conflict_kind_property);
+
+ ASSERT_STR_EQ(actual->local_abspath, expected->local_abspath);
+ ASSERT_INT_EQ(actual->node_kind, expected->node_kind);
+ ASSERT_STR_EQ(actual->property_name, expected->property_name);
+ ASSERT_INT_EQ(actual->action, expected->action);
+ ASSERT_INT_EQ(actual->reason, expected->reason);
+ ASSERT_INT_EQ(actual->operation, expected->operation);
+ SVN_ERR(compare_version(actual->src_left_version,
+ expected->src_left_version));
+ SVN_ERR(compare_version(actual->src_right_version,
+ expected->src_right_version));
+
+ SVN_ERR(compare_file_content(actual->base_abspath, expected_base_val,
+ scratch_pool));
+ SVN_ERR(compare_file_content(actual->my_abspath, expected_my_val,
+ scratch_pool));
+ /* Historical wart: for a prop conflict, 'theirs' is in the 'merged_file'
+ * field, and the conflict artifact file is in the 'theirs_abspath' field. */
+ SVN_ERR(compare_file_content(actual->merged_file, expected_their_val,
+ scratch_pool));
+ /*ASSERT_STR_EQ(actual->theirs_abspath, conflict_artifact_file));*/
+
+ /* These are 'undefined' for a prop conflict */
+ /*ASSERT_INT_EQ(actual->is_binary, expected->is_binary);*/
+ /*ASSERT_STR_EQ(actual->mime_type, expected->mime_type);*/
+
return SVN_NO_ERROR;
}
@@ -254,11 +341,11 @@ test_read_write_tree_conflicts(const svn
SVN_ERR(svn_wc__get_tree_conflict(&read_conflict, sbox.wc_ctx,
child1_abspath, pool, pool));
- SVN_ERR(compare_conflict(conflict1, read_conflict));
+ SVN_ERR(compare_conflict(read_conflict, conflict1));
SVN_ERR(svn_wc__get_tree_conflict(&read_conflict, sbox.wc_ctx,
child2_abspath, pool, pool));
- SVN_ERR(compare_conflict(conflict2, read_conflict));
+ SVN_ERR(compare_conflict(read_conflict, conflict2));
}
/* Read many */
@@ -540,6 +627,186 @@ test_serialize_tree_conflict(const svn_t
return SVN_NO_ERROR;
}
+/* A conflict resolver callback baton for test_prop_conflicts(). */
+typedef struct test_prop_conflict_baton_t
+{
+ /* Sets of properties. */
+ apr_hash_t *mine;
+ apr_hash_t *their_old;
+ apr_hash_t *theirs;
+ /* The set of prop names in conflict. */
+ apr_hash_t *conflicts;
+
+ /* We use all the fields of DESC except the base/theirs/mine/merged paths. */
+ svn_wc_conflict_description2_t *desc;
+
+ int conflicts_seen;
+} test_prop_conflict_baton_t;
+
+/* Set *CONFLICT_SKEL_P to a new property conflict skel reflecting the
+ * conflict details given in B. */
+static svn_error_t *
+create_prop_conflict_skel(svn_skel_t **conflict_skel_p,
+ svn_wc_context_t *wc_ctx,
+ const test_prop_conflict_baton_t *b,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_skel_t *conflict_skel = svn_wc__conflict_skel_create(result_pool);
+ const char *marker_abspath;
+ svn_boolean_t complete;
+
+ SVN_ERR(svn_io_write_unique(&marker_abspath,
+ b->desc->local_abspath,
+ "conflict-artifact-file-content\n", 6,
+ svn_io_file_del_none, scratch_pool));
+
+ SVN_ERR(svn_wc__conflict_skel_add_prop_conflict(conflict_skel,
+ wc_ctx->db,
+ b->desc->local_abspath,
+ marker_abspath,
+ b->mine, b->their_old,
+ b->theirs, b->conflicts,
+ result_pool, scratch_pool));
+
+ switch (b->desc->operation)
+ {
+ case svn_wc_operation_update:
+ SVN_ERR(svn_wc__conflict_skel_set_op_update(
+ conflict_skel,
+ b->desc->src_left_version, b->desc->src_right_version,
+ result_pool, scratch_pool));
+ break;
+ case svn_wc_operation_switch:
+ SVN_ERR(svn_wc__conflict_skel_set_op_switch(
+ conflict_skel,
+ b->desc->src_left_version, b->desc->src_right_version,
+ result_pool, scratch_pool));
+ break;
+ case svn_wc_operation_merge:
+ SVN_ERR(svn_wc__conflict_skel_set_op_merge(
+ conflict_skel,
+ b->desc->src_left_version, b->desc->src_right_version,
+ result_pool, scratch_pool));
+ break;
+ default:
+ SVN_ERR_MALFUNCTION();
+ }
+
+ SVN_ERR(svn_wc__conflict_skel_is_complete(&complete, conflict_skel));
+ SVN_TEST_ASSERT(complete);
+ *conflict_skel_p = conflict_skel;
+ return SVN_NO_ERROR;
+}
+
+/* A conflict resolver callback for test_prop_conflicts(), that checks
+ * that the conflict described to it matches the one described in BATON,
+ * and also counts the number of times it is called. */
+static svn_error_t *
+prop_conflict_cb(svn_wc_conflict_result_t **result_p,
+ const svn_wc_conflict_description2_t *desc,
+ void *baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ test_prop_conflict_baton_t *b = baton;
+
+ SVN_ERR(compare_prop_conflict(
+ desc, b->desc,
+ svn_prop_get_value(b->their_old, desc->property_name),
+ svn_prop_get_value(b->mine, desc->property_name),
+ svn_prop_get_value(b->theirs, desc->property_name),
+ scratch_pool));
+ b->conflicts_seen++;
+
+ *result_p = svn_wc_create_conflict_result(svn_wc_conflict_choose_postpone,
+ NULL /*merged_file*/, result_pool);
+ return SVN_NO_ERROR;
+}
+
+/* Test for correct retrieval of property conflict descriptions from
+ * the WC DB.
+ *
+ * Presently it tests just one prop conflict, and only during the
+ * 'resolve' operation. We should also test during the 'update'/
+ * 'switch'/'merge' operations.
+ */
+static svn_error_t *
+test_prop_conflicts(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_test__sandbox_t sbox;
+ svn_skel_t *conflict_skel;
+ svn_error_t *err;
+ const char *lock_abspath;
+ test_prop_conflict_baton_t *b = apr_pcalloc(pool, sizeof(*b));
+ svn_wc_conflict_description2_t *desc = apr_pcalloc(pool, sizeof(*b));
+
+ SVN_ERR(svn_test__sandbox_create(&sbox, "test_prop_conflicts", opts, pool));
+
+ /* Describe a property conflict */
+ b->mine = apr_hash_make(pool);
+ b->their_old = apr_hash_make(pool);
+ b->theirs = apr_hash_make(pool);
+ b->conflicts = apr_hash_make(pool);
+ svn_hash_sets(b->mine, "prop", svn_string_create("Mine", pool));
+ svn_hash_sets(b->their_old, "prop", svn_string_create("Their-Old", pool));
+ svn_hash_sets(b->theirs, "prop", svn_string_create("Theirs", pool));
+ svn_hash_sets(b->conflicts, "prop", "");
+
+ b->desc = desc;
+ desc->local_abspath = sbox.wc_abspath;
+ desc->kind = svn_wc_conflict_kind_property;
+ desc->node_kind = svn_node_dir;
+ desc->operation = svn_wc_operation_update;
+ desc->action = svn_wc_conflict_action_edit;
+ desc->reason = svn_wc_conflict_reason_edited;
+ desc->mime_type = NULL;
+ desc->is_binary = FALSE;
+ desc->property_name = "prop";
+ desc->src_left_version
+ = svn_wc_conflict_version_create2(sbox.repos_url, "uuid",
+ "trunk", 12, svn_node_dir, pool);
+ desc->src_right_version = NULL; /* WC only */
+
+ b->conflicts_seen = 0;
+
+ /* Record a conflict */
+ {
+ apr_pool_t *subpool = svn_pool_create(pool);
+ SVN_ERR(create_prop_conflict_skel(&conflict_skel, sbox.wc_ctx, b,
+ pool, subpool));
+ svn_pool_clear(subpool);
+ SVN_ERR(svn_wc__db_op_mark_conflict(sbox.wc_ctx->db,
+ sbox.wc_abspath,
+ conflict_skel, NULL, subpool));
+ svn_pool_destroy(subpool);
+ }
+
+ /* Test the API for resolving the conflict: check that correct details
+ * of the conflict are returned. */
+ SVN_ERR(svn_wc__acquire_write_lock_for_resolve(&lock_abspath, sbox.wc_ctx,
+ sbox.wc_abspath, pool, pool));
+ err = svn_wc__resolve_conflicts(sbox.wc_ctx, sbox.wc_abspath,
+ svn_depth_empty,
+ FALSE /* resolve_text */,
+ "" /* resolve_prop (ALL props) */,
+ FALSE /* resolve_tree */,
+ svn_wc_conflict_choose_unspecified,
+ prop_conflict_cb, b,
+ NULL, NULL, /* cancellation */
+ NULL, NULL, /* notification */
+ pool);
+
+ SVN_ERR(svn_error_compose_create(err,
+ svn_wc__release_write_lock(sbox.wc_ctx,
+ lock_abspath,
+ pool)));
+
+ ASSERT_INT_EQ(b->conflicts_seen, 1);
+ return SVN_NO_ERROR;
+}
+
/* The test table. */
struct svn_test_descriptor_t test_funcs[] =
@@ -557,6 +824,8 @@ struct svn_test_descriptor_t test_funcs[
"read and write a text conflict"),
SVN_TEST_OPTS_PASS(test_serialize_tree_conflict,
"read and write a tree conflict"),
+ SVN_TEST_OPTS_PASS(test_prop_conflicts,
+ "test prop conflicts"),
SVN_TEST_NULL
};
Modified: subversion/branches/wc-collate-path/tools/dev/aprerr.txt
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/tools/dev/aprerr.txt?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/tools/dev/aprerr.txt (original)
+++ subversion/branches/wc-collate-path/tools/dev/aprerr.txt Tue May 7 13:26:25 2013
@@ -1,3 +1,4 @@
+# This file is used by which-error.py and gen_base.py:write_errno_table()
APR_SUCCESS = 0
SOCBASEERR = 10000
SOCEPERM = 10001
Modified: subversion/branches/wc-collate-path/tools/dev/build-svn-deps-win.pl
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/tools/dev/build-svn-deps-win.pl?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/tools/dev/build-svn-deps-win.pl (original)
+++ subversion/branches/wc-collate-path/tools/dev/build-svn-deps-win.pl Tue May 7 13:26:25 2013
@@ -82,7 +82,7 @@ our $HTTPD_VER = '2.4.4';
our $APR_VER = '1.4.6';
our $APU_VER = '1.5.2'; # apr-util version
our $API_VER = '1.2.1'; # arp-iconv version
-our $ZLIB_VER = '1.2.7';
+our $ZLIB_VER = '1.2.8';
our $OPENSSL_VER = '1.0.1e';
our $PCRE_VER = '8.32';
our $BDB_VER = '5.3.21';
Modified: subversion/branches/wc-collate-path/tools/dev/remove-trailing-whitespace.sh
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/tools/dev/remove-trailing-whitespace.sh?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/tools/dev/remove-trailing-whitespace.sh (original)
+++ subversion/branches/wc-collate-path/tools/dev/remove-trailing-whitespace.sh Tue May 7 13:26:25 2013
@@ -20,5 +20,5 @@
for ext in c h cpp java py pl rb hpp cmd bat; do
find . -name "*.$ext" -exec \
perl -pi -e 's/[ \t]*$//' {} + ;
- # don't use \t to not strip ^L pagebreaks
+ # don't use \s to not strip ^L pagebreaks
done
Modified: subversion/branches/wc-collate-path/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/tools/dev/unix-build/Makefile.svn?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/wc-collate-path/tools/dev/unix-build/Makefile.svn Tue May 7 13:26:25 2013
@@ -1246,7 +1246,7 @@ $(SVN_OBJDIR)/.installed: $(SVN_OBJDIR)/
# by the same version of SWIG.
$(SVN_OBJDIR)/.pre-generated-swig-cleaned:
-cd $(svn_builddir) \
- && make extraclean-swig
+ && make clean-swig
touch $@
$(SVN_OBJDIR)/.bindings-compiled: $(SVN_OBJDIR)/.installed $(SVN_OBJDIR)/.pre-generated-swig-cleaned
Modified: subversion/branches/wc-collate-path/tools/dev/which-error.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/tools/dev/which-error.py?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/tools/dev/which-error.py (original)
+++ subversion/branches/wc-collate-path/tools/dev/which-error.py Tue May 7 13:26:25 2013
@@ -73,6 +73,9 @@ def get_errors():
errs.update(errno.errorcode)
## APR-defined errors, from apr_errno.h.
for line in open(os.path.join(os.path.dirname(sys.argv[0]), 'aprerr.txt')):
+ # aprerr.txt parsing duplicated in gen_base.py:write_errno_table()
+ if line.startswith('#'):
+ continue
key, _, val = line.split()
errs[int(val)] = key
## Subversion errors, from svn_error_codes.h.
Modified: subversion/branches/wc-collate-path/tools/dist/backport.pl
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/tools/dist/backport.pl?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/tools/dist/backport.pl (original)
+++ subversion/branches/wc-collate-path/tools/dist/backport.pl Tue May 7 13:26:25 2013
@@ -30,10 +30,10 @@ my $STATUS = './STATUS';
my $BRANCHES = '^/subversion/branches';
my $YES = $ENV{YES}; # batch mode: eliminate prompts, add sleeps
-my $WET_RUN = qw[false true][1]; # don't commit
+my $MAY_COMMIT = qw[false true][0];
my $DEBUG = qw[false true][0]; # 'set -x', etc
-$WET_RUN = 'true' if exists $ENV{WET_RUN};
$DEBUG = 'true' if exists $ENV{DEBUG};
+$MAY_COMMIT = 'true' if ($ENV{MAY_COMMIT} // "false") =~ /^(1|yes|true)$/i;
# derived values
my $SVNq;
@@ -65,7 +65,7 @@ EOF
sub prompt {
local $\; # disable 'perl -l' effects
- print "Go ahead? ";
+ print "$_[0] ";
# TODO: this part was written by trial-and-error
ReadMode 'cbreak';
@@ -117,22 +117,37 @@ if $DEBUG; then
set -x
fi
$SVN diff > $backupfile
+cp STATUS STATUS.$$
$SVNq revert -R .
+mv STATUS.$$ STATUS
$SVNq up
$SVNq merge $mergeargs
-$VIM -e -s -n -N -i NONE -u NONE -c '/$pattern/normal! dap' -c wq $STATUS
-if $WET_RUN; then
+if [ "`$SVN status -q | wc -l`" -eq 1 ]; then
+ if [ -n "`$SVN diff | perl -lne 'print if s/^(Added|Deleted|Modified): //' | grep -vx svn:mergeinfo`" ]; then
+ # This check detects STATUS entries that name non-^/subversion/ revnums.
+ # ### Q: What if we actually commit a mergeinfo fix to trunk and then want
+ # ### to backport it?
+ # ### A: We don't merge it using the script.
+ echo "Bogus merge: includes only svn:mergeinfo changes!" >&2
+ exit 2
+ fi
+fi
+if $MAY_COMMIT; then
+ $VIM -e -s -n -N -i NONE -u NONE -c '/$pattern/normal! dap' -c wq $STATUS
$SVNq commit -F $logmsg_filename
else
- echo "Committing:"
+ echo "Would have committed:"
+ echo '[[['
$SVN status -q
+ echo 'M STATUS (not shown in the diff)'
cat $logmsg_filename
+ echo ']]]'
fi
EOF
$script .= <<"EOF" if $entry{branch};
reinteg_rev=\`$SVN info $STATUS | sed -ne 's/Last Changed Rev: //p'\`
-if $WET_RUN; then
+if $MAY_COMMIT; then
# Sleep to avoid out-of-order commit notifications
if [ -n "\$YES" ]; then sleep 15; fi
$SVNq rm $BRANCHES/$entry{branch} -m "Remove the '$entry{branch}' branch, $reintegrated_word in r\$reinteg_rev."
@@ -169,7 +184,8 @@ sub parse_entry {
s/^ // for @_;
# revisions
- $branch = sanitize_branch $1 if $_[0] =~ /^(\S*) branch$/;
+ $branch = sanitize_branch $1
+ if $_[0] =~ /^(\S*) branch$/ or $_[0] =~ m#branches/(\S+)#;
while ($_[0] =~ /^r/) {
while ($_[0] =~ s/^r(\d+)(?:$|[,; ]+)//) {
push @revisions, $1;
@@ -207,11 +223,12 @@ sub parse_entry {
}
sub handle_entry {
+ my $in_approved = shift;
my %entry = parse_entry @_;
my @vetoes = grep { /^ -1:/ } @{$entry{votes}};
if ($YES) {
- merge %entry unless @vetoes;
+ merge %entry if $in_approved and not @vetoes;
} else {
print "";
print "\n>>> The $entry{header}:";
@@ -224,7 +241,14 @@ sub handle_entry {
print "";
print "Vetoes found!" if @vetoes;
- merge %entry if prompt;
+ if (prompt 'Go ahead?') {
+ merge %entry;
+ system($ENV{SHELL} // "/bin/sh") == 0
+ or warn "Creating an interactive subshell failed ($?): $!"
+ if prompt "Shall I open a subshell?";
+ # Don't revert. The next merge() call will do that anyway, or maybe the
+ # user did in his interactive shell.
+ }
}
# TODO: merge() changes ./STATUS, which we're reading below, but
@@ -244,17 +268,17 @@ sub main {
# ### TODO: need to run 'revert' here
# ### TODO: both here and in merge(), unlink files that previous merges added
- die "Local mods to STATUS file $STATUS" if `$SVN status -q $STATUS`;
+ # When running from cron, there shouldn't be local mods. (For interactive
+ # usage, we preserve local mods to STATUS.)
+ die "Local mods to STATUS file $STATUS" if $YES and `$SVN status -q $STATUS`;
# Skip most of the file
while (<STATUS>) {
- last if /^Approved changes/;
- }
- while (<STATUS>) {
- last unless /^=+$/;
+ last if /^Status of \d+\.\d+/;
}
$/ = ""; # paragraph mode
+ my $in_approved = 0;
while (<STATUS>) {
my @lines = split /\n/;
@@ -262,6 +286,11 @@ sub main {
# Section header
when (/^[A-Z].*:$/i) {
print "\n\n=== $lines[0]" unless $YES;
+ $in_approved = $lines[0] =~ /^Approved changes/;
+ }
+ # Comment
+ when (/^[#\x5b]/i) {
+ next;
}
# Separator after section header
when (/^=+$/i) {
@@ -271,10 +300,10 @@ sub main {
when (/^ \*/) {
warn "Too many bullets in $lines[0]" and next
if grep /^ \*/, @lines[1..$#lines];
- handle_entry @lines;
+ handle_entry $in_approved, @lines;
}
default {
- warn "Unknown entry '$lines[0]' at $ARGV:$.\n";
+ warn "Unknown entry '$lines[0]' at line $.\n";
}
}
}
Modified: subversion/branches/wc-collate-path/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/tools/dist/release.py?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/tools/dist/release.py (original)
+++ subversion/branches/wc-collate-path/tools/dist/release.py Tue May 7 13:26:25 2013
@@ -69,9 +69,14 @@ except ImportError:
# Our required / recommended release tool versions by release branch
tool_versions = {
'trunk' : {
- 'autoconf' : '2.68',
- 'libtool' : '2.4',
- 'swig' : '2.0.4',
+ 'autoconf' : '2.69',
+ 'libtool' : '2.4.2',
+ 'swig' : '2.0.9',
+ },
+ '1.8' : {
+ 'autoconf' : '2.69',
+ 'libtool' : '2.4.2',
+ 'swig' : '2.0.9',
},
'1.7' : {
'autoconf' : '2.68',
@@ -522,7 +527,8 @@ def create_tag(args):
svnmucc_cmd += ['--username', args.username]
svnmucc_cmd += ['cp', str(args.revnum), branch, tag]
svnmucc_cmd += ['put', os.path.join(get_deploydir(args.base_dir),
- 'svn_version.h.dist'),
+ 'svn_version.h.dist' + '-' +
+ str(args.version)),
tag + '/subversion/include/svn_version.h']
# don't redirect stdout/stderr since svnmucc might ask for a password
Modified: subversion/branches/wc-collate-path/tools/server-side/mod_dontdothat/mod_dontdothat.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/tools/server-side/mod_dontdothat/mod_dontdothat.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/tools/server-side/mod_dontdothat/mod_dontdothat.c (original)
+++ subversion/branches/wc-collate-path/tools/server-side/mod_dontdothat/mod_dontdothat.c Tue May 7 13:26:25 2013
@@ -584,7 +584,8 @@ dontdothat_insert_filters(request_rec *r
/* XXX is there a way to error out from this point? Would be nice... */
- err = svn_config_read2(&config, cfg->config_file, TRUE, FALSE, r->pool);
+ err = svn_config_read3(&config, cfg->config_file, TRUE,
+ FALSE, TRUE, r->pool);
if (err)
{
char buff[256];