You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2016/12/13 12:36:57 UTC
svn commit: r1773992 [8/8] - in /subversion/branches/ra-git: ./
build/ac-macros/ notes/ subversion/bindings/javahl/native/
subversion/bindings/swig/perl/libsvn_swig_perl/
subversion/bindings/swig/ruby/test/ subversion/include/
subversion/include/privat...
Modified: subversion/branches/ra-git/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c?rev=1773992&r1=1773991&r2=1773992&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c (original)
+++ subversion/branches/ra-git/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c Tue Dec 13 12:36:55 2016
@@ -1811,6 +1811,83 @@ pack_with_limited_memory(const svn_test_
#undef MAX_REV
#undef SHARD_SIZE
+/* ------------------------------------------------------------------------ */
+
+#define REPO_NAME "test-repo-large_delta_against_plain"
+
+static svn_error_t *
+large_delta_against_plain(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ fs_fs_data_t *ffd;
+ svn_fs_txn_t *txn;
+ svn_fs_root_t *root;
+ svn_revnum_t rev;
+ svn_stringbuf_t *prop_value;
+ svn_string_t *prop_read;
+ int i;
+ apr_hash_t *fs_config;
+
+ if (strcmp(opts->fs_type, "fsfs") != 0)
+ return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL, NULL);
+
+ /* Create a repo that and explicitly enable rep sharing. */
+ SVN_ERR(svn_test__create_fs(&fs, REPO_NAME, opts, pool));
+ ffd = fs->fsap_data;
+
+ /* Make sure all props are stored as PLAIN reps. */
+ ffd->deltify_properties = FALSE;
+
+ /* Construct a property larger than 2 txdelta windows. */
+ prop_value = svn_stringbuf_create("prop", pool);
+ while (prop_value->len <= 2 * 102400)
+ svn_stringbuf_appendstr(prop_value, prop_value);
+
+ /* Revision 1: create a property rep. */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, pool));
+ SVN_ERR(svn_fs_txn_root(&root, txn, pool));
+ SVN_ERR(svn_fs_change_node_prop(root, "/", "p",
+ svn_string_create(prop_value->data, pool),
+ pool));
+ SVN_ERR(svn_fs_commit_txn(NULL, &rev, txn, pool));
+
+ /* Now, store them as DELTA reps. */
+ ffd->deltify_properties = TRUE;
+
+ /* Construct a property larger than 2 txdelta windows, distinct from the
+ * previous one but with a matching "tail". */
+ prop_value = svn_stringbuf_create("blob", pool);
+ while (prop_value->len <= 2 * 102400)
+ svn_stringbuf_appendstr(prop_value, prop_value);
+ for (i = 0; i < 100; ++i)
+ svn_stringbuf_appendcstr(prop_value, "prop");
+
+ /* Revision 2: modify the property. */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, 1, pool));
+ SVN_ERR(svn_fs_txn_root(&root, txn, pool));
+ SVN_ERR(svn_fs_change_node_prop(root, "/", "p",
+ svn_string_create(prop_value->data, pool),
+ pool));
+ SVN_ERR(svn_fs_commit_txn(NULL, &rev, txn, pool));
+
+ /* Reconstructing the property deltified must work. To make sure we
+ * actually read from disk, use a new FS instance with disjoint caches. */
+ fs_config = apr_hash_make(pool);
+ svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_NS,
+ svn_uuid_generate(pool));
+ SVN_ERR(svn_fs_open2(&fs, REPO_NAME, fs_config, pool, pool));
+
+ SVN_ERR(svn_fs_revision_root(&root, fs, rev, pool));
+ SVN_ERR(svn_fs_node_prop(&prop_read, root, "/", "p", pool));
+ SVN_TEST_STRING_ASSERT(prop_read->data, prop_value->data);
+
+ return SVN_NO_ERROR;
+}
+
+#undef REPO_NAME
+
+
/* The test table. */
@@ -1863,6 +1940,8 @@ static struct svn_test_descriptor_t test
"compare empty PLAIN and non-existent reps"),
SVN_TEST_OPTS_PASS(pack_with_limited_memory,
"pack with limited memory for metadata"),
+ SVN_TEST_OPTS_PASS(large_delta_against_plain,
+ "large deltas against PLAIN, issue #4658"),
SVN_TEST_NULL
};
Modified: subversion/branches/ra-git/subversion/tests/libsvn_repos/repos-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/libsvn_repos/repos-test.c?rev=1773992&r1=1773991&r2=1773992&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/libsvn_repos/repos-test.c (original)
+++ subversion/branches/ra-git/subversion/tests/libsvn_repos/repos-test.c Tue Dec 13 12:36:55 2016
@@ -3882,6 +3882,54 @@ commit_aborted_txn(const svn_test_opts_t
return SVN_NO_ERROR;
}
+static svn_error_t *
+list_callback(const char *path,
+ svn_dirent_t *dirent,
+ void *baton,
+ apr_pool_t *pool)
+{
+ *(int *)baton += 1;
+
+ return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
+test_list(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_repos_t *repos;
+ svn_fs_t *fs;
+ svn_fs_txn_t *txn;
+ svn_fs_root_t *txn_root, *rev_root;
+ svn_revnum_t youngest_rev;
+ int counter = 0;
+ apr_array_header_t *patterns;
+
+ /* Create yet another greek tree repository. */
+ SVN_ERR(svn_test__create_repos(&repos, "test-repo-list", opts, pool));
+ fs = svn_repos_fs(repos);
+
+ /* Prepare a txn to receive the greek tree. */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, pool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
+ SVN_ERR(svn_test__create_greek_tree(txn_root, pool));
+ SVN_ERR(svn_repos_fs_commit_txn(NULL, repos, &youngest_rev, txn, pool));
+ SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(youngest_rev));
+
+ /* List all nodes under /A that contain an 'a'. */
+
+ patterns = apr_array_make(pool, 1, sizeof(const char *));
+ APR_ARRAY_PUSH(patterns, const char *) = "*a*";
+ SVN_ERR(svn_fs_revision_root(&rev_root, fs, youngest_rev, pool));
+ SVN_ERR(svn_repos_list(rev_root, "/A", patterns, svn_depth_infinity, FALSE,
+ NULL, NULL, list_callback, &counter, NULL, NULL,
+ pool));
+ SVN_TEST_ASSERT(counter == 6);
+
+ return SVN_NO_ERROR;
+}
+
/* The test table. */
static int max_threads = 4;
@@ -3941,6 +3989,8 @@ static struct svn_test_descriptor_t test
"authz for svn_repos_trace_node_locations"),
SVN_TEST_OPTS_PASS(commit_aborted_txn,
"test committing a previously aborted txn"),
+ SVN_TEST_OPTS_PASS(test_list,
+ "test svn_repos_list"),
SVN_TEST_NULL
};
Propchange: subversion/branches/ra-git/subversion/tests/libsvn_subr/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Dec 13 12:36:55 2016
@@ -53,3 +53,4 @@ bit-array-test
io-test-*
sqlite-test-*
x509-test
+xml-test
Modified: subversion/branches/ra-git/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c?rev=1773992&r1=1773991&r2=1773992&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c (original)
+++ subversion/branches/ra-git/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c Tue Dec 13 12:36:55 2016
@@ -123,8 +123,8 @@ get_urls(void *baton,
{
mergeinfo_t *mi = baton;
apr_pool_t *target_pool = apr_hash_pool_get(mi->mergeinfo);
- const char *rel_path = svn_dirent_skip_ancestor(info->repos_root_URL,
- info->URL);
+ const char *rel_path = svn_uri_skip_ancestor(info->repos_root_URL,
+ info->URL, pool);
mi->url = apr_pstrdup(target_pool, info->URL);
mi->fs_path = svn_fspath__canonicalize(rel_path, target_pool);
Modified: subversion/branches/ra-git/tools/dev/fsfs-access-map.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/fsfs-access-map.c?rev=1773992&r1=1773991&r2=1773992&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/fsfs-access-map.c (original)
+++ subversion/branches/ra-git/tools/dev/fsfs-access-map.c Tue Dec 13 12:36:55 2016
@@ -34,7 +34,7 @@ typedef struct file_stats_t
/* file name as found in the open() call */
const char *name;
- /* file size as determined during the this tool run. Will be 0 for
+ /* file size as determined during the tool run. Will be 0 for
* files that no longer exist. However, there may still be entries
* in the read_map. */
apr_int64_t size;
Modified: subversion/branches/ra-git/tools/dev/svnmover/linenoise/linenoise.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/svnmover/linenoise/linenoise.c?rev=1773992&r1=1773991&r2=1773992&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/svnmover/linenoise/linenoise.c (original)
+++ subversion/branches/ra-git/tools/dev/svnmover/linenoise/linenoise.c Tue Dec 13 12:36:55 2016
@@ -196,7 +196,7 @@ FILE *lndebug_fp = NULL;
fflush(lndebug_fp); \
} while (0)
#else
-#define lndebug(fmt, ...)
+static void lndebug(const char *fmt, ...) { }
#endif
/* ======================= Low level terminal handling ====================== */
Modified: subversion/branches/ra-git/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/unix-build/Makefile.svn?rev=1773992&r1=1773991&r2=1773992&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/ra-git/tools/dev/unix-build/Makefile.svn Tue Dec 13 12:36:55 2016
@@ -1463,7 +1463,6 @@ $(SVN_OBJDIR)/.configured: $(SVN_OBJDIR)
PATH=$(PREFIX)/ruby/bin:$(PREFIX)/python/bin:$(PREFIX)/gettext/bin:$$PATH \
$(SVN_SRCDIR)/configure \
--enable-maintainer-mode \
- --with-ssl \
--prefix="$(SVN_PREFIX)" \
--with-apr="$(PREFIX)/apr" \
--with-apr-util="$(PREFIX)/apr" \
@@ -1472,6 +1471,8 @@ $(SVN_OBJDIR)/.configured: $(SVN_OBJDIR)
$(SVN_WITH_SASL) \
$(SERF_FLAG) \
--with-sqlite="$(PREFIX)/sqlite" \
+ --with-zlib="/usr" \
+ --without-gnome-keyring \
--with-berkeley-db="$(BDB_FLAG)" \
--with-ruby-sitedir="$(SVN_PREFIX)/lib/ruby/site_ruby" \
--disable-mod-activation \
Modified: subversion/branches/ra-git/tools/dist/advisory.py
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dist/advisory.py?rev=1773992&r1=1773991&r2=1773992&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dist/advisory.py (original)
+++ subversion/branches/ra-git/tools/dist/advisory.py Tue Dec 13 12:36:55 2016
@@ -19,9 +19,9 @@
#
"""
-Send GPG-signed security advisory e-mayails from an @apache.org address
-to a known list of recipients, or write the advisory text in a
-form suitable for publishing on http://subversion.apache.org/.
+Send GPG-signed security advisory e-mails from an @apache.org address
+to a known list of recipients, or write the advisory text in a form
+suitable for publishing on http://subversion.apache.org/.
Usage: cd to the root directory of the advisory descriptions, then:
@@ -66,9 +66,9 @@ def parse_args(argv):
parser = argparse.ArgumentParser(
prog=os.path.basename(__file__), add_help=True,
description="""\
-Send GPG-signed security advisory e-mayails from an @apache.org address
-to a known list of recipients, or write the advisory text in a
-form suitable for publishing on http://subversion.apache.org/.
+Send GPG-signed security advisory e-mails from an @apache.org address
+to a known list of recipients, or write the advisory text in a form
+suitable for publishing on http://subversion.apache.org/.
""")
parser.add_argument(
'command', action='store',
Modified: subversion/branches/ra-git/tools/dist/backport/merger.py
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dist/backport/merger.py?rev=1773992&r1=1773991&r2=1773992&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dist/backport/merger.py (original)
+++ subversion/branches/ra-git/tools/dist/backport/merger.py Tue Dec 13 12:36:55 2016
@@ -195,11 +195,8 @@ def merge(entry, expected_stderr=None, *
mergeargs.extend(['--', sf.trunk_url()])
logmsg += entry.raw
- # TODO(interactive mode): exclude STATUS from reverts
- # TODO(interactive mode): save local mods to disk, as backport.pl does
- run_revert()
+ no_local_mods('.')
- run_svn_quiet(['update'])
# TODO: use select() to restore interweaving of stdout/stderr
_, stdout, stderr = run_svn_quiet(['merge'] + mergeargs, expected_stderr)
sys.stdout.write(stdout)
Modified: subversion/branches/ra-git/tools/dist/detect-conflicting-backports.py
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dist/detect-conflicting-backports.py?rev=1773992&r1=1773991&r2=1773992&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dist/detect-conflicting-backports.py (original)
+++ subversion/branches/ra-git/tools/dist/detect-conflicting-backports.py Tue Dec 13 12:36:55 2016
@@ -77,6 +77,7 @@ ERRORS = collections.defaultdict(list)
for entry_para in sf.entries_paras():
entry = entry_para.entry()
# SVN_ERR_WC_FOUND_CONFLICT = 155015
+ backport.merger.run_svn_quiet(['update']) # TODO: what to do if this pulls in a STATUS mod?
backport.merger.merge(entry, 'svn: E155015' if entry.depends else None)
_, output, _ = backport.merger.run_svn(['status'])
Modified: subversion/branches/ra-git/tools/dist/merge-approved-backports.py
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dist/merge-approved-backports.py?rev=1773992&r1=1773991&r2=1773992&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dist/merge-approved-backports.py (original)
+++ subversion/branches/ra-git/tools/dist/merge-approved-backports.py Tue Dec 13 12:36:55 2016
@@ -40,11 +40,14 @@ if sys.argv[1:]:
sys.exit(0)
backport.merger.no_local_mods('./STATUS')
-sf = backport.status.StatusFile(open('./STATUS', encoding="UTF-8"))
-# Duplicate sf.paragraphs, since merge() will be removing elements from it.
-entries_paras = list(sf.entries_paras())
-for entry_para in entries_paras:
- if entry_para.approved():
- entry = entry_para.entry()
- backport.merger.merge(entry, commit=True)
+while True:
+ backport.merger.run_svn_quiet(['update'])
+ sf = backport.status.StatusFile(open('./STATUS', encoding="UTF-8"))
+ for entry_para in sf.entries_paras():
+ if entry_para.approved():
+ entry = entry_para.entry()
+ backport.merger.merge(entry, commit=True)
+ break # 'continue' the outer loop
+ else:
+ break
Modified: subversion/branches/ra-git/tools/server-side/mod_dontdothat/mod_dontdothat.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/server-side/mod_dontdothat/mod_dontdothat.c?rev=1773992&r1=1773991&r2=1773992&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/server-side/mod_dontdothat/mod_dontdothat.c (original)
+++ subversion/branches/ra-git/tools/server-side/mod_dontdothat/mod_dontdothat.c Tue Dec 13 12:36:55 2016
@@ -32,12 +32,11 @@
#include <apr_strings.h>
#include <apr_uri.h>
-#include <expat.h>
-
#include "mod_dav_svn.h"
#include "svn_string.h"
#include "svn_config.h"
#include "svn_path.h"
+#include "svn_xml.h"
#include "private/svn_fspath.h"
extern module AP_MODULE_DECLARE_DATA dontdothat_module;
@@ -87,7 +86,7 @@ typedef struct dontdothat_filter_ctx {
* stopped in its tracks. */
svn_boolean_t no_soup_for_you;
- XML_Parser xmlp;
+ svn_xml_parser_t *xmlp;
/* The current location in the REPORT body. */
parse_state_t state;
@@ -319,6 +318,7 @@ dontdothat_filter(ap_filter_t *f,
svn_boolean_t last = APR_BUCKET_IS_EOS(e);
const char *str;
apr_size_t len;
+ svn_error_t *err;
if (last)
{
@@ -332,12 +332,14 @@ dontdothat_filter(ap_filter_t *f,
return rv;
}
- if (! XML_Parse(ctx->xmlp, str, (int)len, last))
+ err = svn_xml_parse(ctx->xmlp, str, len, last);
+ if (err)
{
/* let_it_go so we clean up our parser, no_soup_for_you so that we
* bail out before bothering to parse this stuff a second time. */
ctx->let_it_go = TRUE;
ctx->no_soup_for_you = TRUE;
+ svn_error_clear(err);
}
/* If we found something that isn't allowed, set the correct status
@@ -386,8 +388,9 @@ dontdothat_filter(ap_filter_t *f,
return rv;
}
+/* Implements svn_xml_char_data callback */
static void
-cdata(void *baton, const char *data, int len)
+cdata(void *baton, const char *data, apr_size_t len)
{
dontdothat_filter_ctx *ctx = baton;
@@ -414,6 +417,7 @@ cdata(void *baton, const char *data, int
}
}
+/* Implements svn_xml_start_elem callback */
static void
start_element(void *baton, const char *name, const char **attrs)
{
@@ -479,6 +483,7 @@ start_element(void *baton, const char *n
}
}
+/* Implements svn_xml_end_elem callback */
static void
end_element(void *baton, const char *name)
{
@@ -610,16 +615,6 @@ config_enumerator(const char *wildcard,
return TRUE;
}
-static apr_status_t
-clean_up_parser(void *baton)
-{
- XML_Parser xmlp = baton;
-
- XML_ParserFree(xmlp);
-
- return APR_SUCCESS;
-}
-
static void
dontdothat_insert_filters(request_rec *r)
{
@@ -686,15 +681,8 @@ dontdothat_insert_filters(request_rec *r
ctx->state = STATE_BEGINNING;
- ctx->xmlp = XML_ParserCreate(NULL);
-
- apr_pool_cleanup_register(r->pool, ctx->xmlp,
- clean_up_parser,
- apr_pool_cleanup_null);
-
- XML_SetUserData(ctx->xmlp, ctx);
- XML_SetElementHandler(ctx->xmlp, start_element, end_element);
- XML_SetCharacterDataHandler(ctx->xmlp, cdata);
+ ctx->xmlp = svn_xml_make_parser(ctx, start_element, end_element,
+ cdata, r->pool);
ap_add_input_filter("DONTDOTHAT_FILTER", ctx, r, r->connection);
}