Author: brane
Date: Sun Sep 10 19:05:00 2017
New Revision: 1807959
URL: http://svn.apache.org/viewvc?rev=1807959&view=rev
Log:
On the better-pristines branch: Sync with trunk up to r1807956.
Removed:
subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests_data/format_12a.tar.bz2
subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests_data/format_12b.tar.bz2
subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests_data/format_13.tar.bz2
subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests_data/format_14.tar.bz2
subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests_data/format_15.tar.bz2
subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests_data/format_16.tar.bz2
subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests_data/format_28.tar.bz2
subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests_data/upgrade_tc.tar.bz2
Modified:
subversion/branches/better-pristines/ (props changed)
subversion/branches/better-pristines/subversion/include/private/svn_repos_private.h
subversion/branches/better-pristines/subversion/include/svn_error_codes.h
subversion/branches/better-pristines/subversion/include/svn_repos.h
subversion/branches/better-pristines/subversion/libsvn_client/conflicts.c
subversion/branches/better-pristines/subversion/libsvn_repos/deprecated.c
subversion/branches/better-pristines/subversion/libsvn_repos/fs-wrap.c
subversion/branches/better-pristines/subversion/libsvn_repos/load-fs-vtable.c
subversion/branches/better-pristines/subversion/libsvn_subr/utf8proc.c
subversion/branches/better-pristines/subversion/libsvn_wc/upgrade.c
subversion/branches/better-pristines/subversion/libsvn_wc/wc-metadata.sql
subversion/branches/better-pristines/subversion/libsvn_wc/wc_db.c
subversion/branches/better-pristines/subversion/svnadmin/svnadmin.c
subversion/branches/better-pristines/subversion/svnrdump/load_editor.c
subversion/branches/better-pristines/subversion/svnrdump/svnrdump.h
subversion/branches/better-pristines/subversion/svnrdump/util.c
subversion/branches/better-pristines/subversion/tests/cmdline/svnadmin_tests.py
subversion/branches/better-pristines/subversion/tests/cmdline/svntest/actions.py
subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests.py
subversion/branches/better-pristines/subversion/tests/libsvn_repos/dump-load-test.c
subversion/branches/better-pristines/subversion/tests/libsvn_wc/utils.c
subversion/branches/better-pristines/subversion/tests/libsvn_wc/wc-queries-test.c
subversion/branches/better-pristines/tools/client-side/bash_completion
Propchange: subversion/branches/better-pristines/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Sep 10 19:05:00 2017
@@ -97,3 +97,4 @@
/subversion/branches/verify-at-commit:1462039-1462408
/subversion/branches/verify-keep-going:1439280-1546110
/subversion/branches/wc-collate-path:1402685-1480384
+/subversion/trunk:1807118-1807956
Modified:
subversion/branches/better-pristines/subversion/include/private/svn_repos_private.h
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/include/private/svn_repos_private.h?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
---
subversion/branches/better-pristines/subversion/include/private/svn_repos_private.h
(original)
+++
subversion/branches/better-pristines/subversion/include/private/svn_repos_private.h
Sun Sep 10 19:05:00 2017
@@ -75,6 +75,30 @@ svn_repos__validate_prop(const char *nam
const svn_string_t *value,
apr_pool_t *pool);
+/* Attempt to normalize a Subversion property if it "needs translation"
+ * (according to svn_prop_needs_translation(), currently all svn:* props).
+ *
+ * At this time, the only performed normalization is translation of
+ * the line endings of the property value so that it would only contain
+ * LF (\n) characters. "\r" characters found mid-line are replaced with "\n".
+ * "\r\n" sequences are replaced with "\n".
+ *
+ * NAME is used to check that VALUE should be normalized, and if this
+ * is the case, VALUE is then normalized, allocated from RESULT_POOL.
+ * If no normalization is required, VALUE will be copied to RESULT_POOL
+ * unchanged. If NORMALIZED_P is not NULL, and the normalization
+ * happened, set *NORMALIZED_P to non-zero. If the property is returned
+ * unchanged and NORMALIZED_P is not NULL, then *NORMALIZED_P will be
+ * set to zero. SCRATCH_POOL will be used for temporary allocations.
+ */
+svn_error_t *
+svn_repos__normalize_prop(const svn_string_t **result_p,
+ svn_boolean_t *normalized_p,
+ const char *name,
+ const svn_string_t *value,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
/**
* Given the error @a err from svn_repos_fs_commit_txn(), return an
* string containing either or both of the svn_fs_commit_txn() error
Modified:
subversion/branches/better-pristines/subversion/include/svn_error_codes.h
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/include/svn_error_codes.h?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/include/svn_error_codes.h
(original)
+++ subversion/branches/better-pristines/subversion/include/svn_error_codes.h
Sun Sep 10 19:05:00 2017
@@ -240,6 +240,11 @@ SVN_ERROR_START
SVN_ERR_BAD_CATEGORY_START + 16,
"Invalid compression method")
+ /** @since New in 1.10. */
+ SVN_ERRDEF(SVN_ERR_BAD_PROPERTY_VALUE_EOL,
+ SVN_ERR_BAD_CATEGORY_START + 17,
+ "Unexpected line ending in the property value")
+
/* xml errors */
SVN_ERRDEF(SVN_ERR_XML_ATTRIB_NOT_FOUND,
Modified: subversion/branches/better-pristines/subversion/include/svn_repos.h
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/include/svn_repos.h?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/include/svn_repos.h
(original)
+++ subversion/branches/better-pristines/subversion/include/svn_repos.h Sun Sep
10 19:05:00 2017
@@ -3436,6 +3436,15 @@ svn_repos_dump_fs(svn_repos_t *repos,
* to be stamped as if they were newly created via the normal commit
* process.
*
+ * If @a normalize_props is set, attempt to normalize invalid Subversion
+ * revision and node properties (those in the svn: namespace) so that
+ * their values would follow the established rules for them. For example,
+ * for such properties, typically the value must be in UTF-8 with LF
+ * line endings.
+ *
+ * @note The details or the performed normalizations are deliberately
+ * left unspecified and may change in the future.
+ *
* If non-NULL, use @a notify_func and @a notify_baton to send notification
* of events to the caller.
*
@@ -3443,8 +3452,34 @@ svn_repos_dump_fs(svn_repos_t *repos,
* @a cancel_baton as argument to see if the client wishes to cancel
* the load.
*
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_repos_load_fs6(svn_repos_t *repos,
+ svn_stream_t *dumpstream,
+ svn_revnum_t start_rev,
+ svn_revnum_t end_rev,
+ enum svn_repos_load_uuid uuid_action,
+ const char *parent_dir,
+ svn_boolean_t use_pre_commit_hook,
+ svn_boolean_t use_post_commit_hook,
+ svn_boolean_t validate_props,
+ svn_boolean_t ignore_dates,
+ svn_boolean_t normalize_props,
+ svn_repos_notify_func_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool);
+
+/**
+ * Similar to svn_repos_load_fs6(), but with the @a normalize_props
+ * parameter always set to @c FALSE.
+ *
* @since New in 1.9.
+ * @deprecated Provided for backward compatibility with the 1.9 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_repos_load_fs5(svn_repos_t *repos,
svn_stream_t *dumpstream,
@@ -3567,6 +3602,15 @@ svn_repos_load_fs(svn_repos_t *repos,
* @a dumpstream, keeping whatever timestamps the revisions currently
* have.
*
+ * If @a normalize_props is set, attempt to normalize invalid Subversion
+ * revision and node properties (those in the svn: namespace) so that
+ * their values would follow the established rules for them. For example,
+ * for such properties, typically the value must be in UTF-8 with LF
+ * line endings.
+ *
+ * @note The details or the performed normalizations are deliberately
+ * left unspecified and may change in the future.
+ *
* If non-NULL, use @a notify_func and @a notify_baton to send notification
* of events to the caller.
*
@@ -3585,6 +3629,7 @@ svn_repos_load_fs_revprops(svn_repos_t *
svn_revnum_t end_rev,
svn_boolean_t validate_props,
svn_boolean_t ignore_dates,
+ svn_boolean_t normalize_props,
svn_repos_notify_func_t notify_func,
void *notify_baton,
svn_cancel_func_t cancel_func,
@@ -3788,12 +3833,47 @@ svn_repos_parse_dumpstream3(svn_stream_t
* to be stamped as if they were newly created via the normal commit
* process.
*
+ * If @a normalize_props is set, attempt to normalize invalid Subversion
+ * revision and node properties (those in the svn: namespace) so that
+ * their values would follow the established rules for them. For example,
+ * for such properties, typically the value must be in UTF-8 with LF
+ * line endings.
+ *
+ * @note The details or the performed normalizations are deliberately
+ * left unspecified and may change in the future.
+ *
* If @a parent_dir is not NULL, then the parser will reparent all the
* loaded nodes, from root to @a parent_dir. The directory @a parent_dir
* must be an existing directory in the repository.
*
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_repos_get_fs_build_parser6(const svn_repos_parse_fns3_t **parser,
+ void **parse_baton,
+ svn_repos_t *repos,
+ svn_revnum_t start_rev,
+ svn_revnum_t end_rev,
+ svn_boolean_t use_history,
+ svn_boolean_t validate_props,
+ enum svn_repos_load_uuid uuid_action,
+ const char *parent_dir,
+ svn_boolean_t use_pre_commit_hook,
+ svn_boolean_t use_post_commit_hook,
+ svn_boolean_t ignore_dates,
+ svn_boolean_t normalize_props,
+ svn_repos_notify_func_t notify_func,
+ void *notify_baton,
+ apr_pool_t *pool);
+
+/**
+ * Similar to svn_repos_get_fs_build_parser6(), but with the
+ * @a normalize_props parameter always set to @c FALSE.
+ *
* @since New in 1.9.
+ * @deprecated Provided for backward compatibility with the 1.9 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_repos_get_fs_build_parser5(const svn_repos_parse_fns3_t **parser,
void **parse_baton,
Modified:
subversion/branches/better-pristines/subversion/libsvn_client/conflicts.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/libsvn_client/conflicts.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/libsvn_client/conflicts.c
(original)
+++ subversion/branches/better-pristines/subversion/libsvn_client/conflicts.c
Sun Sep 10 19:05:00 2017
@@ -9713,6 +9713,22 @@ svn_client_conflict_tree_get_resolution_
return SVN_NO_ERROR;
}
+/* Swallow authz failures and return SVN_NO_ERROR in that case.
+ * Otherwise, return ERR unchanged. */
+static svn_error_t *
+ignore_authz_failures(svn_error_t *err)
+{
+ if (err && ( svn_error_find_cause(err, SVN_ERR_AUTHZ_UNREADABLE)
+ || svn_error_find_cause(err, SVN_ERR_RA_NOT_AUTHORIZED)
+ || svn_error_find_cause(err, SVN_ERR_RA_DAV_FORBIDDEN)))
+ {
+ svn_error_clear(err);
+ err = SVN_NO_ERROR;
+ }
+
+ return err;
+}
+
svn_error_t *
svn_client_conflict_tree_get_details(svn_client_conflict_t *conflict,
svn_client_ctx_t *ctx,
@@ -9732,13 +9748,18 @@ svn_client_conflict_tree_get_details(svn
scratch_pool);
}
+ /* Collecting conflict details may fail due to insufficient access rights.
+ * This is not a failure but simply restricts our future options. */
if (conflict->tree_conflict_get_incoming_details_func)
- SVN_ERR(conflict->tree_conflict_get_incoming_details_func(conflict, ctx,
- scratch_pool));
+ SVN_ERR(ignore_authz_failures(
+ conflict->tree_conflict_get_incoming_details_func(conflict, ctx,
+ scratch_pool)));
+
if (conflict->tree_conflict_get_local_details_func)
- SVN_ERR(conflict->tree_conflict_get_local_details_func(conflict, ctx,
- scratch_pool));
+ SVN_ERR(ignore_authz_failures(
+ conflict->tree_conflict_get_local_details_func(conflict, ctx,
+ scratch_pool)));
if (ctx->notify_func2)
{
Modified:
subversion/branches/better-pristines/subversion/libsvn_repos/deprecated.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/libsvn_repos/deprecated.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/libsvn_repos/deprecated.c
(original)
+++ subversion/branches/better-pristines/subversion/libsvn_repos/deprecated.c
Sun Sep 10 19:05:00 2017
@@ -901,6 +901,31 @@ svn_repos_verify_fs(svn_repos_t *repos,
/*** From load.c ***/
svn_error_t *
+svn_repos_load_fs5(svn_repos_t *repos,
+ svn_stream_t *dumpstream,
+ svn_revnum_t start_rev,
+ svn_revnum_t end_rev,
+ enum svn_repos_load_uuid uuid_action,
+ const char *parent_dir,
+ svn_boolean_t use_pre_commit_hook,
+ svn_boolean_t use_post_commit_hook,
+ svn_boolean_t validate_props,
+ svn_boolean_t ignore_dates,
+ svn_repos_notify_func_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool)
+{
+ return svn_repos_load_fs6(repos, dumpstream, start_rev, end_rev,
+ uuid_action, parent_dir,
+ use_post_commit_hook, use_post_commit_hook,
+ validate_props, ignore_dates, FALSE,
+ notify_func, notify_baton,
+ cancel_func, cancel_baton, pool);
+}
+
+svn_error_t *
svn_repos_load_fs4(svn_repos_t *repos,
svn_stream_t *dumpstream,
svn_revnum_t start_rev,
@@ -1092,6 +1117,40 @@ svn_repos_load_fs(svn_repos_t *repos,
}
svn_error_t *
+svn_repos_get_fs_build_parser5(const svn_repos_parse_fns3_t **parser,
+ void **parse_baton,
+ svn_repos_t *repos,
+ svn_revnum_t start_rev,
+ svn_revnum_t end_rev,
+ svn_boolean_t use_history,
+ svn_boolean_t validate_props,
+ enum svn_repos_load_uuid uuid_action,
+ const char *parent_dir,
+ svn_boolean_t use_pre_commit_hook,
+ svn_boolean_t use_post_commit_hook,
+ svn_boolean_t ignore_dates,
+ svn_repos_notify_func_t notify_func,
+ void *notify_baton,
+ apr_pool_t *pool)
+{
+ SVN_ERR(svn_repos_get_fs_build_parser6(parser, parse_baton,
+ repos,
+ start_rev, end_rev,
+ use_history,
+ validate_props,
+ uuid_action,
+ parent_dir,
+ use_pre_commit_hook,
+ use_post_commit_hook,
+ ignore_dates,
+ FALSE /* normalize_props */,
+ notify_func,
+ notify_baton,
+ pool));
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
svn_repos_get_fs_build_parser4(const svn_repos_parse_fns3_t **callbacks,
void **parse_baton,
svn_repos_t *repos,
Modified: subversion/branches/better-pristines/subversion/libsvn_repos/fs-wrap.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/libsvn_repos/fs-wrap.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/libsvn_repos/fs-wrap.c
(original)
+++ subversion/branches/better-pristines/subversion/libsvn_repos/fs-wrap.c Sun
Sep 10 19:05:00 2017
@@ -33,6 +33,7 @@
#include "svn_repos.h"
#include "svn_time.h"
#include "svn_sorts.h"
+#include "svn_subst.h"
#include "repos.h"
#include "svn_private_config.h"
#include "private/svn_repos_private.h"
@@ -235,10 +236,13 @@ svn_repos__validate_prop(const char *nam
* carriage return characters ('\r'). */
if (strchr(value->data, '\r') != NULL)
{
- return svn_error_createf
- (SVN_ERR_BAD_PROPERTY_VALUE, NULL,
+ svn_error_t *err = svn_error_createf
+ (SVN_ERR_BAD_PROPERTY_VALUE_EOL, NULL,
_("Cannot accept non-LF line endings in '%s' property"),
name);
+
+ return svn_error_create(SVN_ERR_BAD_PROPERTY_VALUE, err,
+ _("Invalid property value"));
}
}
@@ -256,6 +260,34 @@ svn_repos__validate_prop(const char *nam
}
return SVN_NO_ERROR;
+}
+
+
+svn_error_t *
+svn_repos__normalize_prop(const svn_string_t **result_p,
+ svn_boolean_t *normalized_p,
+ const char *name,
+ const svn_string_t *value,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ if (svn_prop_needs_translation(name) && value)
+ {
+ svn_string_t *new_value;
+
+ SVN_ERR(svn_subst_translate_string2(&new_value, NULL, normalized_p,
+ value, "UTF-8", TRUE,
+ result_pool, scratch_pool));
+ *result_p = new_value;
+ }
+ else
+ {
+ *result_p = svn_string_dup(value, result_pool);
+ if (normalized_p)
+ *normalized_p = FALSE;
+ }
+
+ return SVN_NO_ERROR;
}
Modified:
subversion/branches/better-pristines/subversion/libsvn_repos/load-fs-vtable.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/libsvn_repos/load-fs-vtable.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
---
subversion/branches/better-pristines/subversion/libsvn_repos/load-fs-vtable.c
(original)
+++
subversion/branches/better-pristines/subversion/libsvn_repos/load-fs-vtable.c
Sun Sep 10 19:05:00 2017
@@ -55,6 +55,7 @@ struct parse_baton
svn_boolean_t use_history;
svn_boolean_t validate_props;
svn_boolean_t ignore_dates;
+ svn_boolean_t normalize_props;
svn_boolean_t use_pre_commit_hook;
svn_boolean_t use_post_commit_hook;
enum svn_repos_load_uuid uuid_action;
@@ -163,8 +164,12 @@ change_rev_prop(svn_repos_t *repos,
const char *name,
const svn_string_t *value,
svn_boolean_t validate_props,
+ svn_boolean_t normalize_props,
apr_pool_t *pool)
{
+ if (normalize_props)
+ SVN_ERR(svn_repos__normalize_prop(&value, NULL, name, value, pool, pool));
+
if (validate_props)
return svn_repos_fs_change_rev_prop4(repos, revision, NULL, name,
NULL, value, FALSE, FALSE,
@@ -1024,7 +1029,8 @@ close_revision(void *baton)
const svn_prop_t *prop = &APR_ARRAY_IDX(diff, i, svn_prop_t);
SVN_ERR(change_rev_prop(pb->repos, 0, prop->name, prop->value,
- pb->validate_props, rb->pool));
+ pb->validate_props, pb->normalize_props,
+ rb->pool));
}
}
@@ -1042,6 +1048,23 @@ close_revision(void *baton)
prop->value = NULL;
}
+ if (rb->pb->normalize_props)
+ {
+ apr_pool_t *iterpool;
+ int i;
+
+ iterpool = svn_pool_create(rb->pool);
+ for (i = 0; i < rb->revprops->nelts; i++)
+ {
+ svn_prop_t *prop = &APR_ARRAY_IDX(rb->revprops, i, svn_prop_t);
+
+ svn_pool_clear(iterpool);
+ SVN_ERR(svn_repos__normalize_prop(&prop->value, NULL, prop->name,
+ prop->value, rb->pool, iterpool));
+ }
+ svn_pool_destroy(iterpool);
+ }
+
/* Apply revision property changes. */
if (rb->pb->validate_props)
SVN_ERR(svn_repos_fs_change_txn_props(rb->txn, rb->revprops, rb->pool));
@@ -1158,7 +1181,7 @@ close_revision(void *baton)
svn_error_t *
-svn_repos_get_fs_build_parser5(const svn_repos_parse_fns3_t **callbacks,
+svn_repos_get_fs_build_parser6(const svn_repos_parse_fns3_t **callbacks,
void **parse_baton,
svn_repos_t *repos,
svn_revnum_t start_rev,
@@ -1170,6 +1193,7 @@ svn_repos_get_fs_build_parser5(const svn
svn_boolean_t use_pre_commit_hook,
svn_boolean_t use_post_commit_hook,
svn_boolean_t ignore_dates,
+ svn_boolean_t normalize_props,
svn_repos_notify_func_t notify_func,
void *notify_baton,
apr_pool_t *pool)
@@ -1218,6 +1242,7 @@ svn_repos_get_fs_build_parser5(const svn
pb->use_pre_commit_hook = use_pre_commit_hook;
pb->use_post_commit_hook = use_post_commit_hook;
pb->ignore_dates = ignore_dates;
+ pb->normalize_props = normalize_props;
*callbacks = parser;
*parse_baton = pb;
@@ -1226,7 +1251,7 @@ svn_repos_get_fs_build_parser5(const svn
svn_error_t *
-svn_repos_load_fs5(svn_repos_t *repos,
+svn_repos_load_fs6(svn_repos_t *repos,
svn_stream_t *dumpstream,
svn_revnum_t start_rev,
svn_revnum_t end_rev,
@@ -1235,6 +1260,7 @@ svn_repos_load_fs5(svn_repos_t *repos,
svn_boolean_t use_pre_commit_hook,
svn_boolean_t use_post_commit_hook,
svn_boolean_t validate_props,
+ svn_boolean_t normalize_props,
svn_boolean_t ignore_dates,
svn_repos_notify_func_t notify_func,
void *notify_baton,
@@ -1247,7 +1273,7 @@ svn_repos_load_fs5(svn_repos_t *repos,
/* This is really simple. */
- SVN_ERR(svn_repos_get_fs_build_parser5(&parser, &parse_baton,
+ SVN_ERR(svn_repos_get_fs_build_parser6(&parser, &parse_baton,
repos,
start_rev, end_rev,
TRUE, /* look for copyfrom revs */
@@ -1257,6 +1283,7 @@ svn_repos_load_fs5(svn_repos_t *repos,
use_pre_commit_hook,
use_post_commit_hook,
ignore_dates,
+ normalize_props,
notify_func,
notify_baton,
pool));
@@ -1345,7 +1372,8 @@ revprops_close_revision(void *baton)
const svn_prop_t *prop = &APR_ARRAY_IDX(diff, i, svn_prop_t);
SVN_ERR(change_rev_prop(pb->repos, rb->rev, prop->name, prop->value,
- pb->validate_props, rb->pool));
+ pb->validate_props, pb->normalize_props,
+ rb->pool));
}
if (pb->notify_func)
@@ -1386,6 +1414,11 @@ revprops_close_revision(void *baton)
*
* If IGNORE_DATES is set, ignore any revision datestamps found in
* DUMPSTREAM, keeping whatever timestamps the revisions currently have.
+ *
+ * If NORMALIZE_PROPS is set, attempt to normalize invalid Subversion
+ * revision and node properties (those in the svn: namespace) so that
+ * their values would follow the established rules for them. Currently,
+ * this means translating non-LF line endings in the property values to LF.
*/
static svn_error_t *
build_revprop_parser(const svn_repos_parse_fns3_t **callbacks,
@@ -1395,6 +1428,7 @@ build_revprop_parser(const svn_repos_par
svn_revnum_t end_rev,
svn_boolean_t validate_props,
svn_boolean_t ignore_dates,
+ svn_boolean_t normalize_props,
svn_repos_notify_func_t notify_func,
void *notify_baton,
apr_pool_t *result_pool)
@@ -1440,6 +1474,7 @@ build_revprop_parser(const svn_repos_par
pb->use_pre_commit_hook = FALSE;
pb->use_post_commit_hook = FALSE;
pb->ignore_dates = ignore_dates;
+ pb->normalize_props = normalize_props;
*callbacks = parser;
*parse_baton = pb;
@@ -1454,6 +1489,7 @@ svn_repos_load_fs_revprops(svn_repos_t *
svn_revnum_t end_rev,
svn_boolean_t validate_props,
svn_boolean_t ignore_dates,
+ svn_boolean_t normalize_props,
svn_repos_notify_func_t notify_func,
void *notify_baton,
svn_cancel_func_t cancel_func,
@@ -1470,6 +1506,7 @@ svn_repos_load_fs_revprops(svn_repos_t *
start_rev, end_rev,
validate_props,
ignore_dates,
+ normalize_props,
notify_func,
notify_baton,
scratch_pool));
Modified: subversion/branches/better-pristines/subversion/libsvn_subr/utf8proc.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/libsvn_subr/utf8proc.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/libsvn_subr/utf8proc.c
(original)
+++ subversion/branches/better-pristines/subversion/libsvn_subr/utf8proc.c Sun
Sep 10 19:05:00 2017
@@ -251,14 +251,12 @@ svn_utf__fuzzy_glob_match(const char *st
/* Try to normalize case and accents in STR.
*
- * If that should fail for some reason, continue with the original STR.
- * There is still a fair chance that it matches "*.ext" pattern despite
- * being "broken" UTF8. */
+ * If that should fail for some reason, consider STR a mismatch. */
err = svn_utf__xfrm(&normalized, str, strlen(str), TRUE, TRUE, buf);
if (err)
{
svn_error_clear(err);
- normalized = str;
+ return FALSE;
}
/* Now see whether it matches any/all of the patterns. */
Modified: subversion/branches/better-pristines/subversion/libsvn_wc/upgrade.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/libsvn_wc/upgrade.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/libsvn_wc/upgrade.c
(original)
+++ subversion/branches/better-pristines/subversion/libsvn_wc/upgrade.c Sun Sep
10 19:05:00 2017
@@ -654,178 +654,6 @@ ensure_repos_info(svn_wc_entry_t *entry,
}
-/*
- * Read tree conflict descriptions from @a conflict_data. Set @a *conflicts
- * to a hash of pointers to svn_wc_conflict_description2_t objects indexed by
- * svn_wc_conflict_description2_t.local_abspath, all newly allocated in @a
- * pool. @a dir_path is the path to the working copy directory whose conflicts
- * are being read. The conflicts read are the tree conflicts on the immediate
- * child nodes of @a dir_path. Do all allocations in @a pool.
- *
- * Note: There were some concerns about this function:
- *
- * ### this is BAD. the CONFLICTS structure should not be dependent upon
- * ### DIR_PATH. each conflict should be labeled with an entry name, not
- * ### a whole path. (and a path which happens to vary based upon invocation
- * ### of the user client and these APIs)
- *
- * those assumptions were baked into former versions of the data model, so
- * they have to stick around here. But they have been removed from the
- * New Way. */
-static svn_error_t *
-read_tree_conflicts(apr_hash_t **conflicts,
- const char *conflict_data,
- const char *dir_path,
- apr_pool_t *pool)
-{
- const svn_skel_t *skel;
- apr_pool_t *iterpool;
-
- *conflicts = apr_hash_make(pool);
-
- if (conflict_data == NULL)
- return SVN_NO_ERROR;
-
- skel = svn_skel__parse(conflict_data, strlen(conflict_data), pool);
- if (skel == NULL)
- return svn_error_create(SVN_ERR_WC_CORRUPT, NULL,
- _("Error parsing tree conflict skel"));
-
- iterpool = svn_pool_create(pool);
- for (skel = skel->children; skel != NULL; skel = skel->next)
- {
- const svn_wc_conflict_description2_t *conflict;
-
- svn_pool_clear(iterpool);
- SVN_ERR(svn_wc__deserialize_conflict(&conflict, skel, dir_path,
- pool, iterpool));
- if (conflict != NULL)
- svn_hash_sets(*conflicts,
- svn_dirent_basename(conflict->local_abspath, pool),
- conflict);
- }
- svn_pool_destroy(iterpool);
-
- return SVN_NO_ERROR;
-}
-
-/* */
-static svn_error_t *
-migrate_single_tree_conflict_data(svn_sqlite__db_t *sdb,
- const char *tree_conflict_data,
- apr_int64_t wc_id,
- const char *local_relpath,
- apr_pool_t *scratch_pool)
-{
- apr_hash_t *conflicts;
- apr_hash_index_t *hi;
- apr_pool_t *iterpool;
-
- SVN_ERR(read_tree_conflicts(&conflicts, tree_conflict_data, local_relpath,
- scratch_pool));
-
- iterpool = svn_pool_create(scratch_pool);
- for (hi = apr_hash_first(scratch_pool, conflicts);
- hi;
- hi = apr_hash_next(hi))
- {
- const svn_wc_conflict_description2_t *conflict = apr_hash_this_val(hi);
- const char *conflict_relpath;
- const char *conflict_data;
- svn_sqlite__stmt_t *stmt;
- svn_boolean_t have_row;
- svn_skel_t *skel;
-
- svn_pool_clear(iterpool);
-
- conflict_relpath = svn_dirent_join(local_relpath,
- svn_dirent_basename(
- conflict->local_abspath, iterpool),
- iterpool);
-
- SVN_ERR(svn_wc__serialize_conflict(&skel, conflict, iterpool, iterpool));
- conflict_data = svn_skel__unparse(skel, iterpool)->data;
-
- /* See if we need to update or insert an ACTUAL node. */
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_ACTUAL_NODE));
- SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, conflict_relpath));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- SVN_ERR(svn_sqlite__reset(stmt));
-
- if (have_row)
- {
- /* There is an existing ACTUAL row, so just update it. */
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_UPDATE_ACTUAL_CONFLICT));
- }
- else
- {
- /* We need to insert an ACTUAL row with the tree conflict data. */
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_INSERT_ACTUAL_CONFLICT));
- }
-
- SVN_ERR(svn_sqlite__bindf(stmt, "iss", wc_id, conflict_relpath,
- conflict_data));
- if (!have_row)
- SVN_ERR(svn_sqlite__bind_text(stmt, 4, local_relpath));
-
- SVN_ERR(svn_sqlite__step_done(stmt));
- }
-
- svn_pool_destroy(iterpool);
-
- return SVN_NO_ERROR;
-}
-
-
-/* */
-static svn_error_t *
-migrate_tree_conflict_data(svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
- svn_sqlite__stmt_t *stmt;
- svn_boolean_t have_row;
- apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-
- /* Iterate over each node which has a set of tree conflicts, then insert
- all of them into the new schema. */
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT));
-
- /* Get all the existing tree conflict data. */
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- while (have_row)
- {
- apr_int64_t wc_id;
- const char *local_relpath;
- const char *tree_conflict_data;
-
- svn_pool_clear(iterpool);
-
- wc_id = svn_sqlite__column_int64(stmt, 0);
- local_relpath = svn_sqlite__column_text(stmt, 1, iterpool);
- tree_conflict_data = svn_sqlite__column_text(stmt, 2, iterpool);
-
- SVN_ERR(migrate_single_tree_conflict_data(sdb, tree_conflict_data,
- wc_id, local_relpath,
- iterpool));
-
- /* We don't need to do anything but step over the previously
- prepared statement. */
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- }
- SVN_ERR(svn_sqlite__reset(stmt));
-
- /* Erase all the old tree conflict data. */
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_UPGRADE_21_ERASE_OLD_CONFLICTS));
- SVN_ERR(svn_sqlite__step_done(stmt));
-
- svn_pool_destroy(iterpool);
- return SVN_NO_ERROR;
-}
-
/* ### need much more docco
### this function should be called within a sqlite transaction. it makes
@@ -1319,234 +1147,6 @@ migrate_text_bases(apr_hash_t **text_bas
return SVN_NO_ERROR;
}
-static svn_error_t *
-bump_to_20(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_CREATE_NODES));
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_20));
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-bump_to_21(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_21));
- SVN_ERR(migrate_tree_conflict_data(sdb, scratch_pool));
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-bump_to_22(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_22));
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-bump_to_23(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
- const char *wcroot_abspath = ((struct bump_baton *)baton)->wcroot_abspath;
- svn_sqlite__stmt_t *stmt;
- svn_boolean_t have_row;
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_UPGRADE_23_HAS_WORKING_NODES));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- SVN_ERR(svn_sqlite__reset(stmt));
- if (have_row)
- return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
- _("The working copy at '%s' is format 22 with "
- "WORKING nodes; use a format 22 client to "
- "diff/revert before using this client"),
- wcroot_abspath);
-
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_23));
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-bump_to_24(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_24));
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_CREATE_NODES_TRIGGERS));
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-bump_to_25(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_25));
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-bump_to_26(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_26));
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-bump_to_27(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
- const char *wcroot_abspath = ((struct bump_baton *)baton)->wcroot_abspath;
- svn_sqlite__stmt_t *stmt;
- svn_boolean_t have_row;
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- SVN_ERR(svn_sqlite__reset(stmt));
- if (have_row)
- return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
- _("The working copy at '%s' is format 26 with "
- "conflicts; use a format 26 client to resolve "
- "before using this client"),
- wcroot_abspath);
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_27));
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-bump_to_28(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_28));
- return SVN_NO_ERROR;
-}
-
-/* If FINFO indicates that ABSPATH names a file, rename it to
- * '<ABSPATH>.svn-base'.
- *
- * Ignore any file whose name is not the expected length, in order to make
- * life easier for any developer who runs this code twice or has some
- * non-standard files in the pristine directory.
- *
- * A callback for bump_to_29(), implementing #svn_io_walk_func_t. */
-static svn_error_t *
-rename_pristine_file(void *baton,
- const char *abspath,
- const apr_finfo_t *finfo,
- apr_pool_t *pool)
-{
- if (finfo->filetype == APR_REG
- && (strlen(svn_dirent_basename(abspath, pool))
- == PRISTINE_BASENAME_OLD_LEN))
- {
- const char *new_abspath
- = apr_pstrcat(pool, abspath, PRISTINE_STORAGE_EXT, SVN_VA_NULL);
-
- SVN_ERR(svn_io_file_rename2(abspath, new_abspath, FALSE, pool));
- }
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-upgrade_externals(struct bump_baton *bb,
- svn_sqlite__db_t *sdb,
- apr_pool_t *scratch_pool)
-{
- svn_sqlite__stmt_t *stmt;
- svn_sqlite__stmt_t *stmt_add;
- svn_boolean_t have_row;
- apr_pool_t *iterpool;
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_SELECT_EXTERNAL_PROPERTIES));
-
- SVN_ERR(svn_sqlite__get_statement(&stmt_add, sdb,
- STMT_INSERT_EXTERNAL));
-
- /* ### For this intermediate upgrade we just assume WC_ID = 1.
- ### Before this bump we lost track of externals all the time,
- ### so lets keep this easy. */
- SVN_ERR(svn_sqlite__bindf(stmt, "is", (apr_int64_t)1, ""));
-
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
-
- iterpool = svn_pool_create(scratch_pool);
- while (have_row)
- {
- apr_hash_t *props;
- const char *externals;
-
- svn_pool_clear(iterpool);
-
- SVN_ERR(svn_sqlite__column_properties(&props, stmt, 0,
- iterpool, iterpool));
-
- externals = svn_prop_get_value(props, SVN_PROP_EXTERNALS);
-
- if (externals)
- {
- apr_array_header_t *ext;
- const char *local_relpath;
- const char *local_abspath;
- int i;
-
- local_relpath = svn_sqlite__column_text(stmt, 1, NULL);
- local_abspath = svn_dirent_join(bb->wcroot_abspath, local_relpath,
- iterpool);
-
- SVN_ERR(svn_wc_parse_externals_description3(&ext, local_abspath,
- externals, FALSE,
- iterpool));
-
- for (i = 0; i < ext->nelts; i++)
- {
- const svn_wc_external_item2_t *item;
- const char *item_relpath;
-
- item = APR_ARRAY_IDX(ext, i, const svn_wc_external_item2_t *);
- item_relpath = svn_relpath_join(local_relpath, item->target_dir,
- iterpool);
-
- /* Insert dummy externals definitions: Insert an unknown
- external, to make sure it will be cleaned up when it is not
- updated on the next update. */
- SVN_ERR(svn_sqlite__bindf(stmt_add, "isssssis",
- (apr_int64_t)1, /* wc_id */
- item_relpath,
- svn_relpath_dirname(item_relpath,
- iterpool),
- "normal",
- "unknown",
- local_relpath,
- (apr_int64_t)1, /* repos_id */
- "" /* repos_relpath */));
- SVN_ERR(svn_sqlite__insert(NULL, stmt_add));
- }
- }
-
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- }
-
- svn_pool_destroy(iterpool);
- return svn_error_trace(svn_sqlite__reset(stmt));
-}
-
-static svn_error_t *
-bump_to_29(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
-{
- struct bump_baton *bb = baton;
- const char *wcroot_abspath = bb->wcroot_abspath;
- const char *pristine_dir_abspath;
-
- /* Rename all pristine files, adding a ".svn-base" suffix. */
- pristine_dir_abspath = svn_dirent_join_many(scratch_pool, wcroot_abspath,
- svn_wc_get_adm_dir(scratch_pool),
- PRISTINE_STORAGE_RELPATH,
- SVN_VA_NULL);
- SVN_ERR(svn_io_dir_walk2(pristine_dir_abspath, APR_FINFO_MIN,
- rename_pristine_file, NULL, scratch_pool));
-
- /* Externals */
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_CREATE_EXTERNALS));
-
- SVN_ERR(upgrade_externals(bb, sdb, scratch_pool));
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_29));
- return SVN_NO_ERROR;
-}
-
svn_error_t *
svn_wc__upgrade_conflict_skel_from_raw(svn_skel_t **conflicts,
svn_wc__db_t *db,
@@ -1775,41 +1375,10 @@ bump_to_31(void *baton,
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
apr_array_header_t *empty_iprops = apr_array_make(
scratch_pool, 0, sizeof(svn_prop_inherited_item_t *));
- svn_boolean_t iprops_column_exists = FALSE;
svn_error_t *err;
- /* Add the inherited_props column to NODES if it does not yet exist.
- *
- * When using a format >= 31 client to upgrade from old formats which
- * did not yet have a NODES table, the inherited_props column has
- * already been created as part of the NODES table. Attemping to add
- * the inherited_props column will raise an error in this case, so check
- * if the column exists first.
- *
- * Checking for the existence of a column before ALTER TABLE is not
- * possible within SQLite. We need to run a separate query and evaluate
- * its result in C first.
- */
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_PRAGMA_TABLE_INFO_NODES));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- while (have_row)
- {
- const char *column_name = svn_sqlite__column_text(stmt, 1, NULL);
-
- if (strcmp(column_name, "inherited_props") == 0)
- {
- iprops_column_exists = TRUE;
- break;
- }
-
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- }
- SVN_ERR(svn_sqlite__reset(stmt));
- if (!iprops_column_exists)
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_31_ALTER_TABLE));
-
/* Run additional statements to finalize the upgrade to format 31. */
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_31_FINALIZE));
+ SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_31));
/* Set inherited_props to an empty array for the roots of all
switched subtrees in the WC. This allows subsequent updates
@@ -2110,6 +1679,15 @@ svn_wc__upgrade_sdb(int *result_format,
svn_dirent_local_style(wcroot_abspath,
scratch_pool),
start_format);
+ else if (start_format < 29)
+ return svn_error_createf(SVN_ERR_WC_UPGRADE_REQUIRED, NULL,
+ _("Working copy '%s' is an old development "
+ "version (format %d); to upgrade it, "
+ "use a Subversion 1.7-1.9 client, then "
+ "use the current client"),
+ svn_dirent_local_style(wcroot_abspath,
+ scratch_pool),
+ start_format);
if (start_format > target_format)
return svn_error_createf(SVN_ERR_WC_UNSUPPORTED_FORMAT, NULL,
@@ -2189,16 +1767,6 @@ svn_wc__update_schema(int *result_format
switch (*result_format)
{
- UPDATE_TO_FORMAT(20);
- UPDATE_TO_FORMAT(21);
- UPDATE_TO_FORMAT(22);
- UPDATE_TO_FORMAT(23);
- UPDATE_TO_FORMAT(24);
- UPDATE_TO_FORMAT(25);
- UPDATE_TO_FORMAT(26);
- UPDATE_TO_FORMAT(27);
- UPDATE_TO_FORMAT(28);
- UPDATE_TO_FORMAT(29);
UPDATE_TO_FORMAT(30);
UPDATE_TO_FORMAT(31);
UPDATE_TO_FORMAT(32);
Modified:
subversion/branches/better-pristines/subversion/libsvn_wc/wc-metadata.sql
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/libsvn_wc/wc-metadata.sql?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/libsvn_wc/wc-metadata.sql
(original)
+++ subversion/branches/better-pristines/subversion/libsvn_wc/wc-metadata.sql
Sun Sep 10 19:05:00 2017
@@ -228,14 +228,6 @@ CREATE TABLE WC_LOCK (
PRIMARY KEY (wc_id, local_dir_relpath)
);
-/* When we're creating a new working copy, the default schema creates
- the earliest supported format. The normal WC upgrade code is used
- to bring the format up to SVN_WC__VERSION. */
-PRAGMA user_version =
--- define: SVN_WC__SUPPORTED_VERSION
-;
-
-
/* ------------------------------------------------------------------------- */
/* The NODES table describes the way WORKING nodes are layered on top of
@@ -281,7 +273,6 @@ PRAGMA user_version =
An 'svn revert foo/bar' would remove the NODES of (2).
*/
--- STMT_CREATE_NODES
CREATE TABLE NODES (
/* Working copy location related fields */
@@ -505,8 +496,6 @@ CREATE VIEW NODES_BASE AS
SELECT * FROM nodes
WHERE op_depth = 0;
--- STMT_CREATE_NODES_TRIGGERS
-
CREATE TRIGGER nodes_insert_trigger
AFTER INSERT ON nodes
WHEN NEW.checksum IS NOT NULL
@@ -534,8 +523,6 @@ BEGIN
WHERE checksum = OLD.checksum;
END;
--- STMT_CREATE_EXTERNALS
-
CREATE TABLE EXTERNALS (
/* Working copy location related fields (like NODES)*/
@@ -574,6 +561,15 @@ CREATE UNIQUE INDEX I_EXTERNALS_DEFINED
def_local_relpath,
local_relpath);
+
+/* When we're creating a new working copy, the default schema creates
+ the earliest supported format. The normal WC upgrade code is used
+ to bring the format up to SVN_WC__VERSION. */
+PRAGMA user_version =
+-- define: SVN_WC__SUPPORTED_VERSION
+;
+
+
/* ------------------------------------------------------------------------- */
/* This statement provides SQLite with the necessary information about our
indexes to make better decisions in the query planner.
@@ -632,208 +628,6 @@ INSERT INTO sqlite_stat1(tbl, idx, stat)
ANALYZE sqlite_master; /* Loads sqlite_stat1 data for query optimizer */
/* ------------------------------------------------------------------------- */
-/* Format 20 introduces NODES and removes BASE_NODE and WORKING_NODE */
-
--- STMT_UPGRADE_TO_20
-
-UPDATE BASE_NODE SET checksum = (SELECT checksum FROM pristine
- WHERE md5_checksum = BASE_NODE.checksum)
-WHERE EXISTS (SELECT 1 FROM pristine WHERE md5_checksum = BASE_NODE.checksum);
-
-UPDATE WORKING_NODE SET checksum = (SELECT checksum FROM pristine
- WHERE md5_checksum = WORKING_NODE.checksum)
-WHERE EXISTS (SELECT 1 FROM pristine
- WHERE md5_checksum = WORKING_NODE.checksum);
-
-INSERT INTO NODES (
- wc_id, local_relpath, op_depth, parent_relpath,
- repos_id, repos_path, revision,
- presence, depth, moved_here, moved_to, kind,
- changed_revision, changed_date, changed_author,
- checksum, properties, translated_size, last_mod_time,
- dav_cache, symlink_target, file_external )
-SELECT wc_id, local_relpath, 0 /*op_depth*/, parent_relpath,
- repos_id, repos_relpath, revnum,
- presence, depth, NULL /*moved_here*/, NULL /*moved_to*/, kind,
- changed_rev, changed_date, changed_author,
- checksum, properties, translated_size, last_mod_time,
- dav_cache, symlink_target, file_external
-FROM BASE_NODE;
-INSERT INTO NODES (
- wc_id, local_relpath, op_depth, parent_relpath,
- repos_id, repos_path, revision,
- presence, depth, moved_here, moved_to, kind,
- changed_revision, changed_date, changed_author,
- checksum, properties, translated_size, last_mod_time,
- dav_cache, symlink_target, file_external )
-SELECT wc_id, local_relpath, 2 /*op_depth*/, parent_relpath,
- copyfrom_repos_id, copyfrom_repos_path, copyfrom_revnum,
- presence, depth, NULL /*moved_here*/, NULL /*moved_to*/, kind,
- changed_rev, changed_date, changed_author,
- checksum, properties, translated_size, last_mod_time,
- NULL /*dav_cache*/, symlink_target, NULL /*file_external*/
-FROM WORKING_NODE;
-
-DROP TABLE BASE_NODE;
-DROP TABLE WORKING_NODE;
-
-PRAGMA user_version = 20;
-
-
-/* ------------------------------------------------------------------------- */
-
-/* Format 21 involves no schema changes, it moves the tree conflict victim
- information to victime nodes, rather than parents. */
-
--- STMT_UPGRADE_TO_21
-PRAGMA user_version = 21;
-
-/* For format 21 bump code */
--- STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT
-SELECT wc_id, local_relpath, tree_conflict_data
-FROM actual_node
-WHERE tree_conflict_data IS NOT NULL
-
-/* For format 21 bump code */
--- STMT_UPGRADE_21_ERASE_OLD_CONFLICTS
-UPDATE actual_node SET tree_conflict_data = NULL
-
-/* ------------------------------------------------------------------------- */
-
-/* Format 22 simply moves the tree conflict information from the conflict_data
- column to the tree_conflict_data column. */
-
--- STMT_UPGRADE_TO_22
-UPDATE actual_node SET tree_conflict_data = conflict_data;
-UPDATE actual_node SET conflict_data = NULL;
-
-PRAGMA user_version = 22;
-
-
-/* ------------------------------------------------------------------------- */
-
-/* Format 23 involves no schema changes, it introduces multi-layer
- op-depth processing for NODES. */
-
--- STMT_UPGRADE_TO_23
-PRAGMA user_version = 23;
-
--- STMT_UPGRADE_23_HAS_WORKING_NODES
-SELECT 1 FROM nodes WHERE op_depth > 0
-LIMIT 1
-
-/* ------------------------------------------------------------------------- */
-
-/* Format 24 involves no schema changes; it starts using the pristine
- table's refcount column correctly. */
-
--- STMT_UPGRADE_TO_24
-UPDATE pristine SET refcount =
- (SELECT COUNT(*) FROM nodes
- WHERE checksum = pristine.checksum /*OR checksum = pristine.md5_checksum*/);
-
-PRAGMA user_version = 24;
-
-/* ------------------------------------------------------------------------- */
-
-/* Format 25 introduces the NODES_CURRENT view. */
-
--- STMT_UPGRADE_TO_25
-DROP VIEW IF EXISTS NODES_CURRENT;
-CREATE VIEW NODES_CURRENT AS
- SELECT * FROM nodes
- JOIN (SELECT wc_id, local_relpath, MAX(op_depth) AS op_depth FROM nodes
- GROUP BY wc_id, local_relpath) AS filter
- ON nodes.wc_id = filter.wc_id
- AND nodes.local_relpath = filter.local_relpath
- AND nodes.op_depth = filter.op_depth;
-
-PRAGMA user_version = 25;
-
-/* ------------------------------------------------------------------------- */
-
-/* Format 26 introduces the NODES_BASE view. */
-
--- STMT_UPGRADE_TO_26
-DROP VIEW IF EXISTS NODES_BASE;
-CREATE VIEW NODES_BASE AS
- SELECT * FROM nodes
- WHERE op_depth = 0;
-
-PRAGMA user_version = 26;
-
-/* ------------------------------------------------------------------------- */
-
-/* Format 27 involves no schema changes, it introduces stores
- conflict files as relpaths rather than names in ACTUAL_NODE. */
-
--- STMT_UPGRADE_TO_27
-PRAGMA user_version = 27;
-
-/* For format 27 bump code */
--- STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS
-SELECT 1 FROM actual_node
-WHERE NOT ((prop_reject IS NULL) AND (conflict_old IS NULL)
- AND (conflict_new IS NULL) AND (conflict_working IS NULL)
- AND (tree_conflict_data IS NULL))
-LIMIT 1
-
-
-/* ------------------------------------------------------------------------- */
-
-/* Format 28 involves no schema changes, it only converts MD5 pristine
- references to SHA1. */
-
--- STMT_UPGRADE_TO_28
-
-UPDATE NODES SET checksum = (SELECT checksum FROM pristine
- WHERE md5_checksum = nodes.checksum)
-WHERE EXISTS (SELECT 1 FROM pristine WHERE md5_checksum = nodes.checksum);
-
-PRAGMA user_version = 28;
-
-/* ------------------------------------------------------------------------- */
-
-/* Format 29 introduces the EXTERNALS table (See STMT_CREATE_TRIGGERS) and
- optimizes a few trigger definitions. ... */
-
--- STMT_UPGRADE_TO_29
-
-DROP TRIGGER IF EXISTS nodes_update_checksum_trigger;
-DROP TRIGGER IF EXISTS nodes_insert_trigger;
-DROP TRIGGER IF EXISTS nodes_delete_trigger;
-
-CREATE TRIGGER nodes_update_checksum_trigger
-AFTER UPDATE OF checksum ON nodes
-WHEN NEW.checksum IS NOT OLD.checksum
- /* AND (NEW.checksum IS NOT NULL OR OLD.checksum IS NOT NULL) */
-BEGIN
- UPDATE pristine SET refcount = refcount + 1
- WHERE checksum = NEW.checksum;
- UPDATE pristine SET refcount = refcount - 1
- WHERE checksum = OLD.checksum;
-END;
-
-CREATE TRIGGER nodes_insert_trigger
-AFTER INSERT ON nodes
-WHEN NEW.checksum IS NOT NULL
-BEGIN
- UPDATE pristine SET refcount = refcount + 1
- WHERE checksum = NEW.checksum;
-END;
-
-CREATE TRIGGER nodes_delete_trigger
-AFTER DELETE ON nodes
-WHEN OLD.checksum IS NOT NULL
-BEGIN
- UPDATE pristine SET refcount = refcount - 1
- WHERE checksum = OLD.checksum;
-END;
-
-PRAGMA user_version = 29;
-
-/* ------------------------------------------------------------------------- */
-
/* Format 30 creates a new NODES index for move information, and a new
PRISTINE index for the md5_checksum column. It also activates use of
skel-based conflict storage -- see notes/wc-ng/conflict-storage-2.0.
@@ -872,9 +666,9 @@ WHERE wc_id = ?1 and local_relpath = ?2
/* Format 31 adds the inherited_props column to the NODES table. C code then
initializes the update/switch roots to make sure future updates fetch the
inherited properties */
--- STMT_UPGRADE_TO_31_ALTER_TABLE
+-- STMT_UPGRADE_TO_31
ALTER TABLE NODES ADD COLUMN inherited_props BLOB;
--- STMT_UPGRADE_TO_31_FINALIZE
+
DROP INDEX IF EXISTS I_ACTUAL_CHANGELIST;
DROP INDEX IF EXISTS I_EXTERNALS_PARENT;
@@ -909,27 +703,8 @@ WHERE l.op_depth = 0
/* ------------------------------------------------------------------------- */
/* Format 32 .... */
-- STMT_UPGRADE_TO_32
-
-/* Drop old index. ### Remove this part from the upgrade to 31 once bumped */
-DROP INDEX IF EXISTS I_ACTUAL_CHANGELIST;
-DROP INDEX IF EXISTS I_EXTERNALS_PARENT;
-CREATE INDEX I_EXTERNALS_PARENT ON EXTERNALS (wc_id, parent_relpath);
-
-DROP INDEX I_NODES_PARENT;
-CREATE UNIQUE INDEX I_NODES_PARENT ON NODES (wc_id, parent_relpath,
- local_relpath, op_depth);
-
-DROP INDEX I_ACTUAL_PARENT;
-CREATE UNIQUE INDEX I_ACTUAL_PARENT ON ACTUAL_NODE (wc_id, parent_relpath,
- local_relpath);
-
PRAGMA user_version = 32;
-/* ------------------------------------------------------------------------- */
-
-/* Format YYY introduces new handling for conflict information. */
--- format: YYY
-
/* ------------------------------------------------------------------------- */
Modified: subversion/branches/better-pristines/subversion/libsvn_wc/wc_db.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/libsvn_wc/wc_db.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/better-pristines/subversion/libsvn_wc/wc_db.c Sun Sep
10 19:05:00 2017
@@ -1373,9 +1373,6 @@ init_db(/* output values */
/* Create the database's schema. */
SVN_ERR(svn_sqlite__exec_statements(db, STMT_CREATE_SCHEMA));
- SVN_ERR(svn_sqlite__exec_statements(db, STMT_CREATE_NODES));
- SVN_ERR(svn_sqlite__exec_statements(db, STMT_CREATE_NODES_TRIGGERS));
- SVN_ERR(svn_sqlite__exec_statements(db, STMT_CREATE_EXTERNALS));
/* TODO: Parametrize the target format here. */
SVN_ERR(svn_wc__update_schema(&result_format, wcroot_abspath, db,
Modified: subversion/branches/better-pristines/subversion/svnadmin/svnadmin.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/svnadmin/svnadmin.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/svnadmin/svnadmin.c
(original)
+++ subversion/branches/better-pristines/subversion/svnadmin/svnadmin.c Sun Sep
10 19:05:00 2017
@@ -151,7 +151,8 @@ enum svnadmin__cmdline_options_t
svnadmin__compatible_version,
svnadmin__check_normalization,
svnadmin__metadata_only,
- svnadmin__no_flush_to_disk
+ svnadmin__no_flush_to_disk,
+ svnadmin__normalize_props
};
/* Option codes and descriptions.
@@ -274,6 +275,10 @@ static const apr_getopt_option_t options
N_("disable flushing to disk during the operation\n"
" (faster, but unsafe on power off)")},
+ {"normalize-props", svnadmin__normalize_props, 0,
+ N_("normalize property values found in the dumpstream\n"
+ " (currently, only translates non-LF line
endings)")},
+
{NULL}
};
@@ -396,7 +401,8 @@ static const svn_opt_subcommand_desc2_t
{'q', 'r', svnadmin__ignore_uuid, svnadmin__force_uuid,
svnadmin__ignore_dates,
svnadmin__use_pre_commit_hook, svnadmin__use_post_commit_hook,
- svnadmin__parent_dir, svnadmin__bypass_prop_validation, 'M',
+ svnadmin__parent_dir, svnadmin__normalize_props,
+ svnadmin__bypass_prop_validation, 'M',
svnadmin__no_flush_to_disk, 'F'},
{{'F', N_("read from file ARG instead of stdin")}} },
@@ -407,8 +413,8 @@ static const svn_opt_subcommand_desc2_t
"repository will cause an error. Progress feedback is sent to stdout.\n"
"If --revision is specified, limit the loaded revisions to only those\n"
"in the dump stream whose revision numbers match the specified range.\n"),
- {'q', 'r', svnadmin__force_uuid, svnadmin__bypass_prop_validation,
- svnadmin__no_flush_to_disk, 'F'},
+ {'q', 'r', svnadmin__force_uuid, svnadmin__normalize_props,
+ svnadmin__bypass_prop_validation, svnadmin__no_flush_to_disk, 'F'},
{{'F', N_("read from file ARG instead of stdin")}} },
{"lock", subcommand_lock, {0}, N_
@@ -547,6 +553,7 @@ struct svnadmin_opt_state
svn_boolean_t bypass_prop_validation; /*
--bypass-prop-validation */
svn_boolean_t ignore_dates; /* --ignore-dates */
svn_boolean_t no_flush_to_disk; /* --no-flush-to-disk */
+ svn_boolean_t normalize_props; /* --normalize_props */
enum svn_repos_load_uuid uuid_action; /* --ignore-uuid,
--force-uuid */
apr_uint64_t memory_cache_size; /* --memory-cache-size M */
@@ -1534,20 +1541,32 @@ subcommand_load(apr_getopt_t *os, void *
if (! opt_state->quiet)
feedback_stream = recode_stream_create(stdout, pool);
- err = svn_repos_load_fs5(repos, in_stream, lower, upper,
+ err = svn_repos_load_fs6(repos, in_stream, lower, upper,
opt_state->uuid_action, opt_state->parent_dir,
opt_state->use_pre_commit_hook,
opt_state->use_post_commit_hook,
!opt_state->bypass_prop_validation,
+ opt_state->normalize_props,
opt_state->ignore_dates,
opt_state->quiet ? NULL : repos_notify_handler,
feedback_stream, check_cancel, NULL, pool);
- if (err && err->apr_err == SVN_ERR_BAD_PROPERTY_VALUE)
- return svn_error_quick_wrap(err,
- _("Invalid property value found in "
- "dumpstream; consider repairing the source "
- "or using --bypass-prop-validation while "
- "loading."));
+
+ if (svn_error_find_cause(err, SVN_ERR_BAD_PROPERTY_VALUE_EOL))
+ {
+ return svn_error_quick_wrap(err,
+ _("A property with invalid line ending "
+ "found in dumpstream; consider using "
+ "--normalize-props while loading."));
+ }
+ else if (err && err->apr_err == SVN_ERR_BAD_PROPERTY_VALUE)
+ {
+ return svn_error_quick_wrap(err,
+ _("Invalid property value found in "
+ "dumpstream; consider repairing the "
+ "source or using --bypass-prop-validation "
+ "while loading."));
+ }
+
return err;
}
@@ -1584,16 +1603,28 @@ subcommand_load_revprops(apr_getopt_t *o
err = svn_repos_load_fs_revprops(repos, in_stream, lower, upper,
!opt_state->bypass_prop_validation,
+ opt_state->normalize_props,
opt_state->ignore_dates,
opt_state->quiet ? NULL
: repos_notify_handler,
feedback_stream, check_cancel, NULL, pool);
- if (err && err->apr_err == SVN_ERR_BAD_PROPERTY_VALUE)
- return svn_error_quick_wrap(err,
- _("Invalid property value found in "
- "dumpstream; consider repairing the source "
- "or using --bypass-prop-validation while "
- "loading."));
+
+ if (svn_error_find_cause(err, SVN_ERR_BAD_PROPERTY_VALUE_EOL))
+ {
+ return svn_error_quick_wrap(err,
+ _("A property with invalid line ending "
+ "found in dumpstream; consider using "
+ "--normalize-props while loading."));
+ }
+ else if (err && err->apr_err == SVN_ERR_BAD_PROPERTY_VALUE)
+ {
+ return svn_error_quick_wrap(err,
+ _("Invalid property value found in "
+ "dumpstream; consider repairing the "
+ "source or using --bypass-prop-validation "
+ "while loading."));
+ }
+
return err;
}
@@ -2884,6 +2915,9 @@ sub_main(int *exit_code, int argc, const
case svnadmin__no_flush_to_disk:
opt_state.no_flush_to_disk = TRUE;
break;
+ case svnadmin__normalize_props:
+ opt_state.normalize_props = TRUE;
+ break;
default:
{
SVN_ERR(subcommand_help(NULL, NULL, pool));
Modified: subversion/branches/better-pristines/subversion/svnrdump/load_editor.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/svnrdump/load_editor.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/svnrdump/load_editor.c
(original)
+++ subversion/branches/better-pristines/subversion/svnrdump/load_editor.c Sun
Sep 10 19:05:00 2017
@@ -713,16 +713,15 @@ set_revision_property(void *baton,
{
struct revision_baton *rb = baton;
- SVN_ERR(svn_rdump__normalize_prop(name, &value, rb->pool));
-
+ SVN_ERR(svn_repos__normalize_prop(&value, NULL, name, value,
+ rb->pool, rb->pool));
SVN_ERR(svn_repos__validate_prop(name, value, rb->pool));
if (rb->rev > 0)
{
if (! svn_hash_gets(rb->pb->skip_revprops, name))
svn_hash_sets(rb->revprop_table,
- apr_pstrdup(rb->pool, name),
- svn_string_dup(value, rb->pool));
+ apr_pstrdup(rb->pool, name), value);
}
else if (rb->rev_offset == -1
&& ! svn_hash_gets(rb->pb->skip_revprops, name))
@@ -737,9 +736,9 @@ set_revision_property(void *baton,
/* Remember any datestamp/ author that passes through (see comment
in close_revision). */
if (!strcmp(name, SVN_PROP_REVISION_DATE))
- rb->datestamp = svn_string_dup(value, rb->pool);
+ rb->datestamp = value;
if (!strcmp(name, SVN_PROP_REVISION_AUTHOR))
- rb->author = svn_string_dup(value, rb->pool);
+ rb->author = value;
return SVN_NO_ERROR;
}
@@ -776,13 +775,13 @@ set_node_property(void *baton,
value = new_value;
}
- SVN_ERR(svn_rdump__normalize_prop(name, &value, pool));
+ SVN_ERR(svn_repos__normalize_prop(&value, NULL, name, value, pool, pool));
SVN_ERR(svn_repos__validate_prop(name, value, pool));
prop = apr_palloc(nb->rb->pool, sizeof (*prop));
prop->name = apr_pstrdup(pool, name);
- prop->value = svn_string_dup(value, pool);
+ prop->value = value;
svn_hash_sets(nb->prop_changes, prop->name, prop);
return SVN_NO_ERROR;
Modified: subversion/branches/better-pristines/subversion/svnrdump/svnrdump.h
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/svnrdump/svnrdump.h?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/svnrdump/svnrdump.h
(original)
+++ subversion/branches/better-pristines/subversion/svnrdump/svnrdump.h Sun Sep
10 19:05:00 2017
@@ -100,29 +100,12 @@ svn_rdump__load_dumpstream(svn_stream_t
* currently all svn:* props) so that they contain only LF (\n) line endings.
*
* Put the normalized props into NORMAL_PROPS, allocated in RESULT_POOL.
- *
- * Note: this function does not do a deep copy; it is expected that PROPS has
- * a longer lifetime than NORMAL_PROPS.
*/
svn_error_t *
svn_rdump__normalize_props(apr_hash_t **normal_props,
apr_hash_t *props,
apr_pool_t *result_pool);
-/* Normalize the line ending style of a single property that "needs
- * translation" (according to svn_prop_needs_translation(),
- * currently all svn:* props) so that they contain only LF (\n) line endings.
- * "\r" characters found mid-line are replaced with "\n".
- * "\r\n" sequences are replaced with "\n"
- *
- * NAME is used to check that VALUE should be normalized, and if this is the
- * case, VALUE is then normalized, allocated from RESULT_POOL
- */
-svn_error_t *
-svn_rdump__normalize_prop(const char *name,
- const svn_string_t **value,
- apr_pool_t *result_pool);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/better-pristines/subversion/svnrdump/util.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/svnrdump/util.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/svnrdump/util.c (original)
+++ subversion/branches/better-pristines/subversion/svnrdump/util.c Sun Sep 10
19:05:00 2017
@@ -21,53 +21,35 @@
* ====================================================================
*/
-#include "svn_error.h"
-#include "svn_pools.h"
-#include "svn_string.h"
-#include "svn_props.h"
-#include "svn_subst.h"
+#include "private/svn_repos_private.h"
#include "svnrdump.h"
svn_error_t *
-svn_rdump__normalize_prop(const char *name,
- const svn_string_t **value,
- apr_pool_t *result_pool)
-{
- if (svn_prop_needs_translation(name) && *value)
- {
- const char *cstring;
-
- SVN_ERR(svn_subst_translate_cstring2((*value)->data, &cstring,
- "\n", TRUE,
- NULL, FALSE,
- result_pool));
-
- *value = svn_string_create(cstring, result_pool);
- }
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
svn_rdump__normalize_props(apr_hash_t **normal_props,
apr_hash_t *props,
apr_pool_t *result_pool)
{
apr_hash_index_t *hi;
+ apr_pool_t *iterpool;
*normal_props = apr_hash_make(result_pool);
+ iterpool = svn_pool_create(result_pool);
for (hi = apr_hash_first(result_pool, props); hi;
hi = apr_hash_next(hi))
{
const char *key = apr_hash_this_key(hi);
const svn_string_t *value = apr_hash_this_val(hi);
- SVN_ERR(svn_rdump__normalize_prop(key, &value,
- result_pool));
+ svn_pool_clear(iterpool);
+ SVN_ERR(svn_repos__normalize_prop(&value, NULL, key, value,
+ result_pool, iterpool));
svn_hash_sets(*normal_props, key, value);
}
+ svn_pool_destroy(iterpool);
+
return SVN_NO_ERROR;
}
Modified:
subversion/branches/better-pristines/subversion/tests/cmdline/svnadmin_tests.py
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/tests/cmdline/svnadmin_tests.py?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
---
subversion/branches/better-pristines/subversion/tests/cmdline/svnadmin_tests.py
(original)
+++
subversion/branches/better-pristines/subversion/tests/cmdline/svnadmin_tests.py
Sun Sep 10 19:05:00 2017
@@ -276,7 +276,7 @@ def load_and_verify_dumpstream(sbox, exp
'load', '--quiet', sbox.repo_dir, *varargs)
if expected_stdout:
- if expected_stdout == svntest.verify.AnyOutput:
+ if expected_stdout is svntest.verify.AnyOutput:
if len(output) == 0:
raise SVNExpectedStdout
else:
@@ -284,7 +284,7 @@ def load_and_verify_dumpstream(sbox, exp
"Standard output", "STDOUT:", expected_stdout, output)
if expected_stderr:
- if expected_stderr == svntest.verify.AnyOutput:
+ if expected_stderr is svntest.verify.AnyOutput:
if len(errput) == 0:
raise SVNExpectedStderr
else:
@@ -1616,14 +1616,34 @@ text
sbox.build(empty=True)
# Try to load the dumpstream, expecting a failure (because of mixed EOLs).
- load_and_verify_dumpstream(sbox, [], svntest.verify.AnyOutput,
- dumpfile_revisions, False, dump_str,
- '--ignore-uuid')
+ exp_err = svntest.verify.RegexListOutput(['svnadmin: E125005',
+ 'svnadmin: E125005',
+ 'svnadmin: E125017'],
+ match_all=False)
+ load_and_verify_dumpstream(sbox, [], exp_err, dumpfile_revisions,
+ False, dump_str, '--ignore-uuid')
# Now try it again bypassing prop validation. (This interface takes
# care of the removal and recreation of the original repository.)
svntest.actions.load_repo(sbox, dump_str=dump_str,
bypass_prop_validation=True)
+ # Getting the property should fail.
+ svntest.actions.run_and_verify_svn(None, 'svn: E135000: ',
+ 'pg', 'svn:log', '--revprop', '-r1',
+ sbox.repo_url)
+
+ # Now try it again with prop normalization.
+ svntest.actions.load_repo(sbox, dump_str=dump_str,
+ bypass_prop_validation=False,
+ normalize_props=True)
+ # We should get the expected property value.
+ exit_code, output, _ = svntest.main.run_svn(None, 'pg', 'svn:log',
+ '--revprop', '-r1',
+ '--no-newline',
+ sbox.repo_url)
+ svntest.verify.verify_exit_code(None, exit_code, 0)
+ if output != ['\n', '\n']:
+ raise svntest.Failure("Unexpected property value %s" % output)
# This test intentionally corrupts a revision and assumes an FSFS
# repository. If you can make it work with BDB please do so.
Modified:
subversion/branches/better-pristines/subversion/tests/cmdline/svntest/actions.py
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/tests/cmdline/svntest/actions.py?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
---
subversion/branches/better-pristines/subversion/tests/cmdline/svntest/actions.py
(original)
+++
subversion/branches/better-pristines/subversion/tests/cmdline/svntest/actions.py
Sun Sep 10 19:05:00 2017
@@ -355,7 +355,8 @@ def run_and_verify_svn2(expected_stdout,
return exit_code, out, err
def run_and_verify_load(repo_dir, dump_file_content,
- bypass_prop_validation = False):
+ bypass_prop_validation = False,
+ normalize_props = False):
"Runs 'svnadmin load' and reports any errors."
if not isinstance(dump_file_content, list):
raise TypeError("dump_file_content argument should have list type")
@@ -363,6 +364,8 @@ def run_and_verify_load(repo_dir, dump_f
args = ()
if bypass_prop_validation:
args += ('--bypass-prop-validation',)
+ if normalize_props:
+ args += ('--normalize-props',)
main.run_command_stdin(
main.svnadmin_binary, expected_stderr, 0, True, dump_file_content,
'load', '--force-uuid', '--quiet', repo_dir, *args)
@@ -473,7 +476,8 @@ def run_and_verify_svnsync2(expected_std
def load_repo(sbox, dumpfile_path = None, dump_str = None,
- bypass_prop_validation = False,create_wc=True):
+ bypass_prop_validation = False, create_wc=True,
+ normalize_props = False):
"Loads the dumpfile into sbox"
if not dump_str:
dump_str = open(dumpfile_path, "rb").read()
@@ -485,7 +489,7 @@ def load_repo(sbox, dumpfile_path = None
# Load the mergetracking dumpfile into the repos, and check it out the repo
run_and_verify_load(sbox.repo_dir, dump_str.splitlines(True),
- bypass_prop_validation)
+ bypass_prop_validation, normalize_props)
if create_wc:
run_and_verify_svn(None, [], "co", sbox.repo_url, sbox.wc_dir)
Modified:
subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests.py
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests.py?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
---
subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests.py
(original)
+++
subversion/branches/better-pristines/subversion/tests/cmdline/upgrade_tests.py
Sun Sep 10 19:05:00 2017
@@ -761,61 +761,6 @@ def dirs_only_upgrade(sbox):
})
run_and_verify_status_no_server(sbox.wc_dir, expected_status)
-def read_tree_conflict_data(sbox, path):
- dot_svn = svntest.main.get_admin_name()
- db = svntest.sqlite3.connect(os.path.join(sbox.wc_dir, dot_svn, 'wc.db'))
- for row in db.execute("select tree_conflict_data from actual_node "
- "where tree_conflict_data is not null "
- "and local_relpath = '%s'" % path):
- return
- raise svntest.Failure("conflict expected for '%s'" % path)
-
-def no_actual_node(sbox, path):
- dot_svn = svntest.main.get_admin_name()
- db = svntest.sqlite3.connect(os.path.join(sbox.wc_dir, dot_svn, 'wc.db'))
- for row in db.execute("select 1 from actual_node "
- "where local_relpath = '%s'" % path):
- raise svntest.Failure("no actual node expected for '%s'" % path)
-
-def upgrade_tree_conflict_data(sbox):
- "upgrade tree conflict data (f20->f21)"
-
- wc_dir = sbox.wc_dir
- replace_sbox_with_tarfile(sbox, 'upgrade_tc.tar.bz2')
-
- # Check and see if we can still read our tree conflicts
- expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
- expected_status.tweak('A/D/G/pi', status='D ', treeconflict='C')
- expected_status.tweak('A/D/G/tau', status='! ', treeconflict='C',
- wc_rev=None)
- expected_status.tweak('A/D/G/rho', status='A ', copied='+',
- treeconflict='C', wc_rev='-')
-
- # Look inside pre-upgrade database
- read_tree_conflict_data(sbox, 'A/D/G')
- no_actual_node(sbox, 'A/D/G/pi')
- no_actual_node(sbox, 'A/D/G/rho')
- no_actual_node(sbox, 'A/D/G/tau')
-
- # While the upgrade from f20 to f21 will work the upgrade from f22
- # to f23 will not, since working nodes are present.
- exit_code, output, errput = svntest.main.run_svn('format 22', 'upgrade',
- wc_dir)
-
- if not exit_code:
- run_and_verify_status_no_server(wc_dir, expected_status)
- else:
- if not svntest.verify.RegexOutput('.*format 22 with WORKING nodes.*',
- match_all=False).matches(errput):
- raise svntest.Failure()
-
- # Look insde post-upgrade database
- read_tree_conflict_data(sbox, 'A/D/G/pi')
- read_tree_conflict_data(sbox, 'A/D/G/rho')
- read_tree_conflict_data(sbox, 'A/D/G/tau')
- # no_actual_node(sbox, 'A/D/G') ### not removed but should be?
-
-
@Issue(3898)
def delete_in_copy_upgrade(sbox):
"upgrade a delete within a copy"
@@ -972,27 +917,6 @@ def tree_replace2(sbox):
})
run_and_verify_status_no_server(sbox.wc_dir, expected_status)
-def upgrade_from_format_28(sbox):
- """upgrade from format 28: rename pristines"""
-
- # Start with a format-28 WC that is a clean checkout of the Greek tree.
- replace_sbox_with_tarfile(sbox, 'format_28.tar.bz2')
-
- # Get the old and new pristine file paths for file 'iota'.
- checksum = '2c0aa9014a0cd07f01795a333d82485ef6d083e2'
- old_pristine_path = os.path.join(sbox.wc_dir, svntest.main.get_admin_name(),
- 'pristine', checksum[0:2], checksum)
- new_pristine_path = old_pristine_path + '.svn-base'
-
- assert os.path.exists(old_pristine_path)
- assert not os.path.exists(new_pristine_path)
-
- # Upgrade the WC
- svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
-
- assert not os.path.exists(old_pristine_path)
- assert os.path.exists(new_pristine_path)
-
@Issue(3901)
def depth_exclude(sbox):
"upgrade 1.6.x wc that has depth=exclude"
@@ -1606,13 +1530,11 @@ test_list = [ None,
missing_dirs2,
delete_and_keep_local,
dirs_only_upgrade,
- upgrade_tree_conflict_data,
delete_in_copy_upgrade,
replaced_files,
upgrade_with_scheduled_change,
tree_replace1,
tree_replace2,
- upgrade_from_format_28,
depth_exclude,
depth_exclude_2,
add_add_del_del_tc,
Modified:
subversion/branches/better-pristines/subversion/tests/libsvn_repos/dump-load-test.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/tests/libsvn_repos/dump-load-test.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
---
subversion/branches/better-pristines/subversion/tests/libsvn_repos/dump-load-test.c
(original)
+++
subversion/branches/better-pristines/subversion/tests/libsvn_repos/dump-load-test.c
Sun Sep 10 19:05:00 2017
@@ -120,13 +120,14 @@ test_load_bad_props(svn_stringbuf_t *dum
svn_revnum_t youngest_rev;
svn_string_t *loaded_prop_val;
- SVN_ERR(svn_repos_load_fs5(repos, stream,
+ SVN_ERR(svn_repos_load_fs6(repos, stream,
SVN_INVALID_REVNUM, SVN_INVALID_REVNUM,
svn_repos_load_uuid_default,
parent_fspath,
FALSE, FALSE, /*use_*_commit_hook*/
validate_props,
FALSE /*ignore_dates*/,
+ FALSE /*normalize_props*/,
notify_func, notify_baton,
NULL, NULL, /*cancellation*/
pool));
Modified:
subversion/branches/better-pristines/subversion/tests/libsvn_wc/utils.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/tests/libsvn_wc/utils.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/subversion/tests/libsvn_wc/utils.c
(original)
+++ subversion/branches/better-pristines/subversion/tests/libsvn_wc/utils.c Sun
Sep 10 19:05:00 2017
@@ -139,12 +139,9 @@ svn_test__create_fake_wc(const char *wc_
* refer to it over its lifetime. */
my_statements = apr_palloc(scratch_pool, 7 * sizeof(const char *));
my_statements[0] = statements[STMT_CREATE_SCHEMA];
- my_statements[1] = statements[STMT_CREATE_NODES];
- my_statements[2] = statements[STMT_CREATE_NODES_TRIGGERS];
- my_statements[3] = statements[STMT_CREATE_EXTERNALS];
- my_statements[4] = statements[STMT_INSTALL_SCHEMA_STATISTICS];
- my_statements[5] = extra_statements;
- my_statements[6] = NULL;
+ my_statements[1] = statements[STMT_INSTALL_SCHEMA_STATISTICS];
+ my_statements[2] = extra_statements;
+ my_statements[3] = NULL;
/* Create fake-wc/SUBDIR/.svn/ for placing the metadata. */
SVN_ERR(svn_io_make_dir_recursively(dotsvn_abspath, scratch_pool));
Modified:
subversion/branches/better-pristines/subversion/tests/libsvn_wc/wc-queries-test.c
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
---
subversion/branches/better-pristines/subversion/tests/libsvn_wc/wc-queries-test.c
(original)
+++
subversion/branches/better-pristines/subversion/tests/libsvn_wc/wc-queries-test.c
Sun Sep 10 19:05:00 2017
@@ -70,9 +70,6 @@ static const int schema_statements[] =
{
/* Usual tables */
STMT_CREATE_SCHEMA,
- STMT_CREATE_NODES,
- STMT_CREATE_NODES_TRIGGERS,
- STMT_CREATE_EXTERNALS,
STMT_INSTALL_SCHEMA_STATISTICS,
/* Memory tables */
STMT_CREATE_TARGETS_LIST,
Modified: subversion/branches/better-pristines/tools/client-side/bash_completion
URL:
http://svn.apache.org/viewvc/subversion/branches/better-pristines/tools/client-side/bash_completion?rev=1807959&r1=1807958&r2=1807959&view=diff
==============================================================================
--- subversion/branches/better-pristines/tools/client-side/bash_completion
(original)
+++ subversion/branches/better-pristines/tools/client-side/bash_completion Sun
Sep 10 19:05:00 2017
@@ -1153,7 +1153,7 @@ _svnadmin ()
cmdOpts="--ignore-uuid --force-uuid --parent-dir -q --quiet \
--use-pre-commit-hook --use-post-commit-hook \
--bypass-prop-validation -M --memory-cache-size \
- --no-flush-to-disk -F --file"
+ --no-flush-to-disk --normalize-props -F --file"
;;
lstxns)
cmdOpts="-r --revision"