You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2012/04/03 21:17:02 UTC
svn commit: r1309099 [6/6] - in /subversion/branches/master-passphrase: ./
build/ build/generator/ build/generator/templates/
subversion/bindings/swig/perl/native/t/ subversion/include/
subversion/include/private/ subversion/libsvn_client/ subversion/l...
Modified: subversion/branches/master-passphrase/subversion/po/ja.po
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/po/ja.po?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/po/ja.po [UTF-8] (original)
+++ subversion/branches/master-passphrase/subversion/po/ja.po [UTF-8] Tue Apr 3 19:16:59 2012
@@ -6235,7 +6235,7 @@ msgstr ""
#. Human explanatory part, generated by apr_strftime as "Sat, 01 Jan 2000"
#: ../libsvn_subr/time.c:85
msgid " (%a, %d %b %Y)"
-msgstr " (%a, %d %b %Y)"
+msgstr " (%x (%a))"
#: ../libsvn_subr/token.c:66
#, fuzzy, c-format
Modified: subversion/branches/master-passphrase/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnrdump/load_editor.c?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/master-passphrase/subversion/svnrdump/load_editor.c Tue Apr 3 19:16:59 2012
@@ -384,6 +384,136 @@ lock_retry_func(void *baton,
reposlocktoken->data);
}
+
+static svn_error_t *
+fetch_base_func(const char **filename,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ struct revision_baton *rb = baton;
+ svn_stream_t *fstream;
+ svn_error_t *err;
+
+ if (svn_path_is_url(path))
+ path = svn_uri_skip_ancestor(rb->pb->root_url, path, scratch_pool);
+ else if (path[0] == '/')
+ path += 1;
+
+ if (! SVN_IS_VALID_REVNUM(base_revision))
+ base_revision = rb->rev - 1;
+
+ SVN_ERR(svn_stream_open_unique(&fstream, filename, NULL,
+ svn_io_file_del_on_pool_cleanup,
+ result_pool, scratch_pool));
+
+ err = svn_ra_get_file(rb->pb->aux_session, path, base_revision,
+ fstream, NULL, NULL, scratch_pool);
+ if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
+ {
+ svn_error_clear(err);
+ SVN_ERR(svn_stream_close(fstream));
+
+ *filename = NULL;
+ return SVN_NO_ERROR;
+ }
+ else if (err)
+ return svn_error_trace(err);
+
+ SVN_ERR(svn_stream_close(fstream));
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+fetch_props_func(apr_hash_t **props,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ struct revision_baton *rb = baton;
+ svn_node_kind_t node_kind;
+
+ if (svn_path_is_url(path))
+ path = svn_uri_skip_ancestor(rb->pb->root_url, path, scratch_pool);
+ else if (path[0] == '/')
+ path += 1;
+
+ if (! SVN_IS_VALID_REVNUM(base_revision))
+ base_revision = rb->rev - 1;
+
+ SVN_ERR(svn_ra_check_path(rb->pb->aux_session, path, base_revision,
+ &node_kind, scratch_pool));
+
+ if (node_kind == svn_node_file)
+ {
+ SVN_ERR(svn_ra_get_file(rb->pb->aux_session, path, base_revision,
+ NULL, NULL, props, result_pool));
+ }
+ else if (node_kind == svn_node_dir)
+ {
+ apr_array_header_t *tmp_props;
+
+ SVN_ERR(svn_ra_get_dir2(rb->pb->aux_session, NULL, NULL, props, path,
+ base_revision, 0 /* Dirent fields */,
+ result_pool));
+ tmp_props = svn_prop_hash_to_array(*props, result_pool);
+ SVN_ERR(svn_categorize_props(tmp_props, NULL, NULL, &tmp_props,
+ result_pool));
+ *props = svn_prop_array_to_hash(tmp_props, result_pool);
+ }
+ else
+ {
+ *props = apr_hash_make(result_pool);
+ }
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+fetch_kind_func(svn_kind_t *kind,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *scratch_pool)
+{
+ struct revision_baton *rb = baton;
+ svn_node_kind_t node_kind;
+
+ if (svn_path_is_url(path))
+ path = svn_uri_skip_ancestor(rb->pb->root_url, path, scratch_pool);
+ else if (path[0] == '/')
+ path += 1;
+
+ if (! SVN_IS_VALID_REVNUM(base_revision))
+ base_revision = rb->rev - 1;
+
+ SVN_ERR(svn_ra_check_path(rb->pb->aux_session, path, base_revision,
+ &node_kind, scratch_pool));
+
+ *kind = svn__kind_from_node_kind(node_kind, FALSE);
+ return SVN_NO_ERROR;
+}
+
+static svn_delta_shim_callbacks_t *
+get_shim_callbacks(struct revision_baton *rb,
+ apr_pool_t *pool)
+{
+ svn_delta_shim_callbacks_t *callbacks =
+ svn_delta_shim_callbacks_default(pool);
+
+ callbacks->fetch_props_func = fetch_props_func;
+ callbacks->fetch_kind_func = fetch_kind_func;
+ callbacks->fetch_base_func = fetch_base_func;
+ callbacks->fetch_baton = rb;
+
+ return callbacks;
+}
+
/* Acquire a lock (of sorts) on the repository associated with the
* given RA SESSION. This lock is just a revprop change attempt in a
* time-delay loop. This function is duplicated by svnsync in main.c.
@@ -518,6 +648,8 @@ new_node_record(void **node_baton,
apr_hash_set(rb->revprop_table, SVN_PROP_REVISION_DATE,
APR_HASH_KEY_STRING, NULL);
+ SVN_ERR(svn_ra__register_editor_shim_callbacks(rb->pb->session,
+ get_shim_callbacks(rb, rb->pool)));
SVN_ERR(svn_ra_get_commit_editor3(rb->pb->session, &commit_editor,
&commit_edit_baton, rb->revprop_table,
commit_callback, revision_baton,
Modified: subversion/branches/master-passphrase/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnserve/serve.c?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnserve/serve.c (original)
+++ subversion/branches/master-passphrase/subversion/svnserve/serve.c Tue Apr 3 19:16:59 2012
@@ -1470,9 +1470,9 @@ static svn_error_t *get_dir(svn_ra_svn_c
apr_array_header_t *params, void *baton)
{
server_baton_t *b = baton;
- const char *path, *full_path, *file_path, *cdate;
+ const char *path, *full_path;
svn_revnum_t rev;
- apr_hash_t *entries, *props = NULL, *file_props;
+ apr_hash_t *entries, *props = NULL;
apr_hash_index_t *hi;
svn_fs_root_t *root;
apr_pool_t *subpool;
@@ -1548,7 +1548,9 @@ static svn_error_t *get_dir(svn_ra_svn_c
/* Fetch the directory entries if requested and send them immediately. */
if (want_contents)
{
- const char *zero_date = svn_time_to_cstring(0, pool);
+ /* Use epoch for a placeholder for a missing date. */
+ const char *missing_date = svn_time_to_cstring(0, pool);
+
SVN_CMD_ERR(svn_fs_dir_entries(&entries, root, full_path, pool));
/* Transform the hash table's FS entries into dirents. This probably
@@ -1558,9 +1560,15 @@ static svn_error_t *get_dir(svn_ra_svn_c
{
const char *name = svn__apr_hash_index_key(hi);
svn_fs_dirent_t *fsent = svn__apr_hash_index_val(hi);
+ const char *file_path;
- svn_dirent_t entry;
- memset(&entry, 0, sizeof(entry));
+ /* The fields in the entry tuple. */
+ svn_node_kind_t entry_kind = svn_node_none;
+ svn_filesize_t entry_size = 0;
+ svn_boolean_t has_props = FALSE;
+ svn_revnum_t created_rev = 0; /* ### SVN_INVALID_REVNUM */
+ const char *cdate = NULL;
+ const char *last_author = NULL;
svn_pool_clear(subpool);
@@ -1570,44 +1578,49 @@ static svn_error_t *get_dir(svn_ra_svn_c
continue;
if (dirent_fields & SVN_DIRENT_KIND)
- entry.kind = fsent->kind;
+ entry_kind = fsent->kind;
if (dirent_fields & SVN_DIRENT_SIZE)
- if (entry.kind != svn_node_dir)
- SVN_CMD_ERR(svn_fs_file_length(&entry.size, root, file_path,
+ if (entry_kind != svn_node_dir)
+ SVN_CMD_ERR(svn_fs_file_length(&entry_size, root, file_path,
subpool));
if (dirent_fields & SVN_DIRENT_HAS_PROPS)
{
+ apr_hash_t *file_props;
+
/* has_props */
SVN_CMD_ERR(svn_fs_node_proplist(&file_props, root, file_path,
subpool));
- entry.has_props = (apr_hash_count(file_props) > 0);
+ has_props = (apr_hash_count(file_props) > 0);
}
- cdate = NULL;
if ((dirent_fields & SVN_DIRENT_LAST_AUTHOR)
|| (dirent_fields & SVN_DIRENT_TIME)
|| (dirent_fields & SVN_DIRENT_CREATED_REV))
{
/* created_rev, last_author, time */
- SVN_CMD_ERR(svn_repos_get_committed_info(&entry.created_rev,
+ SVN_CMD_ERR(svn_repos_get_committed_info(&created_rev,
&cdate,
- &entry.last_author,
+ &last_author,
root,
file_path,
subpool));
}
+ /* The client does not properly handle a missing CDATE. For
+ interoperability purposes, we must fill in some junk.
+
+ See libsvn_ra_svn/client.c:ra_svn_get_dir() */
if (cdate == NULL)
- cdate = zero_date;
+ cdate = missing_date;
/* Send the entry. */
SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "cwnbr(?c)(?c)", name,
- svn_node_kind_to_word(entry.kind),
- (apr_uint64_t) entry.size,
- entry.has_props, entry.created_rev,
- cdate, entry.last_author));
+ svn_node_kind_to_word(entry_kind),
+ (apr_uint64_t) entry_size,
+ has_props, created_rev,
+ cdate, last_author));
}
svn_pool_destroy(subpool);
}
Modified: subversion/branches/master-passphrase/subversion/svnsync/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnsync/main.c?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnsync/main.c (original)
+++ subversion/branches/master-passphrase/subversion/svnsync/main.c Tue Apr 3 19:16:59 2012
@@ -959,16 +959,21 @@ open_target_session(svn_ra_session_t **t
typedef struct replay_baton_t {
svn_ra_session_t *from_session;
svn_ra_session_t *to_session;
+ /* Extra 'backdoor' session for fetching data *from* the target repo. */
+ svn_ra_session_t *extra_to_session;
+ svn_revnum_t current_revision;
subcommand_baton_t *sb;
svn_boolean_t has_commit_revprops_capability;
int normalized_rev_props_count;
int normalized_node_props_count;
+ const char *to_root;
} replay_baton_t;
/* Return a replay baton allocated from POOL and populated with
data from the provided parameters. */
-static replay_baton_t *
-make_replay_baton(svn_ra_session_t *from_session,
+static svn_error_t *
+make_replay_baton(replay_baton_t **baton_p,
+ svn_ra_session_t *from_session,
svn_ra_session_t *to_session,
subcommand_baton_t *sb, apr_pool_t *pool)
{
@@ -976,7 +981,16 @@ make_replay_baton(svn_ra_session_t *from
rb->from_session = from_session;
rb->to_session = to_session;
rb->sb = sb;
- return rb;
+
+ SVN_ERR(svn_ra_get_repos_root2(to_session, &rb->to_root, pool));
+
+#ifdef ENABLE_EV2_SHIMS
+ /* Open up the extra baton. Only needed for Ev2 shims. */
+ SVN_ERR(open_target_session(&rb->extra_to_session, sb, pool));
+#endif
+
+ *baton_p = rb;
+ return SVN_NO_ERROR;
}
/* Return TRUE iff KEY is the name of an svn:date or svn:author or any svnsync
@@ -1030,6 +1044,137 @@ filter_include_log(const char *key)
}
+static svn_error_t *
+fetch_base_func(const char **filename,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ struct replay_baton_t *rb = baton;
+ svn_stream_t *fstream;
+ svn_error_t *err;
+
+ if (svn_path_is_url(path))
+ path = svn_uri_skip_ancestor(rb->to_root, path, scratch_pool);
+ else if (path[0] == '/')
+ path += 1;
+
+ if (! SVN_IS_VALID_REVNUM(base_revision))
+ base_revision = rb->current_revision - 1;
+
+ SVN_ERR(svn_stream_open_unique(&fstream, filename, NULL,
+ svn_io_file_del_on_pool_cleanup,
+ result_pool, scratch_pool));
+
+ err = svn_ra_get_file(rb->extra_to_session, path, base_revision,
+ fstream, NULL, NULL, scratch_pool);
+ if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
+ {
+ svn_error_clear(err);
+ SVN_ERR(svn_stream_close(fstream));
+
+ *filename = NULL;
+ return SVN_NO_ERROR;
+ }
+ else if (err)
+ return svn_error_trace(err);
+
+ SVN_ERR(svn_stream_close(fstream));
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+fetch_props_func(apr_hash_t **props,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ struct replay_baton_t *rb = baton;
+ svn_node_kind_t node_kind;
+
+ if (svn_path_is_url(path))
+ path = svn_uri_skip_ancestor(rb->to_root, path, scratch_pool);
+ else if (path[0] == '/')
+ path += 1;
+
+ if (! SVN_IS_VALID_REVNUM(base_revision))
+ base_revision = rb->current_revision - 1;
+
+ SVN_ERR(svn_ra_check_path(rb->extra_to_session, path, base_revision,
+ &node_kind, scratch_pool));
+
+ if (node_kind == svn_node_file)
+ {
+ SVN_ERR(svn_ra_get_file(rb->extra_to_session, path, base_revision,
+ NULL, NULL, props, result_pool));
+ }
+ else if (node_kind == svn_node_dir)
+ {
+ apr_array_header_t *tmp_props;
+
+ SVN_ERR(svn_ra_get_dir2(rb->extra_to_session, NULL, NULL, props, path,
+ base_revision, 0 /* Dirent fields */,
+ result_pool));
+ tmp_props = svn_prop_hash_to_array(*props, result_pool);
+ SVN_ERR(svn_categorize_props(tmp_props, NULL, NULL, &tmp_props,
+ result_pool));
+ *props = svn_prop_array_to_hash(tmp_props, result_pool);
+ }
+ else
+ {
+ *props = apr_hash_make(result_pool);
+ }
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+fetch_kind_func(svn_kind_t *kind,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *scratch_pool)
+{
+ struct replay_baton_t *rb = baton;
+ svn_node_kind_t node_kind;
+
+ if (svn_path_is_url(path))
+ path = svn_uri_skip_ancestor(rb->to_root, path, scratch_pool);
+ else if (path[0] == '/')
+ path += 1;
+
+ if (! SVN_IS_VALID_REVNUM(base_revision))
+ base_revision = rb->current_revision - 1;
+
+ SVN_ERR(svn_ra_check_path(rb->extra_to_session, path, base_revision,
+ &node_kind, scratch_pool));
+
+ *kind = svn__kind_from_node_kind(node_kind, FALSE);
+ return SVN_NO_ERROR;
+}
+
+
+static svn_delta_shim_callbacks_t *
+get_shim_callbacks(replay_baton_t *rb,
+ apr_pool_t *result_pool)
+{
+ svn_delta_shim_callbacks_t *callbacks =
+ svn_delta_shim_callbacks_default(result_pool);
+
+ callbacks->fetch_props_func = fetch_props_func;
+ callbacks->fetch_kind_func = fetch_kind_func;
+ callbacks->fetch_base_func = fetch_base_func;
+ callbacks->fetch_baton = rb;
+
+ return callbacks;
+}
+
+
/* Callback function for svn_ra_replay_range, invoked when starting to parse
* a replay report.
*/
@@ -1096,6 +1241,8 @@ replay_rev_started(svn_revnum_t revision
rb->sb->source_prop_encoding, pool));
rb->normalized_rev_props_count += normalized_count;
+ SVN_ERR(svn_ra__register_editor_shim_callbacks(rb->to_session,
+ get_shim_callbacks(rb, pool)));
SVN_ERR(svn_ra_get_commit_editor3(rb->to_session, &commit_editor,
&commit_baton,
filtered,
@@ -1118,6 +1265,7 @@ replay_rev_started(svn_revnum_t revision
*editor = cancel_editor;
*edit_baton = cancel_baton;
+ rb->current_revision = revision;
return SVN_NO_ERROR;
}
@@ -1311,7 +1459,7 @@ do_synchronize(svn_ra_session_t *to_sess
/* Ok, so there are new revisions, iterate over them copying them
into the destination repository. */
- rb = make_replay_baton(from_session, to_session, baton, pool);
+ SVN_ERR(make_replay_baton(&rb, from_session, to_session, baton, pool));
/* For compatibility with older svnserve versions, check first if we
support adding revprops to the commit. */
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/copy_tests.py?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/copy_tests.py Tue Apr 3 19:16:59 2012
@@ -5675,6 +5675,23 @@ def three_nested_moves(sbox):
expected_status,
None, wc_dir)
+def copy_to_unversioned_parent(sbox):
+ "copy to unversioned parent"
+
+ sbox.build()
+
+ # This succeeds
+ #svntest.actions.run_and_verify_svn(None, None, [], 'cp', '--parents',
+ # sbox.ospath('A/B'),
+ # sbox.ospath('New/B2'))
+
+ # And this currently fails with The node '.*Unversioned' was not found,
+ # while it should succeed or returns some error that a GUI client can use.
+ os.mkdir(sbox.ospath('Unversioned'))
+ svntest.actions.run_and_verify_svn(None, None, [], 'cp', '--parents',
+ sbox.ospath('A/B'),
+ sbox.ospath('Unversioned/B2'))
+
########################################################################
# Run the tests
@@ -5789,6 +5806,7 @@ test_list = [ None,
commit_deleted_half_of_move,
wc_wc_copy_incomplete,
three_nested_moves,
+ copy_to_unversioned_parent,
]
if __name__ == '__main__':
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/davautocheck.sh?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/davautocheck.sh Tue Apr 3 19:16:59 2012
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
#
#
# Licensed to the Apache Software Foundation (ASF) under one
@@ -74,37 +74,50 @@
# Passing --no-tests as argv[1] will have the script start a server
# but not run any tests.
+PYTHON=${PYTHON:-python}
+
SCRIPTDIR=$(dirname $0)
SCRIPT=$(basename $0)
-trap stop_httpd_and_die SIGHUP SIGTERM SIGINT
+trap stop_httpd_and_die HUP TERM INT
# Ensure the server uses a known locale.
LC_ALL=C
export LC_ALL
-function stop_httpd_and_die() {
+stop_httpd_and_die() {
[ -e "$HTTPD_PID" ] && kill $(cat "$HTTPD_PID")
exit 1
}
-function say() {
+say() {
echo "$SCRIPT: $*"
}
-function fail() {
+fail() {
say $*
stop_httpd_and_die
}
-function query() {
- echo -n "$SCRIPT: $1 (y/n)? [$2] "
- read -n 1 -t 32
+query() {
+ printf "%s" "$SCRIPT: $1 (y/n)? [$2] "
+ if [ -n "$BASH_VERSION" ]; then
+ read -n 1 -t 32
+ else
+ #
+ prog=$(cat) <<'EOF'
+import select as s
+import sys
+if s.select([sys.stdin.fileno()], [], [], 32)[0]:
+ sys.stdout.write(sys.stdin.read(1))
+EOF
+ REPLY=`stty cbreak; $PYTHON -c "$prog" "$@"; stty -cbreak`
+ fi
echo
[ "${REPLY:-$2}" = 'y' ]
}
-function get_loadmodule_config() {
+get_loadmodule_config() {
local SO="$($APXS -q LIBEXECDIR)/$1.so"
# shared object module?
@@ -121,7 +134,7 @@ function get_loadmodule_config() {
}
# Check apxs's SBINDIR and BINDIR for given program names
-function get_prog_name() {
+get_prog_name() {
for prog in $*
do
for dir in $($APXS -q SBINDIR) $($APXS -q BINDIR)
@@ -171,9 +184,7 @@ fi
# Find the source and build directories. The build dir can be found if it is
# the current working dir or the source dir.
-pushd ${SCRIPTDIR}/../../../ > /dev/null
-ABS_SRCDIR=$(pwd)
-popd > /dev/null
+ABS_SRCDIR=$(cd ${SCRIPTDIR}/../../../; pwd)
if [ -x subversion/svn/svn ]; then
ABS_BUILDDIR=$(pwd)
elif [ -x $ABS_SRCDIR/subversion/svn/svn ]; then
@@ -195,7 +206,8 @@ fi
[ -r "$MOD_AUTHZ_SVN" ] \
|| fail "authz_svn_module not found, please use '--enable-shared --enable-dso --with-apxs' with your 'configure' script"
-export LD_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs:$LD_LIBRARY_PATH"
+LD_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs:$LD_LIBRARY_PATH"
+export LD_LIBRARY_PATH
case "`uname`" in
Darwin*) LDD='otool -L'
@@ -256,7 +268,18 @@ LOAD_MOD_AUTHZ_USER="$(get_loadmodule_co
|| fail "Authz_User module not found."
}
-HTTPD_PORT=$(($RANDOM+1024))
+random_port() {
+ if [ -n "$BASH_VERSION" ]; then
+ echo $(($RANDOM+1024))
+ else
+ $PYTHON -c 'import random; print random.randint(1024, 2**16-1)'
+ fi
+}
+
+HTTPD_PORT=$(random_port)
+while netstat -an | grep $HTTPD_PORT | grep 'LISTEN'; do
+ HTTPD_PORT=$(random_port)
+done
HTTPD_ROOT="$ABS_BUILDDIR/subversion/tests/cmdline/httpd-$(date '+%Y%m%d-%H%M%S')"
HTTPD_CFG="$HTTPD_ROOT/cfg"
HTTPD_PID="$HTTPD_ROOT/pid"
@@ -424,12 +447,11 @@ if [ $# = 0 ]; then
time make check "BASE_URL=$BASE_URL"
r=$?
else
- pushd "$ABS_BUILDDIR/subversion/tests/cmdline/" >/dev/null
+ (cd "$ABS_BUILDDIR/subversion/tests/cmdline/"
TEST="$1"
shift
- time "$ABS_SRCDIR/subversion/tests/cmdline/${TEST}_tests.py" "--url=$BASE_URL" "$@"
+ time "$ABS_SRCDIR/subversion/tests/cmdline/${TEST}_tests.py" "--url=$BASE_URL" "$@")
r=$?
- popd >/dev/null
fi
say "Finished testing..."
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/log_tests.py?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/log_tests.py Tue Apr 3 19:16:59 2012
@@ -2217,6 +2217,78 @@ def log_xml_old(sbox):
expected_paths=paths)
+@XFail()
+@Issue(4153)
+def log_diff_moved(sbox):
+ "log --diff on moved file"
+
+ sbox.build()
+
+ sbox.simple_move('A/mu', 'A/mu2')
+ svntest.main.file_append(sbox.ospath('A/mu2'), "now mu2\n")
+ sbox.simple_commit()
+ sbox.simple_move('A/mu2', 'A/mu3')
+ svntest.main.file_append(sbox.ospath('A/mu3'), "now mu3\n")
+ sbox.simple_commit()
+
+ mu_at_1 = sbox.repo_url + '/A/mu@1'
+ mu3_at_3 = sbox.repo_url + '/A/mu3@3'
+
+ r1diff = [make_diff_header('A/mu', 'revision 0', 'revision 1')
+ + ["@@ -0,0 +1 @@\n",
+ "+This is the file 'mu'.\n"]]
+
+ # The mu2@2 and mu3@3 diffs show diffs relative to the copy source
+ r2diff = [make_diff_header('mu',
+ '.../mu)\t(revision 1',
+ '.../mu2)\t(revision 2')
+ + ["@@ -1 +1,2 @@\n",
+ " This is the file 'mu'.\n",
+ "+now mu2\n"]]
+
+ r3diff = [make_diff_header('mu2',
+ '.../mu2)\t(revision 2',
+ '.../mu3)\t(revision 3')
+ + ["@@ -1,2 +1,3 @@\n",
+ " This is the file 'mu'.\n",
+ " now mu2\n",
+ "+now mu3\n"]]
+
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ 'log', '--diff',
+ mu_at_1)
+ log_chain = parse_log_output(output, with_diffs=True)
+ if len(log_chain) != 1:
+ raise SVNLogParseError("%d logs found, 1 expected" % len(log_chain))
+ compare_diff_output(r1diff, log_chain[0]['diff_lines'])
+
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ 'log', '--diff',
+ '-r3', mu3_at_3)
+ log_chain = parse_log_output(output, with_diffs=True)
+ if len(log_chain) != 1:
+ raise SVNLogParseError("%d logs found, 1 expected" % len(log_chain))
+ compare_diff_output(r3diff, log_chain[0]['diff_lines'])
+
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ 'log', '--diff',
+ '-r3:2', mu3_at_3)
+ log_chain = parse_log_output(output, with_diffs=True)
+ if len(log_chain) != 2:
+ raise SVNLogParseError("%d logs found, 2 expected" % len(log_chain))
+ compare_diff_output(r3diff, log_chain[0]['diff_lines'])
+ compare_diff_output(r2diff, log_chain[1]['diff_lines'])
+
+ # XFAIL mu3 not found at revisions 0 and 1
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ 'log', '--diff',
+ mu3_at_3)
+ log_chain = parse_log_output(output, with_diffs=True)
+ if len(log_chain) != 3:
+ raise SVNLogParseError("%d logs found, 3 expected" % len(log_chain))
+ compare_diff_output(r3diff, log_chain[0]['diff_lines'])
+ compare_diff_output(r2diff, log_chain[1]['diff_lines'])
+ compare_diff_output(r1diff, log_chain[2]['diff_lines'])
########################################################################
# Run the tests
@@ -2260,6 +2332,7 @@ test_list = [ None,
merge_sensitive_log_copied_path_inherited_mergeinfo,
log_diff,
log_xml_old,
+ log_diff_moved,
]
if __name__ == '__main__':
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/merge_tests.py?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/merge_tests.py Tue Apr 3 19:16:59 2012
@@ -17471,7 +17471,6 @@ def merge_source_with_replacement(sbox):
# Test for issue #4144 'Reverse merge with replace in source applies
# diffs in forward order'.
@SkipUnless(server_has_mergeinfo)
-@XFail()
@Issue(4144)
def reverse_merge_with_rename(sbox):
"reverse merge applies revs in reverse order"
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svnadmin_tests.py?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svnadmin_tests.py Tue Apr 3 19:16:59 2012
@@ -694,7 +694,8 @@ _0.0.t1-1 add false false /A/B/E/bravo
svntest.verify.verify_outputs(
message=None, actual_stdout=output, actual_stderr=errput,
expected_stdout=None,
- expected_stderr=".*Found malformed header '[^']*' in revision file")
+ expected_stderr=".*Found malformed header '[^']*' in revision file"
+ "|.*Missing id field in node-rev.*")
#----------------------------------------------------------------------
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/sandbox.py?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/sandbox.py Tue Apr 3 19:16:59 2012
@@ -39,10 +39,16 @@ class Sandbox:
dependents = None
def __init__(self, module, idx):
+ self.test_paths = []
+
self._set_name("%s-%d" % (module, idx))
# This flag is set to True by build() and returned by is_built()
self._is_built = False
+ # Create an empty directory for temporary files
+ self.tmp_dir = self.add_wc_path('tmp', remove=True)
+ os.mkdir(self.tmp_dir)
+
def _set_name(self, name, read_only=False):
"""A convenience method for renaming a sandbox, useful when
working with multiple repositories in the same unit test."""
@@ -50,10 +56,12 @@ class Sandbox:
self.name = name
self.read_only = read_only
self.wc_dir = os.path.join(svntest.main.general_wc_dir, self.name)
+ self.add_test_path(self.wc_dir)
if not read_only:
self.repo_dir = os.path.join(svntest.main.general_repo_dir, self.name)
self.repo_url = (svntest.main.options.test_area_url + '/'
+ urllib.pathname2url(self.repo_dir))
+ self.add_test_path(self.repo_dir)
else:
self.repo_dir = svntest.main.pristine_greek_repos_dir
self.repo_url = svntest.main.pristine_greek_repos_url
@@ -77,8 +85,6 @@ class Sandbox:
elif self.repo_url.startswith("svn"):
self.authz_file = os.path.join(self.repo_dir, "conf", "authz")
- self.test_paths = [self.wc_dir, self.repo_dir]
-
def clone_dependent(self, copy_wc=False):
"""A convenience method for creating a near-duplicate of this
sandbox, useful when working with multiple repositories in the
@@ -151,13 +157,9 @@ class Sandbox:
"""Get a stable name for a temporary file that will be removed after
running the test"""
- dir = self.add_wc_path('tmp', remove=False)
- if not os.path.exists(dir):
- os.mkdir(dir)
-
self.tempname_offs = self.tempname_offs + 1
- return os.path.join(dir, '%s-%s' % (prefix, self.tempname_offs))
+ return os.path.join(self.tmp_dir, '%s-%s' % (prefix, self.tempname_offs))
def cleanup_test_paths(self):
"Clean up detritus from this sandbox, and any dependents."
Modified: subversion/branches/master-passphrase/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/libsvn_client/client-test.c?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/master-passphrase/subversion/tests/libsvn_client/client-test.c Tue Apr 3 19:16:59 2012
@@ -656,14 +656,14 @@ test_youngest_common_ancestor(const svn_
apr_pool_t *pool)
{
const char *repos_url;
+ const char *repos_uuid = "fake-uuid"; /* the functions we call don't care */
svn_client_ctx_t *ctx;
svn_opt_revision_t head_rev = { svn_opt_revision_head, { 0 } };
svn_opt_revision_t zero_rev = { svn_opt_revision_number, { 0 } };
svn_client_copy_source_t source;
apr_array_header_t *sources;
const char *dest;
- const char *yc_ancestor_relpath;
- svn_revnum_t yc_ancestor_rev;
+ svn_client__pathrev_t *yc_ancestor;
/* Create a filesytem and repository containing the Greek tree. */
SVN_ERR(create_greek_repos(&repos_url, "test-youngest-common-ancestor", opts, pool));
@@ -684,12 +684,15 @@ test_youngest_common_ancestor(const svn_
/* Test: YCA(iota@2, A/iota@2) is iota@1. */
SVN_ERR(svn_client__get_youngest_common_ancestor(
- &yc_ancestor_relpath, NULL, &yc_ancestor_rev,
- svn_path_url_add_component2(repos_url, "iota", pool), 2,
- svn_path_url_add_component2(repos_url, "A/iota", pool), 2,
- ctx, pool));
- SVN_TEST_STRING_ASSERT(yc_ancestor_relpath, "iota");
- SVN_TEST_ASSERT(yc_ancestor_rev == 1);
+ &yc_ancestor,
+ svn_client__pathrev_create_with_relpath(
+ repos_url, repos_uuid, 2, "iota", pool),
+ svn_client__pathrev_create_with_relpath(
+ repos_url, repos_uuid, 2, "A/iota", pool),
+ ctx, pool, pool));
+ SVN_TEST_STRING_ASSERT(svn_client__pathrev_relpath(yc_ancestor, pool),
+ "iota");
+ SVN_TEST_ASSERT(yc_ancestor->rev == 1);
/* Copy the root directory (at revision 0) into A as 'ROOT'. */
sources = apr_array_make(pool, 1, sizeof(svn_client_copy_source_t *));
@@ -705,12 +708,14 @@ test_youngest_common_ancestor(const svn_
/* Test: YCA(''@0, A/ROOT@3) is ''@0 (handled as a special case). */
SVN_ERR(svn_client__get_youngest_common_ancestor(
- &yc_ancestor_relpath, NULL, &yc_ancestor_rev,
- svn_path_url_add_component2(repos_url, "", pool), 0,
- svn_path_url_add_component2(repos_url, "A/ROOT", pool), 3,
- ctx, pool));
- SVN_TEST_STRING_ASSERT(yc_ancestor_relpath, "");
- SVN_TEST_ASSERT(yc_ancestor_rev == 0);
+ &yc_ancestor,
+ svn_client__pathrev_create_with_relpath(
+ repos_url, repos_uuid, 0, "", pool),
+ svn_client__pathrev_create_with_relpath(
+ repos_url, repos_uuid, 3, "A/ROOT", pool),
+ ctx, pool, pool));
+ SVN_TEST_STRING_ASSERT(svn_client__pathrev_relpath(yc_ancestor, pool), "");
+ SVN_TEST_ASSERT(yc_ancestor->rev == 0);
return SVN_NO_ERROR;
}
Modified: subversion/branches/master-passphrase/subversion/tests/libsvn_delta/random-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/libsvn_delta/random-test.c?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/libsvn_delta/random-test.c (original)
+++ subversion/branches/master-passphrase/subversion/tests/libsvn_delta/random-test.c Tue Apr 3 19:16:59 2012
@@ -57,7 +57,7 @@ static void init_params(apr_uint32_t *se
apr_uint32_t *maxlen, int *iterations,
int *dump_files, int *print_windows,
const char **random_bytes,
- apr_uint32_t *bytes_range,
+ apr_size_t *bytes_range,
apr_pool_t *pool)
{
apr_getopt_t *opt;
@@ -80,7 +80,7 @@ static void init_params(apr_uint32_t *se
switch (optch)
{
case 's':
- *seed = atol(opt_arg);
+ *seed = (apr_uint32_t) atol(opt_arg);
break;
case 'l':
*maxlen = atoi(opt_arg);
@@ -160,7 +160,7 @@ generate_random_file(apr_uint32_t maxlen
apr_uint32_t subseed_base,
apr_uint32_t *seed,
const char *random_bytes,
- apr_uint32_t bytes_range,
+ apr_size_t bytes_range,
int dump_files,
apr_pool_t *pool)
{
@@ -287,7 +287,8 @@ copy_tempfile(apr_file_t *fp, apr_pool_t
static svn_error_t *
random_test(apr_pool_t *pool)
{
- apr_uint32_t seed, bytes_range, maxlen;
+ apr_uint32_t seed, maxlen;
+ apr_size_t bytes_range;
int i, iterations, dump_files, print_windows;
const char *random_bytes;
@@ -365,7 +366,8 @@ static svn_error_t *
do_random_combine_test(apr_pool_t *pool,
apr_uint32_t *last_seed)
{
- apr_uint32_t seed, bytes_range, maxlen;
+ apr_uint32_t seed, maxlen;
+ apr_size_t bytes_range;
int i, iterations, dump_files, print_windows;
const char *random_bytes;
Propchange: subversion/branches/master-passphrase/subversion/tests/libsvn_subr/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Apr 3 19:16:59 2012
@@ -11,6 +11,7 @@ Release
checksum-test
compat-test
config-test
+crypto-test
error-test
hashdump-test
hashdump.out
Modified: subversion/branches/master-passphrase/subversion/tests/libsvn_subr/cache-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/libsvn_subr/cache-test.c?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/libsvn_subr/cache-test.c (original)
+++ subversion/branches/master-passphrase/subversion/tests/libsvn_subr/cache-test.c Tue Apr 3 19:16:59 2012
@@ -36,7 +36,7 @@
/* Implements svn_cache__serialize_func_t */
static svn_error_t *
-serialize_revnum(char **data,
+serialize_revnum(void **data,
apr_size_t *data_len,
void *in,
apr_pool_t *pool)
@@ -51,7 +51,7 @@ serialize_revnum(char **data,
/* Implements svn_cache__deserialize_func_t */
static svn_error_t *
deserialize_revnum(void **out,
- char *data,
+ void *data,
apr_size_t data_len,
apr_pool_t *pool)
{
Modified: subversion/branches/master-passphrase/subversion/tests/libsvn_subr/spillbuf-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/libsvn_subr/spillbuf-test.c?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/libsvn_subr/spillbuf-test.c (original)
+++ subversion/branches/master-passphrase/subversion/tests/libsvn_subr/spillbuf-test.c Tue Apr 3 19:16:59 2012
@@ -33,42 +33,55 @@ static const char basic_data[] = ("abcde
"0123456789");
+/* Validate that BUF is STARTING_SIZE in length. Then read some data from
+ the buffer, which should match EXPECTED. The EXPECTED value must be
+ NUL-terminated, but the NUL is not part of the expected/verified value. */
+#define CHECK_READ(b, s, e, p) SVN_ERR(check_read(b, s, e, p))
+static svn_error_t *
+check_read(svn_spillbuf_t *buf,
+ svn_filesize_t starting_size,
+ const char *expected,
+ apr_pool_t *scratch_pool)
+{
+ apr_size_t expected_len = strlen(expected);
+ const char *readptr;
+ apr_size_t readlen;
+
+ SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) == starting_size);
+ SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, scratch_pool));
+ SVN_TEST_ASSERT(readptr != NULL
+ && readlen == expected_len
+ && memcmp(readptr, expected, expected_len) == 0);
+ return SVN_NO_ERROR;
+}
+
+
static svn_error_t *
test_spillbuf_basic(apr_pool_t *pool)
{
- svn_spillbuf_t *buf = svn_spillbuf__create(
- sizeof(basic_data) /* blocksize */,
- 10 * sizeof(basic_data) /* maxsize */,
- pool);
+ apr_size_t len = strlen(basic_data); /* Don't include basic_data's NUL */
+ svn_spillbuf_t *buf = svn_spillbuf__create(len, 10 * len, pool);
int i;
+ const char *readptr;
+ apr_size_t readlen;
/* It starts empty. */
SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) == 0);
/* Place enough data into the buffer to cause a spill to disk. */
for (i = 20; i--; )
- SVN_ERR(svn_spillbuf__write(buf, basic_data, sizeof(basic_data), pool));
+ SVN_ERR(svn_spillbuf__write(buf, basic_data, len, pool));
/* And now has content. */
SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) > 0);
- while (TRUE)
- {
- const char *readptr;
- apr_size_t readlen;
-
- SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
- if (readptr == NULL)
- break;
-
- /* We happen to know that the spill buffer reads data in lengths
- of BLOCKSIZE. */
- SVN_TEST_ASSERT(readlen == sizeof(basic_data));
-
- /* And it should match each block of data we put in. */
- SVN_TEST_ASSERT(memcmp(readptr, basic_data, readlen) == 0);
- }
+ /* Verify that we can read 20 copies of basic_data from the buffer. */
+ for (i = 20; i--; )
+ CHECK_READ(buf, (i + 1) * len, basic_data, pool);
+ /* And after precisely 20 reads, it should be empty. */
+ SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
+ SVN_TEST_ASSERT(readptr == NULL);
SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) == 0);
return SVN_NO_ERROR;
@@ -197,48 +210,29 @@ test_spillbuf_interleaving(apr_pool_t *p
svn_spillbuf_t *buf = svn_spillbuf__create(8 /* blocksize */,
15 /* maxsize */,
pool);
- const char *readptr;
- apr_size_t readlen;
SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
- /* now: two blocks of 8 and 4 bytes */
+ /* now: two blocks: 8 and 4 bytes */
- SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
- SVN_TEST_ASSERT(readptr != NULL
- && readlen == 8
- && memcmp(readptr, "abcdefgh", 8) == 0);
- /* now: one block of 4 bytes */
+ CHECK_READ(buf, 12, "abcdefgh", pool);
+ /* now: one block: 4 bytes */
SVN_ERR(svn_spillbuf__write(buf, "mnopqr", 6, pool));
- /* now: two blocks of 8 and 2 bytes */
+ /* now: two blocks: 8 and 2 bytes */
- SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
- SVN_TEST_ASSERT(readptr != NULL
- && readlen == 8
- && memcmp(readptr, "ijklmnop", 8) == 0);
- /* now: one block of 2 bytes */
+ CHECK_READ(buf, 10, "ijklmnop", pool);
+ /* now: one block: 2 bytes */
SVN_ERR(svn_spillbuf__write(buf, "stuvwx", 6, pool));
SVN_ERR(svn_spillbuf__write(buf, "ABCDEF", 6, pool));
SVN_ERR(svn_spillbuf__write(buf, "GHIJKL", 6, pool));
- /* now: two blocks of 8 and 6 bytes, and 6 bytes spilled to a file */
+ /* now: two blocks: 8 and 6 bytes, and 6 bytes spilled to a file */
+
+ CHECK_READ(buf, 20, "qrstuvwx", pool);
+ CHECK_READ(buf, 12, "ABCDEF", pool);
+ CHECK_READ(buf, 6, "GHIJKL", pool);
- SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) > 0);
- SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
- SVN_TEST_ASSERT(readptr != NULL
- && readlen == 8
- && memcmp(readptr, "qrstuvwx", 8) == 0);
- SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) > 0);
- SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
- SVN_TEST_ASSERT(readptr != NULL
- && readlen == 6
- && memcmp(readptr, "ABCDEF", 6) == 0);
- SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) > 0);
- SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
- SVN_TEST_ASSERT(readptr != NULL
- && readlen == 6
- && memcmp(readptr, "GHIJKL", 6) == 0);
SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) == 0);
return SVN_NO_ERROR;
@@ -290,26 +284,26 @@ test_spillbuf_stream(apr_pool_t *pool)
writelen = 6;
SVN_ERR(svn_stream_write(stream, "abcdef", &writelen));
SVN_ERR(svn_stream_write(stream, "ghijkl", &writelen));
- /* now: two blocks of 8 and 4 bytes */
+ /* now: two blocks: 8 and 4 bytes */
readlen = 8;
SVN_ERR(svn_stream_read(stream, readbuf, &readlen));
SVN_TEST_ASSERT(readlen == 8
&& memcmp(readbuf, "abcdefgh", 8) == 0);
- /* now: one block of 4 bytes */
+ /* now: one block: 4 bytes */
SVN_ERR(svn_stream_write(stream, "mnopqr", &writelen));
- /* now: two blocks of 8 and 2 bytes */
+ /* now: two blocks: 8 and 2 bytes */
SVN_ERR(svn_stream_read(stream, readbuf, &readlen));
SVN_TEST_ASSERT(readlen == 8
&& memcmp(readbuf, "ijklmnop", 8) == 0);
- /* now: one block of 2 bytes */
+ /* now: one block: 2 bytes */
SVN_ERR(svn_stream_write(stream, "stuvwx", &writelen));
SVN_ERR(svn_stream_write(stream, "ABCDEF", &writelen));
SVN_ERR(svn_stream_write(stream, "GHIJKL", &writelen));
- /* now: two blocks of 8 and 6 bytes, and 6 bytes spilled to a file */
+ /* now: two blocks: 8 and 6 bytes, and 6 bytes spilled to a file */
SVN_ERR(svn_stream_read(stream, readbuf, &readlen));
SVN_TEST_ASSERT(readlen == 8
@@ -326,6 +320,102 @@ test_spillbuf_stream(apr_pool_t *pool)
}
+static svn_error_t *
+test_spillbuf_rwfile(apr_pool_t *pool)
+{
+ svn_spillbuf_t *buf = svn_spillbuf__create(4 /* blocksize */,
+ 10 /* maxsize */,
+ pool);
+
+ SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
+ SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
+ SVN_ERR(svn_spillbuf__write(buf, "mnopqr", 6, pool));
+ /* now: two blocks: 4 and 2 bytes, and 12 bytes in spill file. */
+
+ CHECK_READ(buf, 18, "abcd", pool);
+ /* now: one block: 2 bytes, and 12 bytes in spill file. */
+
+ CHECK_READ(buf, 14, "ef", pool);
+ /* now: no blocks, and 12 bytes in spill file. */
+
+ CHECK_READ(buf, 12, "ghij", pool);
+ /* now: no blocks, and 8 bytes in spill file. */
+
+ /* Write more data. It should be appended to the spill file. */
+ SVN_ERR(svn_spillbuf__write(buf, "stuvwx", 6, pool));
+ /* now: no blocks, and 14 bytes in spill file. */
+
+ CHECK_READ(buf, 14, "klmn", pool);
+ /* now: no blocks, and 10 bytes in spill file. */
+
+ CHECK_READ(buf, 10, "opqr", pool);
+ /* now: no blocks, and 6 bytes in spill file. */
+
+ CHECK_READ(buf, 6, "stuv", pool);
+ /* now: no blocks, and 2 bytes in spill file. */
+
+ CHECK_READ(buf, 2, "wx", pool);
+ /* now: no blocks, and no spill file. */
+
+ return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
+test_spillbuf_eof(apr_pool_t *pool)
+{
+ svn_spillbuf_t *buf = svn_spillbuf__create(4 /* blocksize */,
+ 10 /* maxsize */,
+ pool);
+
+ SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
+ SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
+ /* now: two blocks: 4 and 2 bytes, and 6 bytes in spill file. */
+
+ CHECK_READ(buf, 12, "abcd", pool);
+ CHECK_READ(buf, 8, "ef", pool);
+ CHECK_READ(buf, 6, "ghij", pool);
+ CHECK_READ(buf, 2, "kl", pool);
+ /* The spill file should have been emptied and forgotten. */
+
+ /* Assuming the spill file has been forgotten, this should result in
+ precisely the same behavior. Specifically: the initial write should
+ create two blocks, and the second write should be spilled. If there
+ *was* a spill file, then this written data would go into the file. */
+ SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
+ SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
+ CHECK_READ(buf, 12, "abcd", pool);
+ CHECK_READ(buf, 8, "ef", pool);
+ CHECK_READ(buf, 6, "ghij", pool);
+ CHECK_READ(buf, 2, "kl", pool);
+ /* The spill file should have been emptied and forgotten. */
+
+ /* Now, let's do a sequence where we arrange to hit EOF precisely on
+ a block-sized read. Note: the second write must be more than 4 bytes,
+ or it will not cause a spill. We use 8 to get the right boundary. */
+ SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
+ SVN_ERR(svn_spillbuf__write(buf, "ghijklmn", 8, pool));
+ CHECK_READ(buf, 14, "abcd", pool);
+ CHECK_READ(buf, 10, "ef", pool);
+ CHECK_READ(buf, 8, "ghij", pool);
+ CHECK_READ(buf, 4, "klmn", pool);
+ /* We discard the spill file when we know it has no data, rather than
+ upon hitting EOF (upon a read attempt). Thus, the spill file should
+ be gone. */
+
+ /* Verify the forgotten spill file. */
+ SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
+ SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
+ CHECK_READ(buf, 12, "abcd", pool);
+ CHECK_READ(buf, 8, "ef", pool);
+ CHECK_READ(buf, 6, "ghij", pool);
+ /* Two unread bytes remaining in the spill file. */
+ SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) == 2);
+
+ return SVN_NO_ERROR;
+}
+
+
/* The test table. */
struct svn_test_descriptor_t test_funcs[] =
{
@@ -337,5 +427,7 @@ struct svn_test_descriptor_t test_funcs[
"interleaving reads and writes"),
SVN_TEST_PASS2(test_spillbuf_reader, "spill buffer reader test"),
SVN_TEST_PASS2(test_spillbuf_stream, "spill buffer stream test"),
+ SVN_TEST_PASS2(test_spillbuf_rwfile, "read/write spill file"),
+ SVN_TEST_PASS2(test_spillbuf_eof, "validate reaching EOF of spill file"),
SVN_TEST_NULL
};
Modified: subversion/branches/master-passphrase/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/libsvn_wc/op-depth-test.c?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/master-passphrase/subversion/tests/libsvn_wc/op-depth-test.c Tue Apr 3 19:16:59 2012
@@ -342,12 +342,12 @@ print_row(const nodes_row_t *row,
return "(null)";
if (row->moved_to)
- moved_to_str = apr_psprintf(result_pool, ", to %s", row->moved_to);
+ moved_to_str = apr_psprintf(result_pool, ", moved-to %s", row->moved_to);
else
moved_to_str = "";
if (row->moved_here)
- moved_here_str = ", here";
+ moved_here_str = ", moved-here";
else
moved_here_str = "";
@@ -362,8 +362,9 @@ print_row(const nodes_row_t *row,
moved_here_str, moved_to_str,
file_external_str);
else
- return apr_psprintf(result_pool, "%d, %s, %s, from ^/%s@%d%s%s%s",
+ return apr_psprintf(result_pool, "%d, %s, %s, %s ^/%s@%d%s%s%s",
row->op_depth, row->local_relpath, row->presence,
+ row->op_depth == 0 ? "base" : "copyfrom",
row->repo_relpath, (int)row->repo_revnum,
moved_here_str, moved_to_str,
file_external_str);
@@ -4495,7 +4496,7 @@ move_added(const svn_test_opts_t *opts,
{1, "A/B", "base-deleted", NO_COPY_FROM},
{1, "A2", "normal", 1, "A", MOVED_HERE},
{1, "A2/B", "normal", 1, "A/B", MOVED_HERE},
- {3, "A2/B/C", "normal", NO_COPY_FROM}, /* XFAIL */
+ {3, "A2/B/C", "normal", NO_COPY_FROM},
{3, "A2/B/C2", "normal", NO_COPY_FROM},
{0}
};
@@ -4665,7 +4666,7 @@ struct svn_test_descriptor_t test_funcs[
"move_on_move"),
SVN_TEST_OPTS_PASS(move_on_move2,
"move_on_move2"),
- SVN_TEST_OPTS_XFAIL(move_added,
+ SVN_TEST_OPTS_PASS(move_added,
"move_added"),
SVN_TEST_OPTS_XFAIL(move_update,
"move_update"),
Modified: subversion/branches/master-passphrase/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd (original)
+++ subversion/branches/master-passphrase/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd Tue Apr 3 19:16:59 2012
@@ -72,7 +72,7 @@ pushd subversion\bindings\swig\perl\nati
perl -MExtUtils::Command::MM -e test_harness() t\*.t
IF ERRORLEVEL 1 (
echo [Perl reported error %ERRORLEVEL%]
- REM SET result=1
+ SET result=1
)
popd
Modified: subversion/branches/master-passphrase/tools/client-side/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/client-side/svnmucc/svnmucc.c?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/client-side/svnmucc/svnmucc.c (original)
+++ subversion/branches/master-passphrase/tools/client-side/svnmucc/svnmucc.c Tue Apr 3 19:16:59 2012
@@ -52,7 +52,9 @@
#include "svn_subst.h"
#include "svn_utf.h"
#include "svn_version.h"
+
#include "private/svn_cmdline_private.h"
+#include "private/svn_ra_private.h"
static void handle_error(svn_error_t *err, apr_pool_t *pool)
{
@@ -611,6 +613,54 @@ struct action {
};
static svn_error_t *
+fetch_base_func(const char **filename,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ *filename = NULL;
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+fetch_props_func(apr_hash_t **props,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ *props = apr_hash_make(result_pool);
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+fetch_kind_func(svn_kind_t *kind,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *scratch_pool)
+{
+ *kind = svn_kind_unknown;
+ return SVN_NO_ERROR;
+}
+
+static svn_delta_shim_callbacks_t *
+get_shim_callbacks(apr_pool_t *result_pool)
+{
+ svn_delta_shim_callbacks_t *callbacks =
+ svn_delta_shim_callbacks_default(result_pool);
+
+ callbacks->fetch_props_func = fetch_props_func;
+ callbacks->fetch_kind_func = fetch_kind_func;
+ callbacks->fetch_base_func = fetch_base_func;
+
+ return callbacks;
+}
+
+static svn_error_t *
execute(const apr_array_header_t *actions,
const char *anchor,
apr_hash_t *revprops,
@@ -713,6 +763,8 @@ execute(const apr_array_header_t *action
}
}
+ SVN_ERR(svn_ra__register_editor_shim_callbacks(session,
+ get_shim_callbacks(pool)));
SVN_ERR(svn_ra_get_commit_editor3(session, &editor, &editor_baton, revprops,
commit_callback, NULL, NULL, FALSE, pool));
Modified: subversion/branches/master-passphrase/tools/dev/gdb-py/svndbg/printers.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/dev/gdb-py/svndbg/printers.py?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/dev/gdb-py/svndbg/printers.py (original)
+++ subversion/branches/master-passphrase/tools/dev/gdb-py/svndbg/printers.py Tue Apr 3 19:16:59 2012
@@ -24,8 +24,168 @@ import gdb
import re
import gdb.printing
+from gdb.printing import RegexpCollectionPrettyPrinter
+class TypedefRegexCollectionPrettyPrinter(RegexpCollectionPrettyPrinter):
+ """Class for implementing a collection of regular-expression based
+ pretty-printers, matching on the type name at the point of use, such
+ as (but not necessarily) a 'typedef' name, ignoring 'const' or
+ 'volatile' qualifiers.
+
+ This is modeled on RegexpCollectionPrettyPrinter, which (in GDB 7.3)
+ matches on the base type's tag name and can't match a pointer type or
+ any other type that doesn't have a tag name."""
+
+ def __init__(self, name):
+ super(TypedefRegexCollectionPrettyPrinter, self).__init__(name)
+
+ def __call__(self, val):
+ """Lookup the pretty-printer for the provided value."""
+
+ # Get the type name, without 'const' or 'volatile' qualifiers.
+ typename = str(val.type.unqualified())
+ if not typename:
+ return None
+
+ # Iterate over table of type regexps to find an enabled printer for
+ # that type. Return an instantiation of the printer if found.
+ for printer in self.subprinters:
+ if printer.enabled and printer.compiled_re.search(typename):
+ return printer.gen_printer(val)
+
+ # Cannot find a pretty printer. Return None.
+ return None
+
+class InferiorFunction:
+ """A class whose instances are callable functions on the inferior
+ process."""
+ def __init__(self, function_name):
+ self.function_name = function_name
+ self.func = None
+
+ def __call__(self, *args):
+ if not self.func:
+ self.func = gdb.parse_and_eval(self.function_name)
+ return self.func(*args)
+
+def children_as_map(children_iterator):
+ """Convert an iteration of (key, value) pairs into the form required for
+ a pretty-printer 'children' method when the display-hint is 'map'."""
+ for k, v in children_iterator:
+ yield 'key', k
+ yield 'val', v
+
+
+########################################################################
+
+# Pretty-printing for APR library types.
+
+# Some useful gdb.Type instances that can be initialized before any object
+# files are loaded.
+pvoidType = gdb.lookup_type('void').pointer()
+cstringType = gdb.lookup_type('char').pointer()
+
+# Some functions that resolve to calls into the inferior process.
+apr_hash_count = InferiorFunction('apr_hash_count')
+apr_hash_first = InferiorFunction('apr_hash_first')
+apr_hash_next = InferiorFunction('apr_hash_next')
+svn__apr_hash_index_key = InferiorFunction('svn__apr_hash_index_key')
+svn__apr_hash_index_val = InferiorFunction('svn__apr_hash_index_val')
+
+def children_of_apr_hash(hash_p, value_type=None):
+ """Iterate over an 'apr_hash_t *' GDB value, in the way required for a
+ pretty-printer 'children' method when the display-hint is 'array'.
+ Cast the value pointers to VALUE_TYPE, or return values as '...' if
+ VALUE_TYPE is None."""
+ hi = apr_hash_first(0, hash_p)
+ while (hi):
+ k = svn__apr_hash_index_key(hi).reinterpret_cast(cstringType)
+ if value_type:
+ val = svn__apr_hash_index_val(hi).reinterpret_cast(value_type)
+ else:
+ val = '...'
+ try:
+ key = k.string()
+ except:
+ key = '<unreadable>'
+ yield key, val
+ hi = apr_hash_next(hi)
+
+class AprHashPrinter:
+ """for 'apr_hash_t' of 'char *' keys and unknown values"""
+ def __init__(self, val):
+ self.hash_p = val.address
+
+ def to_string(self):
+ """Return a string to be displayed before children are displayed, or
+ return None if we don't want any such."""
+ return 'hash of ' + str(apr_hash_count(self.hash_p)) + ' items'
+
+ def children(self):
+ if not self.hash_p:
+ return []
+ return children_as_map(children_of_apr_hash(self.hash_p))
+
+ def display_hint(self):
+ return 'map'
+
+class PtrAprHashPrinter(AprHashPrinter):
+ """for pointer to 'apr_hash_t' of 'char *' keys and unknown values"""
+ def __init__(self, val):
+ self.hash_p = val
+
+ def to_string(self):
+ if not self.hash_p:
+ return 'NULL'
+ return AprHashPrinter.to_string(self)
+
+ def children(self):
+ if not self.hash_p:
+ return []
+ return AprHashPrinter.children(self)
+
+class AprArrayPrinter:
+ """for 'apr_array_header_t' of unknown elements"""
+ def __init__(self, val):
+ self.array = val
+
+ def to_string(self):
+ if not self.array:
+ return 'NULL'
+ nelts = self.array['nelts']
+ return 'array of ' + str(int(nelts)) + ' items'
+
+ def children(self):
+ # We can't display the children as we don't know their type.
+ return []
+
+ def display_hint(self):
+ return 'array'
+
+class PtrAprArrayPrinter(AprArrayPrinter):
+ """for pointer to 'apr_array_header_t' of unknown elements"""
+ def __init__(self, val):
+ if not val:
+ self.array = None
+ else:
+ self.array = val.dereference()
+
+ def to_string(self):
+ if not self.array:
+ return 'NULL'
+ return AprArrayPrinter.to_string(self)
+
+ def children(self):
+ if not self.array:
+ return []
+ return AprArrayPrinter.children(self)
+
+
+########################################################################
+
+# Pretty-printing for Subversion library types.
+
class SvnStringPrinter:
def __init__(self, val):
self.val = val
@@ -42,22 +202,86 @@ class SvnStringPrinter:
def display_hint(self):
return 'string'
+class SvnMergeinfoCatalogPrinter:
+ """for svn_mergeinfo_catalog_t"""
+ def __init__(self, val):
+ self.hash_p = val
+
+ def to_string(self):
+ if self.hash_p == 0:
+ return 'NULL'
+ return 'mergeinfo catalog of ' + str(apr_hash_count(self.hash_p)) + ' items'
+
+ def children(self):
+ if self.hash_p == 0:
+ return None
+ mergeinfoType = gdb.lookup_type('svn_mergeinfo_t')
+ return children_as_map(children_of_apr_hash(self.hash_p, mergeinfoType))
+
+ def display_hint(self):
+ return 'map'
-def build_libsvn_printer():
- global libsvn_printer
- libsvn_printer = gdb.printing.RegexpCollectionPrettyPrinter("libsvn")
+########################################################################
+
+libapr_printer = None
+libapr_printer2 = None
+libsvn_printer = None
+libsvn_printer2 = None
- libsvn_printer.add_printer('svn_string_t', '^svn_string_t$',
+def build_libsvn_printers():
+ """Construct the pretty-printer objects."""
+
+ global libapr_printer, libapr_printer2, libsvn_printer, libsvn_printer2
+
+ # These sub-printers match a struct's (or union)'s tag name,
+ # after stripping typedefs, references and const/volatile qualifiers.
+ libapr_printer = RegexpCollectionPrettyPrinter("libapr")
+ libapr_printer.add_printer('apr_hash_t', r'^apr_hash_t$',
+ AprHashPrinter)
+ libapr_printer.add_printer('apr_array_header_t', r'^apr_array_header_t$',
+ AprArrayPrinter)
+
+ # These sub-printers match a type name at the point of use,
+ # after stripping const/volatile qualifiers.
+ #
+ # TODO: The "apr_foo_t *" entries are in this collection merely because
+ # the collection above can't match them, but ideally we'd fix that
+ # matching and move these entries to there so that they get used
+ # for any typedef that doesn't have its own specific pretty-printer
+ # registered.
+ libapr_printer2 = TypedefRegexCollectionPrettyPrinter("libapr2")
+ libapr_printer2.add_printer('apr_hash_t *', r'^apr_hash_t \*$',
+ PtrAprHashPrinter)
+ libapr_printer2.add_printer('apr_array_header_t *', r'^apr_array_header_t \*$',
+ PtrAprArrayPrinter)
+
+ # These sub-printers match a struct's (or union)'s tag name,
+ # after stripping typedefs, references and const/volatile qualifiers.
+ libsvn_printer = RegexpCollectionPrettyPrinter("libsvn")
+ libsvn_printer.add_printer('svn_string_t', r'^svn_string_t$',
SvnStringPrinter)
+ # These sub-printers match a type name at the point of use,
+ # after stripping const/volatile qualifiers.
+ libsvn_printer2 = TypedefRegexCollectionPrettyPrinter("libsvn2")
+ libsvn_printer2.add_printer('svn_mergeinfo_catalog_t', r'^svn_mergeinfo_catalog_t$',
+ SvnMergeinfoCatalogPrinter)
-libsvn_printer = None
def register_libsvn_printers(obj):
- global libsvn_printer
+ """Register the pretty-printers for the object file OBJ."""
+
+ global libapr_printer, libapr_printer2, libsvn_printer, libsvn_printer2
+ # Printers registered later take precedence.
+ gdb.printing.register_pretty_printer(obj, libapr_printer)
+ gdb.printing.register_pretty_printer(obj, libapr_printer2)
gdb.printing.register_pretty_printer(obj, libsvn_printer)
+ gdb.printing.register_pretty_printer(obj, libsvn_printer2)
-build_libsvn_printer()
+# Construct the pretty-printer objects, once, at GDB start-up time when this
+# Python module is loaded. (Registration happens later, once per object
+# file.)
+build_libsvn_printers()
Modified: subversion/branches/master-passphrase/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/dev/unix-build/Makefile.svn?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/master-passphrase/tools/dev/unix-build/Makefile.svn Tue Apr 3 19:16:59 2012
@@ -62,16 +62,16 @@ BDB_MAJOR_VER = 4.7
BDB_VER = $(BDB_MAJOR_VER).25
APR_VER = 1.4.5
APR_ICONV_VER = 1.2.1
-GNU_ICONV_VER = 1.13.1
+GNU_ICONV_VER = 1.14
APR_UTIL_VER = 1.3.12
-HTTPD_VER = 2.2.19
+HTTPD_VER = 2.2.22
NEON_VER = 0.29.6
-SERF_VER = 1.0.0
+SERF_VER = 1.0.3
SERF_OLD_VER = 0.3.1
-CYRUS_SASL_VER = 2.1.23
-SQLITE_VER = 3070603
+CYRUS_SASL_VER = 2.1.25
+SQLITE_VER = 3071100
LIBMAGIC_VER = 5.11
-RUBY_VER = 1.8.7-p334
+RUBY_VER = 1.8.7-p358
BZ2_VER = 1.0.6
PYTHON_VER = 2.7.2
Modified: subversion/branches/master-passphrase/tools/dev/which-error.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/dev/which-error.py?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/dev/which-error.py (original)
+++ subversion/branches/master-passphrase/tools/dev/which-error.py Tue Apr 3 19:16:59 2012
@@ -29,6 +29,7 @@
# $LastChangedRevision$
#
+import errno
import sys
import os.path
import re
@@ -68,6 +69,13 @@ codes. This can be done in variety of w
def get_errors():
errs = {}
+ ## errno values.
+ 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')):
+ key, _, val = line.split()
+ errs[int(val)] = key
+ ## Subversion errors, from svn_error_codes.h.
for key in vars(core):
if key.find('SVN_ERR_') == 0:
try:
Modified: subversion/branches/master-passphrase/tools/dist/dist.sh
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/dist/dist.sh?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/dist/dist.sh (original)
+++ subversion/branches/master-passphrase/tools/dist/dist.sh Tue Apr 3 19:16:59 2012
@@ -224,18 +224,33 @@ echo "Exporting $REPOS_PATH r$REVISION i
rm -f "$DISTPATH/STATUS"
+ver_major=`echo $VERSION | cut -d '.' -f 1`
+ver_minor=`echo $VERSION | cut -d '.' -f 2`
+ver_patch=`echo $VERSION | cut -d '.' -f 3`
+
# Remove contrib/ from our distribution tarball. Some of it is of
# unknown license, and usefulness.
# (See http://svn.haxx.se/dev/archive-2009-04/0166.shtml for discussion.)
-rm -rf "$DISTPATH/contrib"
+if [ "$ver_major" -eq "1" -a "$ver_minor" -ge "7" ]; then
+ rm -rf "$DISTPATH/contrib"
+fi
# Remove notes/ from our distribution tarball. It's large, but largely
# blue-sky and out-of-date, and of questionable use to end users.
-rm -rf "$DISTPATH/notes"
+if [ "$ver_major" -eq "1" -a "$ver_minor" -ge "7" ]; then
+ rm -rf "$DISTPATH/notes"
+fi
# Remove packages/ from the tarball.
# (See http://svn.haxx.se/dev/archive-2009-12/0205.shtml)
-rm -rf "$DISTPATH/packages"
+if [ "$ver_major" -eq "1" -a "$ver_minor" -ge "7" ]; then
+ rm -rf "$DISTPATH/packages"
+fi
+
+# Remove www/ from the tarball for 1.6.x and earlier releases
+if [ "$ver_major" -eq "1" -a "$ver_minor" -le "6" ]; then
+ rm -rf "$DISTPATH/www"
+fi
# Check for a recent enough Python
# Instead of attempting to deal with various line ending issues, just export
@@ -260,10 +275,6 @@ find "$DISTPATH" -name config.nice -prin
# on end-user's systems, when they should just be compiled by the
# Release Manager and left at that.
-ver_major=`echo $VERSION | cut -d '.' -f 1`
-ver_minor=`echo $VERSION | cut -d '.' -f 2`
-ver_patch=`echo $VERSION | cut -d '.' -f 3`
-
vsn_file="$DISTPATH/subversion/include/svn_version.h"
if [ "$VERSION" != "trunk" ] && [ "$VERSION" != "nightly" ]; then
sed \
@@ -363,6 +374,10 @@ sign_file()
fi
}
+# allow md5sum and sha1sum tool names to be overridden
+[ -n "$MD5SUM" ] || MD5SUM=md5sum
+[ -n "$SHA1SUM" ] || SHA1SUM=sha1sum
+
echo ""
echo "Done:"
if [ -z "$ZIP" ]; then
@@ -370,23 +385,23 @@ if [ -z "$ZIP" ]; then
sign_file $DISTNAME.tar.gz $DISTNAME.tar.bz2
echo ""
echo "md5sums:"
- md5sum "$DISTNAME.tar.bz2" "$DISTNAME.tar.gz"
- type sha1sum > /dev/null 2>&1
+ $MD5SUM "$DISTNAME.tar.bz2" "$DISTNAME.tar.gz"
+ type $SHA1SUM > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo ""
echo "sha1sums:"
- sha1sum "$DISTNAME.tar.bz2" "$DISTNAME.tar.gz"
+ $SHA1SUM "$DISTNAME.tar.bz2" "$DISTNAME.tar.gz"
fi
else
ls -l "$DISTNAME.zip"
sign_file $DISTNAME.zip
echo ""
echo "md5sum:"
- md5sum "$DISTNAME.zip"
- type sha1sum > /dev/null 2>&1
+ $MD5SUM "$DISTNAME.zip"
+ type $SHA1SUM > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo ""
echo "sha1sum:"
- sha1sum "$DISTNAME.zip"
+ $SHA1SUM "$DISTNAME.zip"
fi
fi
Propchange: subversion/branches/master-passphrase/tools/dist/make-deps-tarball.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: subversion/branches/master-passphrase/tools/dist/make-deps-tarball.sh
------------------------------------------------------------------------------
svn:executable = *
Propchange: subversion/branches/master-passphrase/tools/dist/make-deps-tarball.sh
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Apr 3 19:16:59 2012
@@ -0,0 +1,37 @@
+/subversion/branches/1.5.x-r30215/tools/dist/construct-rolling-environment.sh:870312
+/subversion/branches/bdb-reverse-deltas/tools/dist/construct-rolling-environment.sh:872050-872529
+/subversion/branches/diff-callbacks3/tools/dist/construct-rolling-environment.sh:870059-870761
+/subversion/branches/dont-save-plaintext-passwords-by-default/tools/dist/construct-rolling-environment.sh:870728-871118
+/subversion/branches/double-delete/tools/dist/construct-rolling-environment.sh:870511-872970
+/subversion/branches/explore-wc/tools/dist/construct-rolling-environment.sh:875486,875493,875497,875507,875511,875514,875559,875580-875581,875584,875587,875611,875627,875647,875667-875668,875711-875712,875733-875734,875736,875744-875748,875751,875758,875782,875795-875796,875830,875836,875838,875842,875852,875855,875864,875870,875873,875880,875885-875888,875890,875897-875898,875905,875907-875909,875935,875943-875944,875946,875979,875982-875983,875985-875986,875990,875997
+/subversion/branches/file-externals/tools/dist/construct-rolling-environment.sh:871779-873302
+/subversion/branches/fs-rep-sharing/tools/dist/construct-rolling-environment.sh:869036-873803
+/subversion/branches/fsfs-pack/tools/dist/construct-rolling-environment.sh:873717-874575
+/subversion/branches/gnome-keyring/tools/dist/construct-rolling-environment.sh:870558-871410
+/subversion/branches/http-protocol-v2/tools/dist/construct-rolling-environment.sh:874395-876041
+/subversion/branches/in-memory-cache/tools/dist/construct-rolling-environment.sh:869829-871452
+/subversion/branches/issue-2843-dev/tools/dist/construct-rolling-environment.sh:871432-874179
+/subversion/branches/issue-3000/tools/dist/construct-rolling-environment.sh:871713,871716-871719,871721-871726,871728,871734
+/subversion/branches/issue-3067-deleted-subtrees/tools/dist/construct-rolling-environment.sh:873375-874084
+/subversion/branches/issue-3148-dev/tools/dist/construct-rolling-environment.sh:875193-875204
+/subversion/branches/issue-3220-dev/tools/dist/construct-rolling-environment.sh:872210-872226
+/subversion/branches/issue-3242-dev/tools/dist/construct-rolling-environment.sh:879653-896436
+/subversion/branches/issue-3334-dirs/tools/dist/construct-rolling-environment.sh:875156-875867
+/subversion/branches/kwallet/tools/dist/construct-rolling-environment.sh:870785-871314
+/subversion/branches/log-g-performance/tools/dist/construct-rolling-environment.sh:870941-871032
+/subversion/branches/merge-skips-obstructions/tools/dist/construct-rolling-environment.sh:874525-874615
+/subversion/branches/ra_serf-digest-authn/tools/dist/construct-rolling-environment.sh:875693-876404
+/subversion/branches/reintegrate-improvements/tools/dist/construct-rolling-environment.sh:873853-874164
+/subversion/branches/subtree-mergeinfo/tools/dist/construct-rolling-environment.sh:876734-878766
+/subversion/branches/svn-mergeinfo-enhancements/tools/dist/construct-rolling-environment.sh:870119-870195,870197-870288
+/subversion/branches/svn-patch-improvements/tools/dist/construct-rolling-environment.sh:918519-934609
+/subversion/branches/svnpatch-diff/tools/dist/construct-rolling-environment.sh:865738-876477
+/subversion/branches/svnraisetc/tools/dist/construct-rolling-environment.sh:874709-875149
+/subversion/branches/svnserve-logging/tools/dist/construct-rolling-environment.sh:869828-870893
+/subversion/branches/tc-issue-3334/tools/dist/construct-rolling-environment.sh:874697-874773
+/subversion/branches/tc-merge-notify/tools/dist/construct-rolling-environment.sh:874017-874062
+/subversion/branches/tc-resolve/tools/dist/construct-rolling-environment.sh:874191-874239
+/subversion/branches/tc_url_rev/tools/dist/construct-rolling-environment.sh:874351-874483
+/subversion/branches/tree-conflicts/tools/dist/construct-rolling-environment.sh:868291-873154
+/subversion/branches/tree-conflicts-notify/tools/dist/construct-rolling-environment.sh:873926-874008
+/subversion/trunk/tools/dist/make-deps-tarball.sh:1304315-1309097
Modified: subversion/branches/master-passphrase/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/dist/release.py?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/dist/release.py (original)
+++ subversion/branches/master-passphrase/tools/dist/release.py Tue Apr 3 19:16:59 2012
@@ -21,10 +21,10 @@
# About this script:
-# This script is intended to simplify creating Subversion releases, by
-# automating as much as is possible. It works well with our Apache
-# infrastructure, and should make rolling, posting, and announcing
-# releases dirt simple.
+# This script is intended to simplify creating Subversion releases for
+# any of the supported release lines of Subversion.
+# It works well with our Apache infrastructure, and should make rolling,
+# posting, and announcing releases dirt simple.
#
# This script may be run on a number of platforms, but it is intended to
# be run on people.apache.org. As such, it may have dependencies (such
@@ -75,6 +75,11 @@ tool_versions = {
'libtool' : '2.4',
'swig' : '2.0.4',
},
+ '1.6' : {
+ 'autoconf' : '2.64',
+ 'libtool' : '1.5.26',
+ 'swig' : '1.3.36',
+ },
}
# Some constants
@@ -82,6 +87,7 @@ repos = 'http://svn.apache.org/repos/asf
dist_repos = 'https://dist.apache.org/repos/dist'
dist_dev_url = dist_repos + '/dev/subversion'
dist_release_url = dist_repos + '/release/subversion'
+extns = ['zip', 'tar.gz', 'tar.bz2']
#----------------------------------------------------------------------
@@ -295,8 +301,7 @@ class LibtoolDep(RollDep):
output = self._test_version(['libtool', '--version'])
if not output: return False
- version = output[0].split()[-1:][0]
- return version == self._libtool_ver
+ return self._libtool_ver in output[0]
def use_system(self):
# We unconditionally return False here, to avoid using a borked
@@ -357,41 +362,21 @@ def build_env(args):
#----------------------------------------------------------------------
# Create release artifacts
-def fetch_changes(repos, branch, revision):
- changes_peg_url = '%s/%s/CHANGES@%d' % (repos, branch, revision)
- proc = subprocess.Popen(['svn', 'cat', changes_peg_url],
- stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- (stdout, stderr) = proc.communicate()
- proc.wait()
- return stdout.split('\n')
-
-
def compare_changes(repos, branch, revision):
- # Compare trunk's version of CHANGES with that of the branch,
- # ignoring any lines in trunk's version precede what *should*
- # match the contents of the branch's version. (This allows us to
- # continue adding new stuff at the top of trunk's CHANGES that
- # might relate to the *next* major release line.)
- branch_CHANGES = fetch_changes(repos, branch, revision)
- trunk_CHANGES = fetch_changes(repos, 'trunk', revision)
- try:
- first_matching_line = trunk_CHANGES.index(branch_CHANGES[0])
- except ValueError:
- raise RuntimeError('CHANGES not synced between trunk and branch')
-
- trunk_CHANGES = trunk_CHANGES[first_matching_line:]
- saw_diff = False
- import difflib
- for diff_line in difflib.unified_diff(trunk_CHANGES, branch_CHANGES):
- saw_diff = True
- logging.debug('%s', diff_line)
- if saw_diff:
- raise RuntimeError('CHANGES not synced between trunk and branch')
-
+ mergeinfo_cmd = ['svn', 'mergeinfo', '--show-revs=eligible',
+ repos + '/trunk/CHANGES',
+ repos + '/' + branch + '/' + 'CHANGES']
+ proc = subprocess.Popen(mergeinfo_cmd, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ (stdout, stderr) = proc.communicate()
+ rc = proc.wait()
+ if stderr:
+ raise RuntimeError('svn mergeinfo failed: %s' % stderr)
+ if stdout:
+ raise RuntimeError('CHANGES has unmerged revisions: %s' % stdout)
def roll_tarballs(args):
'Create the release artifacts.'
- extns = ['zip', 'tar.gz', 'tar.bz2']
if args.branch:
branch = args.branch
@@ -458,6 +443,33 @@ def roll_tarballs(args):
# And we're done!
+#----------------------------------------------------------------------
+# Sign the candidate release artifacts
+
+def sign_candidates(args):
+ 'Sign candidate artifacts in the dist development directory.'
+
+ def sign_file(filename):
+ asc_file = open(filename + '.asc', 'a')
+ logging.info("Signing %s" % filename)
+ proc = subprocess.Popen(['gpg', '-ba', '-o', '-', filename],
+ stdout=asc_file)
+ proc.wait()
+ asc_file.close()
+
+ if args.target:
+ target = args.target
+ else:
+ target = get_deploydir(args.base_dir)
+
+ for e in extns:
+ filename = os.path.join(target, 'subversion-%s.%s' % (args.version, e))
+ sign_file(filename)
+ if args.version.major >= 1 and args.version.minor <= 6:
+ filename = os.path.join(target,
+ 'subversion-deps-%s.%s' % (args.version, e))
+ sign_file(filename)
+
#----------------------------------------------------------------------
# Post the candidate release artifacts
@@ -643,16 +655,16 @@ def check_sigs(args):
if args.target:
target = args.target
else:
- target = os.path.join(os.getenv('HOME'), 'public_html', 'svn',
- str(args.version))
+ target = get_deploydir(args.base_dir)
good_sigs = {}
- glob_pattern = os.path.join(target, 'subversion-%s*.asc' % args.version)
+ glob_pattern = os.path.join(target, 'subversion*-%s*.asc' % args.version)
for filename in glob.glob(glob_pattern):
text = open(filename).read()
keys = text.split(key_start)
+ logging.info("Checking %d sig(s) in %s" % (len(keys[1:]), filename))
for key in keys[1:]:
fd, fn = tempfile.mkstemp()
os.write(fd, key_start + key)
@@ -729,6 +741,16 @@ def main():
subparser.add_argument('--branch',
help='''The branch to base the release on.''')
+ # Setup the parser for the sign-candidates subcommand
+ subparser = subparsers.add_parser('sign-candidates',
+ help='''Sign the release artifacts.''')
+ subparser.set_defaults(func=sign_candidates)
+ subparser.add_argument('version', type=Version,
+ help='''The release label, such as '1.7.0-alpha1'.''')
+ subparser.add_argument('--target',
+ help='''The full path to the directory containing
+ release artifacts.''')
+
# Setup the parser for the post-candidates subcommand
subparser = subparsers.add_parser('post-candidates',
help='''Commit candidates to the release development area
@@ -736,10 +758,6 @@ def main():
subparser.set_defaults(func=post_candidates)
subparser.add_argument('version', type=Version,
help='''The release label, such as '1.7.0-alpha1'.''')
- subparser.add_argument('revnum', type=int,
- help='''The revision number to base the release on.''')
- subparser.add_argument('--target',
- help='''The full path to the destination.''')
# The clean-dist subcommand
subparser = subparsers.add_parser('clean-dist',
@@ -757,11 +775,6 @@ def main():
subparser.set_defaults(func=move_to_dist)
subparser.add_argument('version', type=Version,
help='''The release label, such as '1.7.0-alpha1'.''')
- subparser.add_argument('--dist-dir',
- help='''The directory to clean.''')
- subparser.add_argument('--target',
- help='''The full path to the destination used in
- 'post-candiates'..''')
# The write-news subcommand
subparser = subparsers.add_parser('write-news',
@@ -793,8 +806,8 @@ def main():
subparser.add_argument('version', type=Version,
help='''The release label, such as '1.7.0-alpha1'.''')
subparser.add_argument('--target',
- help='''The full path to the destination used in
- 'post-candiates'..''')
+ help='''The full path to the directory containing
+ release artifacts.''')
# A meta-target
subparser = subparsers.add_parser('clean',
Modified: subversion/branches/master-passphrase/tools/server-side/mod_dontdothat/mod_dontdothat.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/server-side/mod_dontdothat/mod_dontdothat.c?rev=1309099&r1=1309098&r2=1309099&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/server-side/mod_dontdothat/mod_dontdothat.c (original)
+++ subversion/branches/master-passphrase/tools/server-side/mod_dontdothat/mod_dontdothat.c Tue Apr 3 19:16:59 2012
@@ -271,7 +271,7 @@ dontdothat_filter(ap_filter_t *f,
return rv;
}
- if (! XML_Parse(ctx->xmlp, str, len, last))
+ if (! XML_Parse(ctx->xmlp, str, (int)len, last))
{
/* 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. */