Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8DADDF4CC for ; Wed, 21 Aug 2013 16:11:33 +0000 (UTC) Received: (qmail 26426 invoked by uid 500); 21 Aug 2013 16:11:33 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 26405 invoked by uid 500); 21 Aug 2013 16:11:33 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 26397 invoked by uid 99); 21 Aug 2013 16:11:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Aug 2013 16:11:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Aug 2013 16:11:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4D4112388C56; Wed, 21 Aug 2013 16:10:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1516196 [22/26] - in /subversion/branches/invoke-diff-cmd-feature: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ contrib/client-side/emacs/ contrib/hook-scripts/ doc/programmer/ notes/ notes/h... Date: Wed, 21 Aug 2013 16:09:52 -0000 To: commits@subversion.apache.org From: gbg@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130821161015.4D4112388C56@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnlook/svnlook.c URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnlook/svnlook.c?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/svnlook/svnlook.c (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/svnlook/svnlook.c Wed Aug 21 16:09:43 2013 @@ -34,6 +34,7 @@ #define APR_WANT_STRFUNC #include +#include "svn_private_config.h" #include "svn_hash.h" #include "svn_cmdline.h" #include "svn_types.h" @@ -57,8 +58,7 @@ #include "private/svn_diff_private.h" #include "private/svn_cmdline_private.h" #include "private/svn_fspath.h" - -#include "svn_private_config.h" +#include "private/svn_io_private.h" /*** Some convenience macros and types. ***/ @@ -403,7 +403,7 @@ check_lib_versions(void) }; SVN_VERSION_DEFINE(my_version); - return svn_ver_check_list(&my_version, checklist); + return svn_ver_check_list2(&my_version, checklist, svn_ver_equal); } @@ -990,12 +990,21 @@ print_diff_tree(svn_stream_t *out_stream SVN_ERR(generate_label(&new_label, root, path, pool)); /* We deal in streams, but svn_io_run_diff2() deals in file - handles, unfortunately, so we need to make these temporary - files, and then copy the contents to our stream. */ - SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL, - svn_io_file_del_on_pool_cleanup, pool, pool)); - SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL, - svn_io_file_del_on_pool_cleanup, pool, pool)); + handles, so we may need to make temporary files and then + copy the contents to our stream. */ + outfile = svn_stream__aprfile(out_stream); + if (outfile) + outfilename = NULL; + else + SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL, + svn_io_file_del_on_pool_cleanup, pool, pool)); + SVN_ERR(svn_stream_for_stderr(&err_stream, pool)); + errfile = svn_stream__aprfile(err_stream); + if (errfile) + errfilename = NULL; + else + SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL, + svn_io_file_del_on_pool_cleanup, pool, pool)); if (c->diff_cmd) SVN_ERR(svn_io_run_diff2(".", @@ -1021,18 +1030,26 @@ print_diff_tree(svn_stream_t *out_stream SVN_ERR(svn_io_file_close(outfile, pool)); SVN_ERR(svn_io_file_close(errfile, pool)); + /* Now, open and copy our files to our output streams. */ - SVN_ERR(svn_stream_for_stderr(&err_stream, pool)); - SVN_ERR(svn_stream_open_readonly(&stream, outfilename, - pool, pool)); - SVN_ERR(svn_stream_copy3(stream, - svn_stream_disown(out_stream, pool), - NULL, NULL, pool)); - SVN_ERR(svn_stream_open_readonly(&stream, errfilename, - pool, pool)); - SVN_ERR(svn_stream_copy3(stream, - svn_stream_disown(err_stream, pool), - NULL, NULL, pool)); + if (outfilename) + { + SVN_ERR(svn_io_file_close(outfile, pool)); + SVN_ERR(svn_stream_open_readonly(&stream, outfilename, + pool, pool)); + SVN_ERR(svn_stream_copy3(stream, + svn_stream_disown(out_stream, pool), + NULL, NULL, pool)); + } + if (errfilename) + { + SVN_ERR(svn_io_file_close(errfile, pool)); + SVN_ERR(svn_stream_open_readonly(&stream, errfilename, + pool, pool)); + SVN_ERR(svn_stream_copy3(stream, + svn_stream_disown(err_stream, pool), + NULL, NULL, pool)); + } SVN_ERR(svn_stream_printf_from_utf8(out_stream, encoding, pool, "\n")); Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnmucc/svnmucc.c URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnmucc/svnmucc.c?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/svnmucc/svnmucc.c (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/svnmucc/svnmucc.c Wed Aug 21 16:09:43 2013 @@ -40,6 +40,7 @@ #include +#include "svn_private_config.h" #include "svn_hash.h" #include "svn_client.h" #include "svn_cmdline.h" @@ -58,8 +59,6 @@ #include "private/svn_ra_private.h" #include "private/svn_string_private.h" -#include "svn_private_config.h" - static void handle_error(svn_error_t *err, apr_pool_t *pool) { if (err) @@ -85,7 +84,7 @@ init(const char *application) if (svn_cmdline_init(application, stderr)) exit(EXIT_FAILURE); - err = svn_ver_check_list(&my_version, checklist); + err = svn_ver_check_list2(&my_version, checklist, svn_ver_equal); if (err) handle_error(err, NULL); @@ -1145,13 +1144,18 @@ main(int argc, const char **argv) break; case 'r': { + const char *saved_arg = arg; char *digits_end = NULL; + while (*arg == 'r') + arg++; base_revision = strtol(arg, &digits_end, 10); if ((! SVN_IS_VALID_REVNUM(base_revision)) || (! digits_end) || *digits_end) - handle_error(svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, - NULL, "Invalid revision number"), + handle_error(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, + NULL, + _("Invalid revision number '%s'"), + saved_arg), pool); } break; @@ -1429,7 +1433,14 @@ main(int argc, const char **argv) if (! anchor) anchor = url; else - anchor = svn_uri_get_longest_ancestor(anchor, url, pool); + { + anchor = svn_uri_get_longest_ancestor(anchor, url, pool); + if (!anchor || !anchor[0]) + handle_error(svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL, + "URLs in the action list do not " + "share a common ancestor"), + pool); + } if ((++i == action_args->nelts) && (j + 1 < num_url_args)) insufficient(pool); Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnrdump/dump_editor.c URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnrdump/dump_editor.c?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/svnrdump/dump_editor.c (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/svnrdump/dump_editor.c Wed Aug 21 16:09:43 2013 @@ -22,6 +22,7 @@ * ==================================================================== */ +#include "svn_private_config.h" #include "svn_hash.h" #include "svn_pools.h" #include "svn_repos.h" Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnrdump/svnrdump.c URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnrdump/svnrdump.c?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/svnrdump/svnrdump.c (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/svnrdump/svnrdump.c Wed Aug 21 16:09:43 2013 @@ -25,6 +25,7 @@ #include #include +#include "svn_private_config.h" #include "svn_pools.h" #include "svn_cmdline.h" #include "svn_client.h" @@ -33,7 +34,6 @@ #include "svn_repos.h" #include "svn_path.h" #include "svn_utf.h" -#include "svn_private_config.h" #include "svn_string.h" #include "svn_props.h" @@ -42,7 +42,6 @@ #include "private/svn_cmdline_private.h" #include "private/svn_ra_private.h" - /*** Cancellation ***/ Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnrdump/util.c URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnrdump/util.c?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/svnrdump/util.c (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/svnrdump/util.c Wed Aug 21 16:09:43 2013 @@ -21,6 +21,7 @@ * ==================================================================== */ +#include "svn_private_config.h" #include "svn_error.h" #include "svn_pools.h" #include "svn_string.h" Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/serve.c URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/serve.c?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/serve.c (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/serve.c Wed Aug 21 16:09:43 2013 @@ -33,8 +33,8 @@ #include #include +#include "svn_private_config.h" #include "svn_compat.h" -#include "svn_private_config.h" /* For SVN_PATH_LOCAL_SEPARATOR */ #include "svn_hash.h" #include "svn_types.h" #include "svn_string.h" @@ -340,6 +340,12 @@ canonicalize_access_file(const char **ac return SVN_NO_ERROR; } +/* Load the authz database for the listening server based on the + entries in the SERVER struct. + + SERVER and CONN must not be NULL. The real errors will be logged with + SERVER and CONN but return generic errors to the client. */ +static svn_error_t *load_authz_config(server_baton_t *server, svn_ra_svn_conn_t *conn, const char *repos_root, @@ -1392,13 +1398,13 @@ static svn_error_t *commit(svn_ra_svn_co apr_array_header_t *params, void *baton) { server_baton_t *b = baton; - const char *log_msg = NULL, + const char *log_msg, *date = NULL, *author = NULL, *post_commit_err = NULL; apr_array_header_t *lock_tokens; svn_boolean_t keep_locks; - apr_array_header_t *revprop_list = NULL; + apr_array_header_t *revprop_list; apr_hash_t *revprop_table; const svn_delta_editor_t *editor; void *edit_baton; @@ -1441,6 +1447,7 @@ static svn_error_t *commit(svn_ra_svn_co if (lock_tokens && lock_tokens->nelts) SVN_CMD_ERR(add_lock_tokens(conn, lock_tokens, b, pool)); + /* Ignore LOG_MSG, per the protocol. See ra_svn_commit(). */ if (revprop_list) SVN_ERR(svn_ra_svn__parse_proplist(revprop_list, pool, &revprop_table)); else @@ -2090,9 +2097,8 @@ static svn_error_t *log_receiver(void *b svn_ra_svn_conn_t *conn = b->conn; apr_hash_index_t *h; svn_boolean_t invalid_revnum = FALSE; - char action[2]; - const char *author, *date, *message; - apr_uint64_t revprop_count; + const svn_string_t *author, *date, *message; + unsigned revprop_count; if (log_entry->revision == SVN_INVALID_REVNUM) { @@ -2108,7 +2114,19 @@ static svn_error_t *log_receiver(void *b b->stack_depth--; } - SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "(!")); + svn_compat_log_revprops_out_string(&author, &date, &message, + log_entry->revprops); + svn_compat_log_revprops_clear(log_entry->revprops); + if (log_entry->revprops) + revprop_count = apr_hash_count(log_entry->revprops); + else + revprop_count = 0; + + /* send LOG_ENTRY */ + SVN_ERR(svn_ra_svn__start_list(conn, pool)); + + /* send LOG_ENTRY->CHANGED_PATHS2 */ + SVN_ERR(svn_ra_svn__start_list(conn, pool)); if (log_entry->changed_paths2) { for (h = apr_hash_first(pool, log_entry->changed_paths2); h; @@ -2117,34 +2135,36 @@ static svn_error_t *log_receiver(void *b const char *path = svn__apr_hash_index_key(h); svn_log_changed_path2_t *change = svn__apr_hash_index_val(h); - action[0] = change->action; - action[1] = '\0'; - SVN_ERR(svn_ra_svn__write_tuple( - conn, pool, "cw(?cr)(cbb)", + SVN_ERR(svn_ra_svn__write_data_log_changed_path( + conn, pool, path, - action, + change->action, change->copyfrom_path, change->copyfrom_rev, - svn_node_kind_to_word(change->node_kind), + change->node_kind, /* text_modified and props_modified are never unknown */ change->text_modified == svn_tristate_true, change->props_modified == svn_tristate_true)); } } - svn_compat_log_revprops_out(&author, &date, &message, log_entry->revprops); - svn_compat_log_revprops_clear(log_entry->revprops); - if (log_entry->revprops) - revprop_count = apr_hash_count(log_entry->revprops); - else - revprop_count = 0; - SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!)r(?c)(?c)(?c)bbn(!", - log_entry->revision, - author, date, message, - log_entry->has_children, - invalid_revnum, revprop_count)); - SVN_ERR(svn_ra_svn__write_proplist(conn, pool, log_entry->revprops)); - SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!)b", - log_entry->subtractive_merge)); + SVN_ERR(svn_ra_svn__end_list(conn, pool)); + + /* send LOG_ENTRY main members */ + SVN_ERR(svn_ra_svn__write_data_log_entry(conn, pool, + log_entry->revision, + author, date, message, + log_entry->has_children, + invalid_revnum, revprop_count)); + + /* send LOG_ENTRY->REVPROPS */ + SVN_ERR(svn_ra_svn__start_list(conn, pool)); + if (revprop_count) + SVN_ERR(svn_ra_svn__write_proplist(conn, pool, log_entry->revprops)); + SVN_ERR(svn_ra_svn__end_list(conn, pool)); + + /* send LOG_ENTRY members that were added in later SVN releases */ + SVN_ERR(svn_ra_svn__write_boolean(conn, pool, log_entry->subtractive_merge)); + SVN_ERR(svn_ra_svn__end_list(conn, pool)); if (log_entry->has_children) b->stack_depth++; Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/server.h URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/server.h?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/server.h (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/server.h Wed Aug 21 16:09:43 2013 @@ -146,16 +146,6 @@ svn_error_t *load_pwdb_config(server_bat svn_ra_svn_conn_t *conn, apr_pool_t *pool); -/* Load the authz database for the listening server based on the - entries in the SERVER struct. - - SERVER and CONN must not be NULL. The real errors will be logged with - SERVER and CONN but return generic errors to the client. */ -svn_error_t *load_authz_config(server_baton_t *server, - svn_ra_svn_conn_t *conn, - const char *repos_root, - apr_pool_t *pool); - /* Initialize the Cyrus SASL library. POOL is used for allocations. */ svn_error_t *cyrus_init(apr_pool_t *pool); Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/svnserve.c URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/svnserve.c?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/svnserve.c (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/svnserve.c Wed Aug 21 16:09:43 2013 @@ -465,7 +465,7 @@ check_lib_versions(void) }; SVN_VERSION_DEFINE(my_version); - return svn_ver_check_list(&my_version, checklist); + return svn_ver_check_list2(&my_version, checklist, svn_ver_equal); } Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnsync/svnsync.c URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnsync/svnsync.c?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/svnsync/svnsync.c (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/svnsync/svnsync.c Wed Aug 21 16:09:43 2013 @@ -19,6 +19,7 @@ * ==================================================================== */ +#include "svn_private_config.h" #include "svn_hash.h" #include "svn_cmdline.h" #include "svn_config.h" @@ -41,8 +42,6 @@ #include "sync.h" -#include "svn_private_config.h" - #include #include @@ -312,7 +311,7 @@ check_lib_versions(void) }; SVN_VERSION_DEFINE(my_version); - return svn_ver_check_list(&my_version, checklist); + return svn_ver_check_list2(&my_version, checklist, svn_ver_equal); } @@ -1297,7 +1296,7 @@ replay_rev_finished(svn_revnum_t revisio if (rb->sb->committed_rev != revision) return svn_error_createf (APR_EINVAL, NULL, - _("Commit created rev %ld but should have created %ld"), + _("Commit created r%ld but should have created r%ld"), rb->sb->committed_rev, revision); SVN_ERR(svn_ra_rev_proplist(rb->to_session, revision, &existing_props, Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnsync/sync.c URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnsync/sync.c?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/svnsync/sync.c (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/svnsync/sync.c Wed Aug 21 16:09:43 2013 @@ -19,6 +19,7 @@ * ==================================================================== */ +#include "svn_private_config.h" #include "svn_hash.h" #include "svn_cmdline.h" #include "svn_config.h" @@ -36,8 +37,6 @@ #include "sync.h" -#include "svn_private_config.h" - #include #include #include Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnversion/svnversion.c URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnversion/svnversion.c?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/svnversion/svnversion.c (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/svnversion/svnversion.c Wed Aug 21 16:09:43 2013 @@ -110,7 +110,7 @@ check_lib_versions(void) }; SVN_VERSION_DEFINE(my_version); - return svn_ver_check_list(&my_version, checklist); + return svn_ver_check_list2(&my_version, checklist, svn_ver_equal); } /* Propchange: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Aug 21 16:09:43 2013 @@ -8,3 +8,4 @@ httpd-* entries-dump atomic-ra-revprop-change .libs +.davautocheck.sh.stop Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/README URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/README?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/README (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/README Wed Aug 21 16:09:43 2013 @@ -245,9 +245,25 @@ Directory Contents /verify.py: Verifies output from Subversion. - /entry.py: Parse an `entries' file (### not used yet) - - + /testcase.py: Control of test case execution - contains + decorators for expected failures and conditionally + executed tests. + + /sandbox.py: Tools for manipulating a test's working area + ("a sandbox"), those are handy for most simple + actions a test might want to perform on a wc. + + /objects.py: Objects that keep track of state during a test. + (not directly used by the test scripts.) + + /mergetrees.py: Routines that create merge scenarios. + + /factory.py: Automatically generate a (near-)complete new + cmdline test from a series of shell commands. + + /error.py: Error codes as constants, for convenience. + (auto-generated by tools/dev/gen-py-error.py) + What the Python Tests are Doing =============================== Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/autoprop_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/autoprop_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/autoprop_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/autoprop_tests.py Wed Aug 21 16:09:43 2013 @@ -695,8 +695,7 @@ def svn_prop_inheritable_autoprops_unver '*.c=svn:eol-style=CR', sbox.ospath('A/B')) svntest.main.run_svn(None, 'ps', SVN_PROP_INHERITABLE_AUTOPROPS, '*.c=svn:eol-style=native', sbox.ospath('A/D')) - svntest.main.run_svn(None, 'ci', '-m', 'Add inheritable autoprops', - sbox.wc_dir) + sbox.simple_commit(message='Add inheritable autoprops') # Create two subtrees, each with one new file. os.mkdir(Z_path) Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/basic_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/basic_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/basic_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/basic_tests.py Wed Aug 21 16:09:43 2013 @@ -3049,6 +3049,34 @@ def peg_rev_on_non_existent_wc_path(sbox svntest.actions.run_and_verify_svn(None, ['r2\n'], [], 'cat', '-r2', sbox.ospath('mu3') + '@3') + +@Issue(4299) +def basic_youngest(sbox): + 'basic youngest' + + sbox.build(read_only=True) + + repos_url = sbox.repo_url + deep_repos_url = repos_url + '/A/D/G' + + wc_dir = sbox.wc_dir + deep_wc_dir = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha') + bad_wc_dir = os.path.join(wc_dir, 'Z') + + svntest.actions.run_and_verify_svn("'svn youngest' on bad WC path", + None, svntest.verify.AnyOutput, + 'youngest', bad_wc_dir) + + for flag, output in [(False, "1\n"), (True, "1")]: + for path in [repos_url, deep_repos_url, wc_dir, deep_wc_dir]: + if flag: + svntest.actions.run_and_verify_svn("svn youngest", [output], [], + 'youngest', '--no-newline', path) + else: + svntest.actions.run_and_verify_svn("svn youngest", [output], [], + 'youngest', path) + + ######################################################################## # Run the tests @@ -3117,6 +3145,7 @@ test_list = [ None, rm_missing_with_case_clashing_ondisk_item, delete_conflicts_one_of_many, peg_rev_on_non_existent_wc_path, + basic_youngest, ] if __name__ == '__main__': Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/blame_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/blame_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/blame_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/blame_tests.py Wed Aug 21 16:09:43 2013 @@ -34,7 +34,7 @@ from svntest.main import server_has_merg from prop_tests import binary_mime_type_on_text_file_warning # For some basic merge setup used by blame -g tests. -from merge_tests import set_up_branch +from svntest.mergetrees import set_up_branch # (abbreviation) Skip = svntest.testcase.Skip_deco @@ -772,7 +772,7 @@ def merge_sensitive_blame_and_empty_merg # Make an edit to A/D/H/psi in r3. svntest.main.file_append(psi_path, "trunk edit in revision three.\n") - svntest.main.run_svn(None, 'ci', '-m', 'trunk edit', wc_dir) + sbox.simple_commit(message='trunk edit') # Merge r3 from A to A_COPY, reverse merge r3 from A/D/H/psi # to A_COPY/D/H/psi, and commit as r4. This results in empty @@ -782,21 +782,18 @@ def merge_sensitive_blame_and_empty_merg sbox.repo_url + '/A', A_COPY_path) svntest.main.run_svn(None, 'merge', '-c-3', sbox.repo_url + '/A/D/H/psi', psi_COPY_path) - svntest.main.run_svn(None, 'ci', '-m', - 'Sync merge A to A_COPY excepting A_COPY/D/H/psi', - wc_dir) + sbox.simple_commit(message='Sync merge A to A_COPY excepting A_COPY/D/H/psi') # Make an edit to A/D/H/psi in r5. svntest.main.file_append(psi_path, "trunk edit in revision five.\n") - svntest.main.run_svn(None, 'ci', '-m', 'trunk edit', wc_dir) + sbox.simple_commit(message='trunk edit') # Sync merge A/D/H/psi to A_COPY/D/H/psi and commit as r6. This replaces # the empty mergeinfo on A_COPY/D/H/psi with '/A/D/H/psi:2-5'. svntest.main.run_svn(None, 'up', wc_dir) svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A/D/H/psi', psi_COPY_path) - svntest.main.run_svn(None, 'ci', '-m', - 'Sync merge A/D/H/psi to A_COPY/D/H/psi', wc_dir) + sbox.simple_commit(message='Sync merge A/D/H/psi to A_COPY/D/H/psi') # Check the blame -g output: # Currently this test fails because the trunk edit done in r3 is @@ -959,6 +956,34 @@ def blame_eol_handling(sbox): 'blame', f2) +@SkipUnless(svntest.main.server_has_reverse_get_file_revs) +def blame_youngest_to_oldest(sbox): + "blame_youngest_to_oldest" + + sbox.build() + + # First, make a new revision of iota. + iota = sbox.ospath('iota') + orig_line = open(iota).read() + line = "New contents for iota\n" + svntest.main.file_append(iota, line) + sbox.simple_commit() + + # Move the file, to check that the operation will peg correctly. + iota_moved = sbox.ospath('iota_moved') + sbox.simple_move('iota', 'iota_moved') + sbox.simple_commit() + + # Delete a line. + open(iota_moved, 'w').write(line) + sbox.simple_commit() + + expected_output = [ + ' %d jrandom %s\n' % (3, orig_line[:-1]), + ] + svntest.actions.run_and_verify_svn(None, expected_output, [], + 'blame', '-r4:1', iota_moved) + ######################################################################## # Run the tests @@ -982,6 +1007,7 @@ test_list = [ None, merge_sensitive_blame_and_empty_mergeinfo, blame_multiple_targets, blame_eol_handling, + blame_youngest_to_oldest, ] if __name__ == '__main__': Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/checkout_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/checkout_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/checkout_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/checkout_tests.py Wed Aug 21 16:09:43 2013 @@ -660,8 +660,13 @@ def checkout_peg_rev_date(sbox): sbox.build() wc_dir = sbox.wc_dir - # note the current time to use it as peg revision date. - current_time = time.strftime("%Y-%m-%dT%H:%M:%S") + exit_code, output, errput = svntest.main.run_svn(None, 'propget', 'svn:date', + '--revprop', '-r1', + '--strict', + sbox.repo_url) + if exit_code or errput != [] or len(output) != 1: + raise svntest.Failure("svn:date propget failed") + r1_time = output[0] # sleep till the next second. time.sleep(1.1) @@ -686,7 +691,7 @@ def checkout_peg_rev_date(sbox): # use an old date to checkout, that way we're sure we get the first revision svntest.actions.run_and_verify_checkout(sbox.repo_url + - '@{' + current_time + '}', + '@{' + r1_time + '}', checkout_target, expected_output, expected_wc) Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/commit_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/commit_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/commit_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/commit_tests.py Wed Aug 21 16:09:43 2013 @@ -1797,7 +1797,7 @@ def commit_out_of_date_deletions(sbox): I_path = sbox.ospath('A/I') os.mkdir(I_path) svntest.main.run_svn(None, 'add', I_path) - svntest.main.run_svn(None, 'ci', '-m', 'prep', wc_dir) + sbox.simple_commit(message='prep') svntest.main.run_svn(None, 'up', wc_dir) # Make a backup copy of the working copy @@ -2945,6 +2945,77 @@ def last_changed_of_copied_subdir(sbox): } svntest.actions.run_and_verify_info([expected], E_copied) +@XFail() +def commit_unversioned(sbox): + "verify behavior on unversioned targets" + + sbox.build(read_only=True) + wc_dir = sbox.wc_dir + + expected_err = 'E200009: .*existing.*\' is not under version control' + + # Unversioned, but existing file + svntest.main.file_write(sbox.ospath('existing'), "xxxx") + svntest.actions.run_and_verify_commit(wc_dir, None, None, expected_err, + sbox.ospath('existing')) + + # Unversioned, not existing + svntest.actions.run_and_verify_commit(wc_dir, None, None, expected_err, + sbox.ospath('not-existing')) + +@Issue(4400) +def commit_cp_with_deep_delete(sbox): + "verify behavior of a copy with a deep (>=3) delete" + + sbox.build() + wc_dir = sbox.wc_dir + + # Prep by adding a tree deep enough to exercise the issue. + sbox.simple_mkdir('A/B/E/I') + sbox.simple_commit(message='prep') + svntest.main.run_svn(None, 'up', wc_dir) + + # copy the deep tree and then delete a dir 3 deep. + sbox.simple_copy('A','A2') + sbox.simple_rm('A2/B/E/I') + + # come up with the expected output and status + expected_output = svntest.wc.State(wc_dir, { + 'A2' : Item(verb='Adding'), + 'A2/B/E/I' : Item(verb='Deleting'), + }) + expected_status = svntest.actions.get_virginal_state(wc_dir, 2) + expected_status.add({ + 'A/B/E/I' : Item(status=' ', wc_rev='2'), + 'A2' : Item(status=' ', wc_rev='3'), + 'A2/B' : Item(status=' ', wc_rev='3'), + 'A2/B/lambda' : Item(status=' ', wc_rev='3'), + 'A2/B/F' : Item(status=' ', wc_rev='3'), + 'A2/B/E' : Item(status=' ', wc_rev='3'), + 'A2/B/E/alpha' : Item(status=' ', wc_rev='3'), + 'A2/B/E/beta' : Item(status=' ', wc_rev='3'), + 'A2/D' : Item(status=' ', wc_rev='3'), + 'A2/D/gamma' : Item(status=' ', wc_rev='3'), + 'A2/D/H' : Item(status=' ', wc_rev='3'), + 'A2/D/H/psi' : Item(status=' ', wc_rev='3'), + 'A2/D/H/omega' : Item(status=' ', wc_rev='3'), + 'A2/D/H/chi' : Item(status=' ', wc_rev='3'), + 'A2/D/G' : Item(status=' ', wc_rev='3'), + 'A2/D/G/tau' : Item(status=' ', wc_rev='3'), + 'A2/D/G/rho' : Item(status=' ', wc_rev='3'), + 'A2/D/G/pi' : Item(status=' ', wc_rev='3'), + 'A2/C' : Item(status=' ', wc_rev='3'), + 'A2/mu' : Item(status=' ', wc_rev='3'), + }) + + # Commit the copy without the one dir. + svntest.actions.run_and_verify_commit(wc_dir, + expected_output, + expected_status, + None, + wc_dir) + + ######################################################################## # Run the tests @@ -3017,6 +3088,8 @@ test_list = [ None, commit_add_subadd, commit_danglers, last_changed_of_copied_subdir, + commit_unversioned, + commit_cp_with_deep_delete, ] if __name__ == '__main__': Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/davautocheck.sh URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/davautocheck.sh?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/davautocheck.sh (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/davautocheck.sh Wed Aug 21 16:09:43 2013 @@ -27,7 +27,7 @@ # testing are: # - Subversion built using --enable-shared --enable-dso --with-apxs options, # - Working Apache 2 HTTPD Server with the apxs program reachable through -# PATH or specified via the APXS environment variable, +# PATH or specified via the APXS Makefile variable or environment variable, # - Modules dav_module and log_config_module compiled as DSO or built into # Apache HTTPD Server executable. # The basic intension of this script is to be able to perform "make check" @@ -79,12 +79,14 @@ # environment. # # Passing --no-tests as argv[1] will have the script start a server -# but not run any tests. +# but not run any tests. Passing --gdb will do the same, and in addition +# spawn gdb in the foreground attached to the running server. PYTHON=${PYTHON:-python} SCRIPTDIR=$(dirname $0) SCRIPT=$(basename $0) +STOPSCRIPT=$SCRIPTDIR/.$SCRIPT.stop trap stop_httpd_and_die HUP TERM INT @@ -113,13 +115,17 @@ query() { read -n 1 -t 32 else # - prog=$(cat) <<'EOF' + prog=" import select as s import sys +import tty, termios +tty.setcbreak(sys.stdin.fileno(), termios.TCSANOW) if s.select([sys.stdin.fileno()], [], [], 32)[0]: sys.stdout.write(sys.stdin.read(1)) -EOF - REPLY=`stty cbreak; $PYTHON -c "$prog" "$@"; stty -cbreak` +" + stty_state=`stty -g` + REPLY=`$PYTHON -u -c "$prog" "$@"` + stty $stty_state fi echo [ "${REPLY:-$2}" = 'y' ] @@ -157,8 +163,20 @@ get_prog_name() { } # Don't assume sbin is in the PATH. +# ### Presumably this is used to locate /usr/sbin/apxs or /usr/sbin/apache2 PATH="$PATH:/usr/sbin:/usr/local/sbin" +# Find the source and build directories. The build dir can be found if it is +# the current working dir or the source dir. +ABS_SRCDIR=$(cd ${SCRIPTDIR}/../../../; pwd) +if [ -x subversion/svn/svn ]; then + ABS_BUILDDIR=$(pwd) +elif [ -x $ABS_SRCDIR/subversion/svn/svn ]; then + ABS_BUILDDIR=$ABS_SRCDIR +else + fail "Run this script from the root of Subversion's build tree!" +fi + # Remove any proxy environmental variables that affect wget or curl. # We don't need a proxy to connect to localhost and having the proxy # environmental variables set breaks the Apache configuration file @@ -169,10 +187,18 @@ unset http_proxy unset HTTPS_PROXY # Pick up value from environment or PATH (also try apxs2 - for Debian) -[ ${APXS:+set} ] \ - || APXS=$(which apxs) \ - || APXS=$(which apxs2) \ - || fail "neither apxs or apxs2 found - required to run davautocheck" +if [ ${APXS:+set} ]; then + : +elif APXS=$(grep '^APXS' $ABS_BUILDDIR/Makefile | sed 's/^APXS *= *//') && \ + [ -n "$APXS" ]; then + : +elif APXS=$(which apxs); then + : +elif APXS=$(which apxs2); then + : +else + fail "neither apxs or apxs2 found - required to run davautocheck" +fi [ -x $APXS ] || fail "Can't execute apxs executable $APXS" @@ -195,17 +221,6 @@ if [ ${CACHE_REVPROPS:+set} ]; then CACHE_REVPROPS_SETTING=on fi -# Find the source and build directories. The build dir can be found if it is -# the current working dir or the source dir. -ABS_SRCDIR=$(cd ${SCRIPTDIR}/../../../; pwd) -if [ -x subversion/svn/svn ]; then - ABS_BUILDDIR=$(pwd) -elif [ -x $ABS_SRCDIR/subversion/svn/svn ]; then - ABS_BUILDDIR=$ABS_SRCDIR -else - fail "Run this script from the root of Subversion's build tree!" -fi - if [ ${MODULE_PATH:+set} ]; then MOD_DAV_SVN="$MODULE_PATH/mod_dav_svn.so" MOD_AUTHZ_SVN="$MODULE_PATH/mod_authz_svn.so" @@ -300,17 +315,16 @@ if [ ${USE_SSL:+set} ]; then || fail "SSL module not found" fi -random_port() { - if [ -n "$BASH_VERSION" ]; then - echo $(($RANDOM+1024)) - else - $PYTHON -c 'import random; print random.randint(1024, 2**16-1)' - fi -} +# Stop any previous instances, os we can re-use the port. +if [ -x $STOPSCRIPT ]; then $STOPSCRIPT ; sleep 1; fi -HTTPD_PORT=$(random_port) -while netstat -an | grep $HTTPD_PORT | grep 'LISTEN'; do - HTTPD_PORT=$(random_port) +HTTPD_PORT=3691 +while netstat -an | grep $HTTPD_PORT | grep 'LISTEN' >/dev/null; do + HTTPD_PORT=$(( HTTPD_PORT + 1 )) + if [ $HTTPD_PORT -eq 65536 ]; then + # Most likely the loop condition is true regardless of $HTTPD_PORT + fail "netstat claims you have no free ports for httpd to listen on." + fi done HTTPD_ROOT="$ABS_BUILDDIR/subversion/tests/cmdline/httpd-$(date '+%Y%m%d-%H%M%S')" HTTPD_CFG="$HTTPD_ROOT/cfg" @@ -318,7 +332,13 @@ HTTPD_PID="$HTTPD_ROOT/pid" HTTPD_ACCESS_LOG="$HTTPD_ROOT/access_log" HTTPD_ERROR_LOG="$HTTPD_ROOT/error_log" HTTPD_MIME_TYPES="$HTTPD_ROOT/mime.types" -BASE_URL="http://localhost:$HTTPD_PORT" +if [ -z "$BASE_URL" ]; then + BASE_URL="http://localhost:$HTTPD_PORT" +else + # Specify the public name of the host when using a proxy on another host, the + # port number will be appended. + BASE_URL="$BASE_URL:$HTTPD_PORT" +fi HTTPD_USERS="$HTTPD_ROOT/users" mkdir "$HTTPD_ROOT" \ @@ -430,7 +450,7 @@ PidFile "$HTTPD_PID" LogFormat "%h %l %u %t \"%r\" %>s %b" common CustomLog "$HTTPD_ACCESS_LOG" common ErrorLog "$HTTPD_ERROR_LOG" -LogLevel Debug +LogLevel debug ServerRoot "$HTTPD_ROOT" DocumentRoot "$HTTPD_ROOT" ScoreBoardFile "$HTTPD_ROOT/run" @@ -486,6 +506,20 @@ RedirectMatch ^/svn-test-work/ __EOF__ START="$HTTPD -f $HTTPD_CFG" +printf \ +'#!/bin/sh +if [ -d "%s" ]; then + printf "Stopping previous HTTPD instance..." + if %s -k stop; then + # httpd had no output; echo a newline. + echo "" + elif [ -s "%s" ]; then + # httpd would have printed an error terminated by a newline. + kill -9 "`cat %s`" + fi +fi +' >$STOPSCRIPT "$HTTPD_ROOT" "$START" "$HTTPD_PID" "$HTTPD_PID" +chmod +x $STOPSCRIPT $START -t \ || fail "Configuration file didn't pass the check, most likely modules couldn't be loaded" @@ -522,10 +556,17 @@ rm "$HTTPD_CFG-copy" say "HTTPD is good" if [ $# -eq 1 ] && [ "x$1" = 'x--no-tests' ]; then - echo "http://localhost:$HTTPD_PORT" + echo "http://localhost:$HTTPD_PORT/svn-test-work/repositories" exit fi +if [ $# -eq 1 ] && [ "x$1" = 'x--gdb' ]; then + echo "http://localhost:$HTTPD_PORT/svn-test-work/repositories" + $STOPSCRIPT && gdb -silent -ex r -args $START -X + exit +fi + + if type time > /dev/null; then TIME_CMD=time else Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/diff_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/diff_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/diff_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/diff_tests.py Wed Aug 21 16:09:43 2013 @@ -4610,6 +4610,60 @@ def diff_missing_tree_conflict_victim(sb expected_output = [ ] svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff', wc_dir) +@Issue(4396) +def diff_local_missing_obstruction(sbox): + "diff local missing and obstructed files" + + sbox.build(read_only=True) + wc_dir = sbox.wc_dir + + os.unlink(sbox.ospath('iota')) + os.unlink(sbox.ospath('A/mu')) + os.mkdir(sbox.ospath('A/mu')) + + # Expect no output for missing and obstructed files + expected_output = [ + ] + svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff', wc_dir) + + sbox.simple_propset('K', 'V', 'iota', 'A/mu') + sbox.simple_append('IotA', 'Content') + + # But do expect a proper property diff + expected_output = [ + 'Index: %s\n' % (sbox.path('A/mu'),), + '===================================================================\n', + '--- %s\t(revision 1)\n' % (sbox.path('A/mu'),), + '+++ %s\t(working copy)\n' % (sbox.path('A/mu'),), + '\n', + 'Property changes on: %s\n' % (sbox.path('A/mu'),), + '___________________________________________________________________\n', + 'Added: K\n', + '## -0,0 +1 ##\n', + '+V\n', + '\ No newline at end of property\n', + 'Index: %s\n' % (sbox.path('iota'),), + '===================================================================\n', + '--- %s\t(revision 1)\n' % (sbox.path('iota'),), + '+++ %s\t(working copy)\n' % (sbox.path('iota'),), + '\n', + 'Property changes on: %s\n' % (sbox.path('iota'),), + '___________________________________________________________________\n', + 'Added: K\n', + '## -0,0 +1 ##\n', + '+V\n', + '\ No newline at end of property\n', + ] + svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff', wc_dir) + + # Create an external. This produces an error in 1.8.0. + sbox.simple_propset('svn:externals', 'AA/BB ' + sbox.repo_url + '/A', '.') + sbox.simple_update() + + svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [], + 'diff', wc_dir) + + ######################################################################## #Run the tests @@ -4691,6 +4745,7 @@ test_list = [ None, diff_dir_replaced_by_dir, diff_repos_empty_file_addition, diff_missing_tree_conflict_victim, + diff_local_missing_obstruction, ] if __name__ == '__main__': Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/externals_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/externals_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/externals_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/externals_tests.py Wed Aug 21 16:09:43 2013 @@ -3226,6 +3226,43 @@ def update_dir_external_shallow(sbox): '--set-depth=infinity', sbox.ospath('A/B/E')) +@Issue(4411) +@XFail() +def switch_parent_relative_file_external(sbox): + "switch parent-relative file external" + + sbox.build() + + # Create a parent-relative file external in r2 + sbox.simple_propset('svn:externals', '../D/gamma gamma-ext', 'A/B') + sbox.simple_commit() + sbox.simple_update() + + # Create a branch that contains the file external + sbox.simple_copy('A', 'A_copy') + sbox.simple_commit() + sbox.simple_update() + + # Check out A/B_copy to a new working copy + branch_wc = sbox.add_wc_path("branch") + branch_url = sbox.repo_url + '/A_copy' + svntest.actions.run_and_verify_svn(None, None, [], + 'checkout', branch_url, + branch_wc) + + # Rename the branch + sbox.simple_move('A_copy', 'A_copy2') + sbox.simple_commit() + + # Switch the branch working copy to the new branch URL + new_branch_url = sbox.repo_url + '/A_copy2' + svntest.actions.run_and_verify_svn(None, None, [], + 'switch', new_branch_url, + branch_wc) + + # Bug: The branch working copy can no longer be updated. + svntest.actions.run_and_verify_svn(None, None, [], + 'update', branch_wc) ######################################################################## # Run the tests @@ -3279,6 +3316,7 @@ test_list = [ None, move_with_file_externals, pinned_externals, update_dir_external_shallow, + switch_parent_relative_file_external, ] if __name__ == '__main__': Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/getopt_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/getopt_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/getopt_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/getopt_tests.py Wed Aug 21 16:09:43 2013 @@ -72,6 +72,7 @@ del_lines_res = [ re.compile(r"\* ra_(neon|local|svn|serf) :"), re.compile(r" - handles '(https?|file|svn)' scheme"), re.compile(r" - with Cyrus SASL authentication"), + re.compile(r" - using serf \d+\.\d+\.\d+"), re.compile(r"\* fs_(base|fs) :"), ] Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout Wed Aug 21 16:09:43 2013 @@ -45,6 +45,7 @@ Available subcommands: unlock update (up) upgrade + youngest Subversion is a tool for version control. For additional information, see http://subversion.apache.org/ Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout Wed Aug 21 16:09:43 2013 @@ -45,6 +45,7 @@ Available subcommands: unlock update (up) upgrade + youngest Subversion is a tool for version control. For additional information, see http://subversion.apache.org/ Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/history_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/history_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/history_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/history_tests.py Wed Aug 21 16:09:43 2013 @@ -189,20 +189,17 @@ def cat_avoids_false_identities(sbox): svntest.main.run_svn(None, 'del', iota_path) svntest.main.file_append(iota_path, "YOU SHOULD NOT SEE THIS\n") svntest.main.run_svn(None, 'add', iota_path) - svntest.main.run_svn(None, 'ci', '-m', 'log msg', - wc_dir) + sbox.simple_commit(message='log msg') svntest.main.run_svn(None, 'up', wc_dir) # r3 svntest.main.run_svn(None, 'del', iota_path) - svntest.main.run_svn(None, 'ci', '-m', 'log msg', - wc_dir) + sbox.simple_commit(message='log msg') svntest.main.run_svn(None, 'up', wc_dir) # r4 svntest.main.run_svn(None, 'cp', iota_url + '@1', wc_dir) - svntest.main.run_svn(None, 'ci', '-m', 'log msg', - wc_dir) + sbox.simple_commit(message='log msg') svntest.main.run_svn(None, 'up', wc_dir) # 'svn cat -r2 iota' should error, because the line of history Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/info_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/info_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/info_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/info_tests.py Wed Aug 21 16:09:43 2013 @@ -526,6 +526,11 @@ def binary_tree_conflict(sbox): }] svntest.actions.run_and_verify_info(expected_info, iota) + expected_info = [{ + 'Path' : '%s' % re.escape(wc_dir), + }] + svntest.actions.run_and_verify_info(expected_info, wc_dir) + def relpath_escaping(sbox): "relpath escaping should be usable as-is" Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/lock_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/lock_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/lock_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/lock_tests.py Wed Aug 21 16:09:43 2013 @@ -1500,7 +1500,7 @@ def verify_path_escaping(sbox): svntest.main.run_svn(None, 'add', file1, file2, file3) - svntest.main.run_svn(None, 'ci', '-m', 'commit', wc_dir) + sbox.simple_commit(message='commit') svntest.main.run_svn(None, 'lock', '-m', 'lock 1', file1) svntest.main.run_svn(None, 'lock', '-m', 'lock 2', sbox.repo_url + '/file%20%232') @@ -1815,6 +1815,81 @@ def lock_unlock_deleted(sbox): expected_status.tweak('A/mu', writelocked=None) svntest.actions.run_and_verify_status(wc_dir, expected_status) +@Issue(4369) +def commit_stolen_lock(sbox): + "commit with a stolen lock" + + sbox.build() + wc_dir = sbox.wc_dir + + sbox.simple_append('A/mu', 'zig-zag') + sbox.simple_lock('A/mu') + + expected_output = '\'mu\' locked by user \'jrandom\'.' + svntest.actions.run_and_verify_svn(None, expected_output, [], + 'lock', '--force', + sbox.repo_url + '/A/mu') + + expected_status = svntest.actions.get_virginal_state(wc_dir, 1) + expected_status.tweak('A/mu', status='M ', writelocked='T') + err_re = "(.*E160037: Cannot verify lock on path '/A/mu')|" + \ + "(.*E160038: '/.*/A/mu': no lock token available)" + svntest.actions.run_and_verify_commit(wc_dir, + [], + expected_status, + err_re, + wc_dir) + +# When removing directories, the locks of contained files were not +# correctly removed from the working copy database, thus they later +# magically reappeared when new files or directories with the same +# pathes were added. +@Issue(4364) +def drop_locks_on_parent_deletion(sbox): + "drop locks when the parent is deleted" + + sbox.build() + wc_dir = sbox.wc_dir + + # lock some files, and remove them. + sbox.simple_lock('A/B/lambda') + sbox.simple_lock('A/B/E/alpha') + sbox.simple_lock('A/B/E/beta') + sbox.simple_rm('A/B') + + expected_status = svntest.actions.get_virginal_state(wc_dir, 1) + expected_status.remove_subtree('A/B') + + svntest.actions.run_and_verify_commit(wc_dir, + [], + expected_status, + None, + wc_dir) + + # now re-add entities to the deleted pathes. + sbox.simple_mkdir('A/B') + sbox.simple_add_text('new file replacing old file', 'A/B/lambda') + sbox.simple_add_text('file replacing former dir', 'A/B/F') + # The bug also resurrected locks on directories when their path + # matched a former file. + sbox.simple_mkdir('A/B/E', 'A/B/E/alpha') + + expected_status = svntest.actions.get_virginal_state(wc_dir, 1) + expected_status.tweak('A/B', + 'A/B/E', + 'A/B/E/alpha', + 'A/B/F', + 'A/B/lambda', + wc_rev='3') + expected_status.remove('A/B/E/beta') + + svntest.actions.run_and_verify_commit(wc_dir, + [], + expected_status, + None, + wc_dir) + + ######################################################################## # Run the tests @@ -1866,6 +1941,8 @@ test_list = [ None, lock_multi_wc, locks_stick_over_switch, lock_unlock_deleted, + commit_stolen_lock, + drop_locks_on_parent_deletion, ] if __name__ == '__main__': Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/log_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/log_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/log_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/log_tests.py Wed Aug 21 16:09:43 2013 @@ -33,7 +33,7 @@ from svntest import wc from svntest.main import server_has_mergeinfo from svntest.main import SVN_PROP_MERGEINFO -from merge_tests import set_up_branch +from svntest.mergetrees import set_up_branch from diff_tests import make_diff_header, make_no_diff_deleted_header # (abbreviation) @@ -1875,14 +1875,12 @@ def merge_sensitive_log_reverse_merges(s # Merge -c3,5 from A to A_COPY, commit as r7 svntest.main.run_svn(None, 'up', wc_dir) svntest.main.run_svn(None, 'merge', '-c3,5', A_path, A_COPY_path) - svntest.main.run_svn(None, 'ci', '-m', 'Merge -c3,5 from A to A_COPY', - wc_dir) + sbox.simple_commit(message='Merge -c3,5 from A to A_COPY') # Merge -c-3,-5,4,6 from A to A_COPY, commit as r8 svntest.main.run_svn(None, 'up', wc_dir) svntest.main.run_svn(None, 'merge', '-c-3,4,-5,6', A_path, A_COPY_path) - svntest.main.run_svn(None, 'ci', '-m', 'Merge -c-3,-5,4,6 from A to A_COPY', - wc_dir) + sbox.simple_commit(message='Merge -c-3,-5,4,6 from A to A_COPY') # Update so svntest.main.run_svn(None, 'up', wc_dir) @@ -1938,58 +1936,55 @@ def merge_sensitive_log_ignores_cyclic_m # Make an edit on the "branch" to A_COPY/mu, commit as r7. svntest.main.file_write(mu_COPY_path, "Branch edit.\n") - svntest.main.run_svn(None, 'ci', '-m', 'Branch edit', wc_dir) + sbox.simple_commit(message='Branch edit') # Make an edit on both the "trunk" and the "branch", commit as r8. svntest.main.file_write(chi_path, "Trunk edit.\n") svntest.main.file_write(tau_COPY_path, "Branch edit.\n") - svntest.main.run_svn(None, 'ci', '-m', 'Branch and trunk edits in one rev', - wc_dir) + sbox.simple_commit(message='Branch and trunk edits in one rev') # Sync merge A to A_COPY, commit as r9 svntest.main.run_svn(None, 'up', wc_dir) svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path) - svntest.main.run_svn(None, 'ci', '-m', 'Sync merge A to A_COPY', wc_dir) + sbox.simple_commit(message='Sync merge A to A_COPY') # Reintegrate A_COPY to A, commit as r10 svntest.main.run_svn(None, 'up', wc_dir) svntest.main.run_svn(None, 'merge', '--reintegrate', sbox.repo_url + '/A_COPY', A_path) - svntest.main.run_svn(None, 'ci', '-m', 'Reintegrate A_COPY to A', wc_dir) + sbox.simple_commit(message='Reintegrate A_COPY to A') # Do a --record-only merge of r10 from A to A_COPY, commit as r11. # This will allow us to continue using the branch without deleting it. svntest.main.run_svn(None, 'up', wc_dir) svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path) - svntest.main.run_svn(None, 'ci', '-m', - '--record-only merge r10 from A to A_COPY', wc_dir) + sbox.simple_commit(message='--record-only merge r10 from A to A_COPY') # Make an edit on the "branch"; add A_COPY/C and A_COPY/C/Z/nu, # commit as r12. svntest.main.run_svn(None, 'mkdir', Z_COPY_path) svntest.main.file_write(nu_COPY_path, "A new branch file.\n") svntest.main.run_svn(None, 'add', nu_COPY_path) - svntest.main.run_svn(None, 'ci', '-m', 'Branch edit: Add a subtree', wc_dir) + sbox.simple_commit(message='Branch edit: Add a subtree') # Make an edit on the "trunk"; add A/C/X and A/C/X/kappa, # commit as r13. svntest.main.run_svn(None, 'mkdir', X_path) svntest.main.file_write(kappa_path, "A new trunk file.\n") svntest.main.run_svn(None, 'add', kappa_path) - svntest.main.run_svn(None, 'ci', '-m', 'Trunk edit: Add a subtree', wc_dir) + sbox.simple_commit(message='Trunk edit: Add a subtree') svntest.main.run_svn(None, 'up', wc_dir) # Sync merge A to A_COPY, commit as r14 svntest.main.run_svn(None, 'up', wc_dir) svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path) - svntest.main.run_svn(None, 'ci', '-m', 'Sync merge A to A_COPY', wc_dir) + sbox.simple_commit(message='Sync merge A to A_COPY') # Reintegrate A_COPY to A, commit as r15 svntest.main.run_svn(None, 'up', wc_dir) svntest.main.run_svn(None, 'merge', '--reintegrate', sbox.repo_url + '/A_COPY', A_path) - svntest.main.run_svn(None, 'ci', '-m', '2nd reintegrate of A_COPY to A', - wc_dir) + sbox.simple_commit(message='2nd reintegrate of A_COPY to A') # Run 'svn log -g A'. We expect to see r13, r10, r6, r5, r4, and r3 only # once, as part of A's own history, not as merged in from A_COPY. @@ -2090,17 +2085,17 @@ def merge_sensitive_log_copied_path_inhe # r3 - Modify a file (A_COPY/D/gamma) on the branch svntest.main.file_write(gamma_COPY_path, "Branch edit.\n") - svntest.main.run_svn(None, 'ci', '-m', 'Branch edit', wc_dir) + sbox.simple_commit(message='Branch edit') # r4 - Reintegrate A_COPY to A svntest.main.run_svn(None, 'up', wc_dir) svntest.main.run_svn(None, 'merge', '--reintegrate', sbox.repo_url + '/A_COPY', A_path) - svntest.main.run_svn(None, 'ci', '-m', 'Reintegrate A_COPY to A', wc_dir) + sbox.simple_commit(message='Reintegrate A_COPY to A') # r5 - Move file modified by reintegrate (A/D/gamma to A/C/gamma). svntest.main.run_svn(None, 'move', old_gamma_path, new_gamma_path) - svntest.main.run_svn(None, 'ci', '-m', 'Move file', wc_dir) + sbox.simple_commit(message='Move file') # 'svn log -g --stop-on-copy ^/A/C/gamma' hould return *only* r5 # Previously this test failed because the change in gamma's inherited Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/merge_authz_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/merge_authz_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/merge_authz_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/merge_authz_tests.py Wed Aug 21 16:09:43 2013 @@ -41,8 +41,8 @@ Issues = svntest.testcase.Issues_deco Issue = svntest.testcase.Issue_deco Wimp = svntest.testcase.Wimp_deco -from merge_tests import set_up_branch -from merge_tests import expected_merge_output +from svntest.mergetrees import set_up_branch +from svntest.mergetrees import expected_merge_output from svntest.main import SVN_PROP_MERGEINFO from svntest.main import write_restrictive_svnserve_conf from svntest.main import write_authz_file @@ -659,7 +659,7 @@ def reintegrate_fails_if_no_root_access( ' U ' + A_COPY_path + '\n']) svntest.actions.run_and_verify_svn(None, expected_output, [], 'merge', sbox.repo_url + '/A', A_COPY_path) - svntest.main.run_svn(None, 'ci', '-m', 'synch A_COPY with A', wc_dir) + sbox.simple_commit(message='synch A_COPY with A') # Update so we are ready for reintegrate. svntest.main.run_svn(None, 'up', wc_dir) Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/merge_automatic_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/merge_automatic_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/merge_automatic_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/merge_automatic_tests.py Wed Aug 21 16:09:43 2013 @@ -43,10 +43,10 @@ Wimp = svntest.testcase.Wimp_deco from svntest.main import SVN_PROP_MERGEINFO from svntest.main import server_has_mergeinfo -from merge_tests import local_path -from merge_tests import expected_merge_output -from merge_tests import svn_merge -from merge_tests import set_up_branch +from svntest.mergetrees import local_path +from svntest.mergetrees import expected_merge_output +from svntest.mergetrees import svn_merge +from svntest.mergetrees import set_up_branch #---------------------------------------------------------------------- Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/merge_reintegrate_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/merge_reintegrate_tests.py?rev=1516196&r1=1516195&r2=1516196&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/merge_reintegrate_tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/merge_reintegrate_tests.py Wed Aug 21 16:09:43 2013 @@ -44,8 +44,8 @@ exp_noop_up_out = svntest.actions.expect from svntest.main import SVN_PROP_MERGEINFO from svntest.main import server_has_mergeinfo -from merge_tests import set_up_branch -from merge_tests import expected_merge_output +from svntest.mergetrees import set_up_branch +from svntest.mergetrees import expected_merge_output #---------------------------------------------------------------------- def run_reintegrate(src_url, tgt_path): @@ -2584,13 +2584,13 @@ def reintegrate_replaced_source(sbox): svntest.main.run_svn(None, 'up', wc_dir) svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path, '-c3') - svntest.main.run_svn(None, 'ci', '-m', 'Merge r3 from A to A_COPY', wc_dir) + sbox.simple_commit(message='Merge r3 from A to A_COPY') # r8 - Merge r4 from A to A_COPY svntest.main.run_svn(None, 'up', wc_dir) svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path, '-c4') - svntest.main.run_svn(None, 'ci', '-m', 'Merge r4 from A to A_COPY', wc_dir) + sbox.simple_commit(message='Merge r4 from A to A_COPY') # r9 - Merge r5 from A to A_COPY. Make an additional edit to # A_COPY/B/E/beta. @@ -2598,7 +2598,7 @@ def reintegrate_replaced_source(sbox): svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path, '-c5') svntest.main.file_write(beta_COPY_path, "Branch edit mistake.\n") - svntest.main.run_svn(None, 'ci', '-m', 'Merge r5 from A to A_COPY', wc_dir) + sbox.simple_commit(message='Merge r5 from A to A_COPY') # r10 - Delete A_COPY and replace it with A_COPY@8. This removes the edit # we made above in r9 to A_COPY/B/E/beta. @@ -2606,19 +2606,17 @@ def reintegrate_replaced_source(sbox): svntest.main.run_svn(None, 'delete', A_COPY_path) svntest.main.run_svn(None, 'copy', sbox.repo_url + '/A_COPY@8', A_COPY_path) - svntest.main.run_svn(None, 'ci', '-m', 'Replace A_COPY with A_COPY@8', - wc_dir) + sbox.simple_commit(message='Replace A_COPY with A_COPY@8') # r11 - Make an edit on A_COPY/mu. svntest.main.file_write(mu_COPY_path, "Branch edit.\n") - svntest.main.run_svn(None, 'ci', '-m', 'Branch edit', - wc_dir) + sbox.simple_commit(message='Branch edit') # r12 - Do a final sync merge of A to A_COPY in preparation for # reintegration. svntest.main.run_svn(None, 'up', wc_dir) svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path) - svntest.main.run_svn(None, 'ci', '-m', 'Sycn A_COPY with A', wc_dir) + sbox.simple_commit(message='Sync A_COPY with A') # Reintegrate A_COPY to A. The resulting mergeinfo should be # '/A_COPY:2-8,10-12' because of the replacement which removed /A_COPY:9