Author: julianfoad Date: Wed Feb 2 13:04:31 2022 New Revision: 1897695 URL: http://svn.apache.org/viewvc?rev=1897695&view=rev Log: On the 'pristines-on-demand' branch: sync with trunk@1897694.
Modified: subversion/branches/pristines-on-demand/ (props changed) subversion/branches/pristines-on-demand/INSTALL subversion/branches/pristines-on-demand/NOTICE subversion/branches/pristines-on-demand/build/run_tests.py subversion/branches/pristines-on-demand/subversion/bindings/swig/python/tests/fs.py subversion/branches/pristines-on-demand/subversion/libsvn_client/conflicts.c subversion/branches/pristines-on-demand/subversion/libsvn_client/merge.c subversion/branches/pristines-on-demand/subversion/libsvn_ra_svn/marshal.c subversion/branches/pristines-on-demand/subversion/libsvn_repos/authz.c subversion/branches/pristines-on-demand/subversion/libsvn_repos/reporter.c subversion/branches/pristines-on-demand/subversion/libsvn_subr/version.c subversion/branches/pristines-on-demand/subversion/libsvn_wc/update_editor.c subversion/branches/pristines-on-demand/subversion/po/it.po subversion/branches/pristines-on-demand/subversion/svn/info-cmd.c subversion/branches/pristines-on-demand/subversion/svn/shelf-cmd.c subversion/branches/pristines-on-demand/subversion/svn/shelf2-cmd.c subversion/branches/pristines-on-demand/subversion/svnadmin/svnadmin.c subversion/branches/pristines-on-demand/subversion/tests/cmdline/basic_tests.py subversion/branches/pristines-on-demand/subversion/tests/cmdline/log_tests.py subversion/branches/pristines-on-demand/subversion/tests/cmdline/pegrev_parse_tests.py subversion/branches/pristines-on-demand/subversion/tests/cmdline/svntest/actions.py subversion/branches/pristines-on-demand/subversion/tests/cmdline/svntest/main.py subversion/branches/pristines-on-demand/subversion/tests/libsvn_diff/diff-diff3-test.c subversion/branches/pristines-on-demand/tools/client-side/bash_completion subversion/branches/pristines-on-demand/tools/dev/unix-build/Makefile.svn Propchange: subversion/branches/pristines-on-demand/ ------------------------------------------------------------------------------ Merged /subversion/trunk:r1892643-1897694 Modified: subversion/branches/pristines-on-demand/INSTALL URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/INSTALL?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/INSTALL (original) +++ subversion/branches/pristines-on-demand/INSTALL Wed Feb 2 13:04:31 2022 @@ -1034,6 +1034,12 @@ II. INSTALLATION Note that you'd make sure to define ZLIB_WINAPI in the ZLib config header and move the lib-file into the zlib root-directory. + Please note that you MUST NOT build ZLib with the included assembler + optimized code. It is known to be buggy, see for example the discussion + https://svn.haxx.se/dev/archive-2013-10/0109.shtml. + This means that you must not define ASMV or ASMINF. Note that the VS + projects in contrib\visualstudio define these in the Debug configuration. + Apache Serf ### Section about Apache Serf might be required/useful to add. @@ -1445,7 +1451,7 @@ IV. PLATFORM-SPECIFIC ISSUES And there's an item about this in the Subversion FAQ: - https://subversion.apache.org/faq.html#windows-xp-server + https://subversion.apache.org/faq.html#windows-xp-server The only known workaround for now is to update to Windows XP SP1 (or higher). Modified: subversion/branches/pristines-on-demand/NOTICE URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/NOTICE?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/NOTICE (original) +++ subversion/branches/pristines-on-demand/NOTICE Wed Feb 2 13:04:31 2022 @@ -1,5 +1,5 @@ Apache Subversion -Copyright 2021 The Apache Software Foundation +Copyright 2022 The Apache Software Foundation This product includes software developed by many people, and distributed under Contributor License Agreements to The Apache Software Foundation Modified: subversion/branches/pristines-on-demand/build/run_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/build/run_tests.py?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/build/run_tests.py (original) +++ subversion/branches/pristines-on-demand/build/run_tests.py Wed Feb 2 13:04:31 2022 @@ -798,10 +798,12 @@ class TestHarness: # ### Even if failure==1 it could be that the test didn't run at all. if test_failed and test_failed != 1: if self.log: - log.write('FAIL: %s: Unknown test failure; see tests.log.\n' % progbase) + log.write('FAIL: %s: Unknown test failure (%s); see tests.log.\n' + % (progbase, test_failed)) log.flush() else: - log.write('FAIL: %s: Unknown test failure.\n' % progbase) + log.write('FAIL: %s: Unknown test failure (%s).\n' + % (progbase, test_failed)) def _run_c_test(self, progabs, progdir, progbase, test_nums, dot_count): 'Run a c test, escaping parameters as required.' Modified: subversion/branches/pristines-on-demand/subversion/bindings/swig/python/tests/fs.py URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/bindings/swig/python/tests/fs.py?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/bindings/swig/python/tests/fs.py (original) +++ subversion/branches/pristines-on-demand/subversion/bindings/swig/python/tests/fs.py Wed Feb 2 13:04:31 2022 @@ -346,13 +346,12 @@ class SubversionFSTestCase(unittest.Test if (isinstance(expected_conflict, bytes) and not isinstance(expected_conflict, str)): expected_conflict = expected_conflict.decode('utf-8') - err = None + new_rev = None conflict = None try: conflict, new_rev = fs.commit_txn(txn, pool) except core.SubversionException as e: - err = e self.assertTrue(hasattr(e, 'conflict_p')) conflict = e.conflict_p if isinstance(conflict, bytes) and not isinstance(conflict, str): @@ -360,41 +359,42 @@ class SubversionFSTestCase(unittest.Test self.assertTrue(hasattr(e, 'new_rev')) new_rev = e.new_rev - if err and err.apr_err == core.SVN_ERR_FS_CONFLICT: - self.assertIsNotNone(expected_conflict, - "commit conflicted at '%s', but no conflict expected" - % conflict if conflict else '(missing conflict info!)') - self.assertIsNotNone(conflict, - "commit conflicted as expected, " - "but no conflict path was returned ('%s' expected)" - % expected_conflict) - if expected_conflict: - self.assertEqual(conflict, expected_conflict, - "commit conflicted at '%s', but expected conflict at '%s'" - % (conflict, expected_conflict)) - - # The svn_fs_commit_txn() API promises to set *NEW_REV to an - # invalid revision number in the case of a conflict. - self.assertEqual(new_rev, core.SVN_INVALID_REVNUM, - "conflicting commit returned valid new revision") - - elif err: - # commit may have succeeded, but always report an error - if new_rev != core.SVN_INVALID_REVNUM: - raise core.SubversionException( - "commit succeeded but something else failed", - err.apr_err, err) + if e.apr_err == core.SVN_ERR_FS_CONFLICT: + self.assertIsNotNone(expected_conflict, + "commit conflicted at '%s', but no conflict expected" + % conflict if conflict else '(missing conflict info!)') + self.assertIsNotNone(conflict, + "commit conflicted as expected, " + "but no conflict path was returned ('%s' expected)" + % expected_conflict) + if expected_conflict: + self.assertEqual(conflict, expected_conflict, + "commit conflicted at '%s', but expected conflict at '%s'" + % (conflict, expected_conflict)) + + # The svn_fs_commit_txn() API promises to set *NEW_REV to an + # invalid revision number in the case of a conflict. + self.assertEqual(new_rev, core.SVN_INVALID_REVNUM, + "conflicting commit returned valid new revision") + else: - raise core.SubversionException( - "commit failed due to something other than conflict", - err.apr_err, err) + # commit may have succeeded, but always report an error + if new_rev != core.SVN_INVALID_REVNUM: + raise core.SubversionException( + "commit succeeded but something else failed", + e.apr_err, e) + else: + raise core.SubversionException( + "commit failed due to something other than conflict", + e.apr_err, e) else: - # err == None, commit should have succeeded + # commit should have succeeded self.assertNotEqual(new_rev, core.SVN_INVALID_REVNUM, "commit failed but no error was returned") self.assertIsNone(expected_conflict, "commit succeeded that was expected to fail at '%s'" % expected_conflict) + return new_rev Modified: subversion/branches/pristines-on-demand/subversion/libsvn_client/conflicts.c URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/libsvn_client/conflicts.c?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/libsvn_client/conflicts.c (original) +++ subversion/branches/pristines-on-demand/subversion/libsvn_client/conflicts.c Wed Feb 2 13:04:31 2022 @@ -7889,7 +7889,7 @@ resolve_merge_incoming_added_dir_merge(s if (details->added_rev == SVN_INVALID_REVNUM) return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL, _("Could not determine when '%s' was " - "added the repository"), + "added to the repository"), svn_dirent_local_style(local_abspath, scratch_pool)); rev1 = rev_below(details->added_rev); Modified: subversion/branches/pristines-on-demand/subversion/libsvn_client/merge.c URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/libsvn_client/merge.c?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/libsvn_client/merge.c (original) +++ subversion/branches/pristines-on-demand/subversion/libsvn_client/merge.c Wed Feb 2 13:04:31 2022 @@ -12948,7 +12948,7 @@ do_automatic_merge_locked(svn_client__co for the root path of the merge). An improvement would be to change find_automatic_merge() to - find the base for each sutree, and then here use the oldest base + find the base for each subtree, and then here use the oldest base among all subtrees. */ apr_array_header_t *merge_sources; svn_ra_session_t *ra_session = NULL; Modified: subversion/branches/pristines-on-demand/subversion/libsvn_ra_svn/marshal.c URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/libsvn_ra_svn/marshal.c?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/libsvn_ra_svn/marshal.c (original) +++ subversion/branches/pristines-on-demand/subversion/libsvn_ra_svn/marshal.c Wed Feb 2 13:04:31 2022 @@ -2786,9 +2786,6 @@ svn_error_t *svn_ra_svn__write_cmd_failu return writebuf_write_literal(conn, pool, ") ) "); } -/* Initializer for static svn_string_t . */ -#define STATIC_SVN_STRING(x) { x, sizeof(x) - 1 } - /* Return a pre-cooked serialized representation for the changed path flags NODE_KIND, TEXT_MODIFIED and PROPS_MODIFIED. If we don't have a suitable pre-cooked string, return an empty string. */ @@ -2798,18 +2795,18 @@ changed_path_flags(svn_node_kind_t node_ svn_boolean_t props_modified) { static const svn_string_t file_flags[4] - = { STATIC_SVN_STRING(" ) ( 4:file false false ) ) "), - STATIC_SVN_STRING(" ) ( 4:file false true ) ) "), - STATIC_SVN_STRING(" ) ( 4:file true false ) ) "), - STATIC_SVN_STRING(" ) ( 4:file true true ) ) ") }; + = { SVN__STATIC_STRING(" ) ( 4:file false false ) ) "), + SVN__STATIC_STRING(" ) ( 4:file false true ) ) "), + SVN__STATIC_STRING(" ) ( 4:file true false ) ) "), + SVN__STATIC_STRING(" ) ( 4:file true true ) ) ") }; static const svn_string_t dir_flags[4] - = { STATIC_SVN_STRING(" ) ( 3:dir false false ) ) "), - STATIC_SVN_STRING(" ) ( 3:dir false true ) ) "), - STATIC_SVN_STRING(" ) ( 3:dir true false ) ) "), - STATIC_SVN_STRING(" ) ( 3:dir true true ) ) ") }; + = { SVN__STATIC_STRING(" ) ( 3:dir false false ) ) "), + SVN__STATIC_STRING(" ) ( 3:dir false true ) ) "), + SVN__STATIC_STRING(" ) ( 3:dir true false ) ) "), + SVN__STATIC_STRING(" ) ( 3:dir true true ) ) ") }; - static const svn_string_t no_flags = STATIC_SVN_STRING(""); + static const svn_string_t no_flags = SVN__STATIC_STRING(""); /* Select the array based on the NODE_KIND. */ const svn_string_t *flags; Modified: subversion/branches/pristines-on-demand/subversion/libsvn_repos/authz.c URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/libsvn_repos/authz.c?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/libsvn_repos/authz.c (original) +++ subversion/branches/pristines-on-demand/subversion/libsvn_repos/authz.c Wed Feb 2 13:04:31 2022 @@ -130,6 +130,30 @@ static svn_object_pool__t *authz_pool = static svn_object_pool__t *filtered_pool = NULL; static svn_atomic_t authz_pool_initialized = FALSE; +/* + * Ensure that we will initialize authz again if the pool which + * our authz caches depend on is cleared. + * + * HTTPD may run pre/post config hooks multiple times and clear + * its global configuration pool which our authz pools depend on. + * This happens in a non-threaded context during HTTPD's intialization + * and HTTPD's main loop, so it is safe to reset static variables here. + * (And any applications which cleared this pool while SVN threads + * were running would crash no matter what.) + * + * See issue #4880, "Use-after-free of object-pools in + * subversion/libsvn_repos/authz.c when used as httpd module" + */ +static apr_status_t +deinit_authz(void *data) +{ + /* The two object pools run their own cleanup handlers. */ + authz_pool = NULL; + filtered_pool = NULL; + authz_pool_initialized = FALSE; + return APR_SUCCESS; +} + /* Implements svn_atomic__err_init_func_t. */ static svn_error_t * synchronized_authz_initialize(void *baton, apr_pool_t *pool) @@ -143,6 +167,7 @@ synchronized_authz_initialize(void *bato SVN_ERR(svn_object_pool__create(&authz_pool, multi_threaded, pool)); SVN_ERR(svn_object_pool__create(&filtered_pool, multi_threaded, pool)); + apr_pool_cleanup_register(pool, NULL, deinit_authz, apr_pool_cleanup_null); return SVN_NO_ERROR; } Modified: subversion/branches/pristines-on-demand/subversion/libsvn_repos/reporter.c URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/libsvn_repos/reporter.c?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/libsvn_repos/reporter.c (original) +++ subversion/branches/pristines-on-demand/subversion/libsvn_repos/reporter.c Wed Feb 2 13:04:31 2022 @@ -47,7 +47,7 @@ the delta between the source and target revs. Spill-buffer content format: we use a simple ad-hoc format to store the - report operations. Each report operation is the concatention of + report operations. Each report operation is the concatenation of the following ("+/-" indicates the single character '+' or '-'; <length> and <revnum> are written out as decimal strings): Modified: subversion/branches/pristines-on-demand/subversion/libsvn_subr/version.c URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/libsvn_subr/version.c?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/libsvn_subr/version.c (original) +++ subversion/branches/pristines-on-demand/subversion/libsvn_subr/version.c Wed Feb 2 13:04:31 2022 @@ -41,7 +41,7 @@ svn_boolean_t svn_ver_compatible(const s const svn_version_t *lib_version) { /* With normal development builds the matching rules are stricter - that for release builds, to avoid inadvertently using the wrong + than for release builds, to avoid inadvertently using the wrong libraries. For backward compatibility testing of development builds one can use --disable-full-version-match to cause a development build to use the release build rules. This allows @@ -143,7 +143,7 @@ svn_version_extended(svn_boolean_t verbo info->build_time = __TIME__; info->build_host = SVN_BUILD_HOST; info->copyright = apr_pstrdup - (pool, _("Copyright (C) 2021 The Apache Software Foundation.\n" + (pool, _("Copyright (C) 2022 The Apache Software Foundation.\n" "This software consists of contributions made by many people;\n" "see the NOTICE file for more information.\n" "Subversion is open source software, see " Modified: subversion/branches/pristines-on-demand/subversion/libsvn_wc/update_editor.c URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/libsvn_wc/update_editor.c?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/libsvn_wc/update_editor.c (original) +++ subversion/branches/pristines-on-demand/subversion/libsvn_wc/update_editor.c Wed Feb 2 13:04:31 2022 @@ -1070,7 +1070,7 @@ window_handler(svn_txdelta_window_t *win /* Find the last-change info within ENTRY_PROPS, and return then in the CHANGED_* parameters. Each parameter will be initialized to its "none" - value, and will contain the relavent info if found. + value, and will contain the relevant info if found. CHANGED_AUTHOR will be allocated in RESULT_POOL. SCRATCH_POOL will be used for some temporary allocations. Modified: subversion/branches/pristines-on-demand/subversion/po/it.po URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/po/it.po?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/po/it.po (original) +++ subversion/branches/pristines-on-demand/subversion/po/it.po Wed Feb 2 13:04:31 2022 @@ -4214,10 +4214,6 @@ msgstr "" msgid "authorization failed: %s" msgstr "autorizzazione non riuscita: %s" -#: ../libsvn_ra_neon/util.c:630 -msgid "authorization failed" -msgstr "autorizzazione fallita" - #: ../libsvn_ra_neon/util.c:635 msgid "could not connect to server" msgstr "non ho potuto connettermi al server" Modified: subversion/branches/pristines-on-demand/subversion/svn/info-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/svn/info-cmd.c?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/svn/info-cmd.c (original) +++ subversion/branches/pristines-on-demand/subversion/svn/info-cmd.c Wed Feb 2 13:04:31 2022 @@ -46,6 +46,8 @@ #include "svn_private_config.h" #include "cl-conflicts.h" +#include "private/svn_string_private.h" + /*** Code. ***/ @@ -376,26 +378,24 @@ typedef struct info_item_map_t const info_item_t print_what; } info_item_map_t; -#define MAKE_STRING(x) { x, sizeof(x) - 1 } static const info_item_map_t info_item_map[] = { - { MAKE_STRING("kind"), info_item_kind }, - { MAKE_STRING("url"), info_item_url }, - { MAKE_STRING("relative-url"), info_item_relative_url }, - { MAKE_STRING("repos-root-url"), info_item_repos_root_url }, - { MAKE_STRING("repos-uuid"), info_item_repos_uuid }, - { MAKE_STRING("repos-size"), info_item_repos_size }, - { MAKE_STRING("revision"), info_item_revision }, - { MAKE_STRING("last-changed-revision"), - info_item_last_changed_rev }, - { MAKE_STRING("last-changed-date"), info_item_last_changed_date }, - { MAKE_STRING("last-changed-author"), info_item_last_changed_author }, - { MAKE_STRING("wc-root"), info_item_wc_root }, - { MAKE_STRING("schedule"), info_item_schedule }, - { MAKE_STRING("depth"), info_item_depth }, - { MAKE_STRING("changelist"), info_item_changelist }, + { SVN__STATIC_STRING("kind"), info_item_kind }, + { SVN__STATIC_STRING("url"), info_item_url }, + { SVN__STATIC_STRING("relative-url"), info_item_relative_url }, + { SVN__STATIC_STRING("repos-root-url"), info_item_repos_root_url }, + { SVN__STATIC_STRING("repos-uuid"), info_item_repos_uuid }, + { SVN__STATIC_STRING("repos-size"), info_item_repos_size }, + { SVN__STATIC_STRING("revision"), info_item_revision }, + { SVN__STATIC_STRING("last-changed-revision"), + info_item_last_changed_rev }, + { SVN__STATIC_STRING("last-changed-date"), info_item_last_changed_date }, + { SVN__STATIC_STRING("last-changed-author"), info_item_last_changed_author }, + { SVN__STATIC_STRING("wc-root"), info_item_wc_root }, + { SVN__STATIC_STRING("schedule"), info_item_schedule }, + { SVN__STATIC_STRING("depth"), info_item_depth }, + { SVN__STATIC_STRING("changelist"), info_item_changelist }, }; -#undef MAKE_STRING static const apr_size_t info_item_map_len = (sizeof(info_item_map) / sizeof(info_item_map[0])); Modified: subversion/branches/pristines-on-demand/subversion/svn/shelf-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/svn/shelf-cmd.c?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/svn/shelf-cmd.c (original) +++ subversion/branches/pristines-on-demand/subversion/svn/shelf-cmd.c Wed Feb 2 13:04:31 2022 @@ -897,7 +897,7 @@ svn_cl__shelf_shelve(apr_getopt_t *os, else SVN_ERR(err); - if (! opt_state->quiet) + if (! opt_state->quiet) { if (opt_state->keep_local) SVN_ERR(svn_cmdline_printf(pool, Modified: subversion/branches/pristines-on-demand/subversion/svn/shelf2-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/svn/shelf2-cmd.c?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/svn/shelf2-cmd.c (original) +++ subversion/branches/pristines-on-demand/subversion/svn/shelf2-cmd.c Wed Feb 2 13:04:31 2022 @@ -897,7 +897,7 @@ svn_cl__shelf_shelve(apr_getopt_t *os, else SVN_ERR(err); - if (! opt_state->quiet) + if (! opt_state->quiet) { if (opt_state->keep_local) SVN_ERR(svn_cmdline_printf(pool, Modified: subversion/branches/pristines-on-demand/subversion/svnadmin/svnadmin.c URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/svnadmin/svnadmin.c?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/svnadmin/svnadmin.c (original) +++ subversion/branches/pristines-on-demand/subversion/svnadmin/svnadmin.c Wed Feb 2 13:04:31 2022 @@ -352,7 +352,8 @@ static const svn_opt_subcommand_desc3_t "2. Delete the property NAME on transaction TXN.\n" )}, {'r', 't', svnadmin__use_pre_revprop_change_hook, - svnadmin__use_post_revprop_change_hook} }, + svnadmin__use_post_revprop_change_hook}, + { {'r', "specify revision number ARG"} } }, {"deltify", subcommand_deltify, {0}, {N_( "usage: svnadmin deltify [-r LOWER[:UPPER]] REPOS_PATH\n" @@ -541,7 +542,8 @@ static const svn_opt_subcommand_desc3_t "The size includes revision properties and excludes FSFS indexes.\n" )}, {'r', 'q', 'M'}, - { {'q', "print only the size and a newline"} } }, + { {'r', "specify revision number ARG"}, + {'q', "print only the size and a newline"} }, }, {"rmlocks", subcommand_rmlocks, {0}, {N_( "usage: svnadmin rmlocks REPOS_PATH LOCKED_PATH...\n" @@ -570,7 +572,8 @@ static const svn_opt_subcommand_desc3_t "NOTE: Revision properties are not versioned, so this command will\n" "overwrite the previous log message.\n" )}, - {'r', svnadmin__bypass_hooks} }, + {'r', svnadmin__bypass_hooks}, + { {'r', "specify revision number ARG"} }, }, {"setrevprop", subcommand_setrevprop, {0}, {N_( "usage: 1. svnadmin setrevprop REPOS_PATH -r REVISION NAME FILE\n" @@ -588,7 +591,8 @@ static const svn_opt_subcommand_desc3_t "2. Set the property NAME on transaction TXN to the contents of FILE.\n" )}, {'r', 't', svnadmin__use_pre_revprop_change_hook, - svnadmin__use_post_revprop_change_hook} }, + svnadmin__use_post_revprop_change_hook}, + { {'r', "specify revision number ARG"} }, }, {"setuuid", subcommand_setuuid, {0}, {N_( "usage: svnadmin setuuid REPOS_PATH [NEW_UUID]\n" Modified: subversion/branches/pristines-on-demand/subversion/tests/cmdline/basic_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/tests/cmdline/basic_tests.py?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/tests/cmdline/basic_tests.py (original) +++ subversion/branches/pristines-on-demand/subversion/tests/cmdline/basic_tests.py Wed Feb 2 13:04:31 2022 @@ -3244,6 +3244,42 @@ def filtered_ls_top_level_path(sbox): exit_code, output, error = svntest.actions.run_and_verify_svn( [], [], 'ls', f_path, '--search=*/*', *extra_opts) +def keep_local_reverted_properly(sbox): + "rm --keep-local, /bin/rm, revert" + + sbox.build(read_only=True) + wc_dir = sbox.wc_dir + + lambda_path = sbox.ospath('A/B/lambda') + E_path = sbox.ospath('A/B/E') + targets = [ lambda_path, E_path ] + + # Modify + sbox.simple_append('A/B/lambda', "added text\n") + svntest.main.run_svn(None, 'ps', 'k', 'v', E_path) + + # Schedule for removal + svntest.main.run_svn(None, 'rm', '--keep-local', *targets) + + # Remove from disk + os.unlink(lambda_path) + shutil.rmtree(E_path) + + # Revert + svntest.main.run_svn(None, 'revert', *targets) + + # Check that the modifications are absent + # + # alpha and beta are still scheduled for deletion because 'revert' doesn't + # recurse by default. + expected_disk = svntest.main.greek_state.copy() + expected_disk.remove('A/B/E/alpha', 'A/B/E/beta') + expected_output = svntest.actions.get_virginal_state(wc_dir, 1) + expected_output.tweak('A/B/E/alpha', 'A/B/E/beta', status='D ') + # + svntest.actions.verify_disk(sbox.wc_dir, expected_disk, check_props=True) + svntest.actions.run_and_verify_status(wc_dir, expected_output) + ######################################################################## # Run the tests @@ -3320,6 +3356,7 @@ test_list = [ None, null_update_last_changed_revision, null_prop_update_last_changed_revision, filtered_ls_top_level_path, + keep_local_reverted_properly, ] if __name__ == '__main__': Modified: subversion/branches/pristines-on-demand/subversion/tests/cmdline/log_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/tests/cmdline/log_tests.py?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/tests/cmdline/log_tests.py (original) +++ subversion/branches/pristines-on-demand/subversion/tests/cmdline/log_tests.py Wed Feb 2 13:04:31 2022 @@ -2816,6 +2816,59 @@ def log_with_merge_history_and_search(sb if count(output, "<logentry") != count(output, "</logentry"): raise svntest.Failure("Apparently invalid XML in " + repr(output)) +@XFail(svntest.main.is_ra_type_file) +@Issue(4856) +def log_xml_with_merge_history(sbox): + "log --use-merge-history --xml" + + sbox.build() + + # r2-r4: create branches + sbox.simple_repo_copy('A', 'A2') + sbox.simple_repo_copy('A', 'A3') + sbox.simple_repo_copy('A', 'A4') + + # r5: mod in trunk + sbox.simple_append('A/mu', 'line 2') + sbox.simple_commit(message='r5: mod') + sbox.simple_update() + + # r6-r7: merge A=>A2, A2=>A3 + svntest.main.run_svn(None, 'merge', '-c', '5', sbox.repo_url + '/A', sbox.ospath('A2')) + sbox.simple_commit(message='r6: merge A=>A2') + sbox.simple_update() + svntest.main.run_svn(None, 'merge', '-c', '6', sbox.repo_url + '/A2', sbox.ospath('A3')) + sbox.simple_commit(message='r7: merge A2=>A3') + sbox.simple_update() + + # r8: add file in A3 + xi_path = os.path.join(sbox.wc_dir, 'A3/xi') + svntest.main.file_write(xi_path, "This is the file 'A3/xi'.\n") + svntest.main.run_svn(None, 'add', xi_path) + sbox.simple_commit(message='r8: add A3/xi') + sbox.simple_update() + + # r9: merge A3=>A4 + svntest.main.run_svn(None, 'merge', '-r', '6:8', sbox.repo_url + '/A3', sbox.ospath('A4')) + sbox.simple_commit(message='r9: merge A3=>A4') + sbox.simple_update() + + # Helper function + def count(haystack, needle): + """Return the number of times the string NEEDLE occurs in the string + HAYSTACK.""" + return len(haystack.split(needle)) - 1 + + # Check the output is valid + # ### Since the test is currently XFail, we only smoke test the output. + # ### When fixing this test to PASS, extend this validation. + _, output, _ = svntest.main.run_svn(None, 'log', '--xml', '-g', '-r', '8:9', + sbox.ospath('A4')) + + output = '\n'.join(output) + if count(output, "<logentry") != count(output, "</logentry"): + raise svntest.Failure("Apparently invalid XML in " + repr(output)) + ######################################################################## # Run the tests @@ -2867,6 +2920,7 @@ test_list = [ None, log_revision_move_copy, log_on_deleted_deep, log_with_merge_history_and_search, + log_xml_with_merge_history, ] if __name__ == '__main__': Modified: subversion/branches/pristines-on-demand/subversion/tests/cmdline/pegrev_parse_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/tests/cmdline/pegrev_parse_tests.py?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/tests/cmdline/pegrev_parse_tests.py (original) +++ subversion/branches/pristines-on-demand/subversion/tests/cmdline/pegrev_parse_tests.py Wed Feb 2 13:04:31 2022 @@ -52,7 +52,7 @@ Item = wc.StateItem # commands, because the parser may have (and as of this writing does have) # edge-case bugs that we can only expose in this way. Therefore, these helpers # ensure that we run 'svn' with the CWD at the root of the working copy. -def run_svn(sbox, expected_status, expected_stderr, *varargs): +def run_svn_at_wcdir(sbox, expected_status, expected_stderr, *varargs): if expected_stderr is None: expected_stderr = [] @@ -96,8 +96,8 @@ def do_add_file(sbox, dst, dst_cmdline, expected_status.add({dst: Item(status='A ', wc_rev='-')}) main.file_write(sbox.ospath(dst), "This is file '" + dst + "'.") - run_svn(sbox, expected_status, expected_stderr, - 'add', dst_cmdline) + run_svn_at_wcdir(sbox, expected_status, expected_stderr, + 'add', dst_cmdline) def do_add_file_e(sbox, dst, dst_cmdline, expected_stderr=None): "like do_add_file() but with an empty sandbox" @@ -109,8 +109,8 @@ def do_make_dir(sbox, dst, dst_cmdline, if expected_status is not None: expected_status.add({dst: Item(status='A ', wc_rev='-')}) - run_svn(sbox, expected_status, expected_stderr, - 'mkdir', dst_cmdline) + run_svn_at_wcdir(sbox, expected_status, expected_stderr, + 'mkdir', dst_cmdline) def do_make_dir_e(sbox, dst, dst_cmdline, expected_stderr=None): "like do_make_dir() but with an empty sandbox" @@ -121,8 +121,8 @@ def do_remove(sbox, dst, dst_cmdline, ex if expected_status is not None and dst in expected_status.desc: expected_status.tweak(dst, status='D ') - run_svn(sbox, expected_status, expected_stderr, - 'remove', dst_cmdline) + run_svn_at_wcdir(sbox, expected_status, expected_stderr, + 'remove', dst_cmdline) def do_rename(sbox, src, src_cmdline, dst, dst_cmdline, expected_stderr=None): @@ -132,8 +132,8 @@ def do_rename(sbox, src, src_cmdline, ds expected_status.add({dst: Item(status='A ', copied='+', moved_from=src, wc_rev='-')}) - run_svn(sbox, expected_status, expected_stderr, - 'rename', src_cmdline, dst_cmdline) + run_svn_at_wcdir(sbox, expected_status, expected_stderr, + 'rename', src_cmdline, dst_cmdline) ###################################################################### Modified: subversion/branches/pristines-on-demand/subversion/tests/cmdline/svntest/actions.py URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/tests/cmdline/svntest/actions.py?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/tests/cmdline/svntest/actions.py (original) +++ subversion/branches/pristines-on-demand/subversion/tests/cmdline/svntest/actions.py Wed Feb 2 13:04:31 2022 @@ -2134,9 +2134,10 @@ def disable_revprop_changes(repo_dir): main.create_python_hook_script(hook_path, 'import sys\n' 'sys.stderr.write("pre-revprop-change %s" %' - ' " ".join(sys.argv[1:]))\n' + ' " ".join(sys.argv[2:]))\n' 'sys.exit(1)\n', cmd_alternative= + '@shift\n' '@echo pre-revprop-change %* 1>&2\n' '@exit 1\n') Modified: subversion/branches/pristines-on-demand/subversion/tests/cmdline/svntest/main.py URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/tests/cmdline/svntest/main.py?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/tests/cmdline/svntest/main.py (original) +++ subversion/branches/pristines-on-demand/subversion/tests/cmdline/svntest/main.py Wed Feb 2 13:04:31 2022 @@ -616,6 +616,13 @@ def run_command_stdin(command, error_exp start = time.time() + if sys.version_info >= (3, 0): + # Don't include 'bytes' since spawn_process() would raise. + assert all(isinstance(arg, (str, int)) for arg in varargs) + else: + # Include 'unicode' since svnrdump_tests pass b''.decode(). + assert all(isinstance(arg, (str, unicode, int)) for arg in varargs) + exit_code, stdout_lines, stderr_lines = spawn_process(command, bufsize, binary_mode, @@ -637,8 +644,7 @@ def run_command_stdin(command, error_exp break # Does the server leak the repository on-disk path? # (prop_tests-12 installs a hook script that does that intentionally) - if any(map(_line_contains_repos_diskpath, lines)) \ - and not any(map(lambda arg: 'prop_tests-12' in arg, varargs)): + if any(map(_line_contains_repos_diskpath, lines)): raise Failure("Repository diskpath in %s: %r" % (name, lines)) valgrind_diagnostic = False Modified: subversion/branches/pristines-on-demand/subversion/tests/libsvn_diff/diff-diff3-test.c URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/subversion/tests/libsvn_diff/diff-diff3-test.c (original) +++ subversion/branches/pristines-on-demand/subversion/tests/libsvn_diff/diff-diff3-test.c Wed Feb 2 13:04:31 2022 @@ -28,6 +28,8 @@ #include "svn_pools.h" #include "svn_utf.h" +#include "private/svn_string_private.h" + /* Used to terminate lines in large multi-line string literals. */ #define NL APR_EOL_STR @@ -2071,15 +2073,13 @@ test_three_way_merge_conflict_styles(apr } -#define MAKE_STRING(cstr) { (cstr), sizeof((cstr))-1 } - static svn_error_t * test_diff4(apr_pool_t *pool) { svn_diff_t *diff; svn_stream_t *actual, *expected; svn_boolean_t same; - static svn_string_t B2 = MAKE_STRING( + static svn_string_t B2 = SVN__STATIC_STRING( "int main (int argc, char **argv)\n" "{\n" " /* line minus-five of context */\n" @@ -2094,7 +2094,7 @@ test_diff4(apr_pool_t *pool) " /* line plus-four of context */\n" " /* line plus-five of context */\n" "}\n"); - static svn_string_t B2new = MAKE_STRING( + static svn_string_t B2new = SVN__STATIC_STRING( "int main (int argc, char **argv)\n" "{\n" " /* line minus-five of context */\n" @@ -2109,7 +2109,7 @@ test_diff4(apr_pool_t *pool) " /* line plus-four of context */\n" " /* line plus-five of context */\n" "}\n"); - static svn_string_t T1 = MAKE_STRING( + static svn_string_t T1 = SVN__STATIC_STRING( "int main (int argc, char **argv)\n" "{\n" " /* line minus-five of context */\n" @@ -2124,7 +2124,7 @@ test_diff4(apr_pool_t *pool) " /* line plus-four of context */\n" " /* line plus-five of context */\n" "}\n"); - static svn_string_t T2 = MAKE_STRING( + static svn_string_t T2 = SVN__STATIC_STRING( "#include <stdio.h>\n" "\n" "int main (int argc, char **argv)\n" @@ -2141,7 +2141,7 @@ test_diff4(apr_pool_t *pool) " /* line plus-four of context */\n" " /* line plus-five of context */\n" "}\n"); - static svn_string_t T3 = MAKE_STRING( + static svn_string_t T3 = SVN__STATIC_STRING( "#include <stdio.h>\n" "\n" "int main (int argc, char **argv)\n" Modified: subversion/branches/pristines-on-demand/tools/client-side/bash_completion URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/tools/client-side/bash_completion?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/tools/client-side/bash_completion (original) +++ subversion/branches/pristines-on-demand/tools/client-side/bash_completion Wed Feb 2 13:04:31 2022 @@ -1127,7 +1127,7 @@ _svn() COMPREPLY=( $( compgen -W "$cmdOpts" -- $cur ) ) return 0 } -complete -F _svn -o default -X '@(*/.svn|*/.svn/|.svn|.svn/)' svn +complete -F _svn -o bashdefault -o default -X '@(*/.svn|*/.svn/|.svn|.svn/)' svn _svnadmin () { @@ -1280,7 +1280,7 @@ _svnadmin () return 0 } -complete -F _svnadmin -o default svnadmin +complete -F _svnadmin -o bashdefault -o default svnadmin _svndumpfilter () { @@ -1354,7 +1354,7 @@ _svndumpfilter () return 0 } -complete -F _svndumpfilter -o default svndumpfilter +complete -F _svndumpfilter -o bashdefault -o default svndumpfilter _svnlook () { @@ -1485,7 +1485,7 @@ _svnlook () return 0 } -complete -F _svnlook -o default svnlook +complete -F _svnlook -o bashdefault -o default svnlook _svnsync () { @@ -1568,7 +1568,7 @@ _svnsync () return 0 } -complete -F _svnsync -o default svnsync +complete -F _svnsync -o bashdefault -o default svnsync # reasonable completion for 'svnversion' _svnversion () Modified: subversion/branches/pristines-on-demand/tools/dev/unix-build/Makefile.svn URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand/tools/dev/unix-build/Makefile.svn?rev=1897695&r1=1897694&r2=1897695&view=diff ============================================================================== --- subversion/branches/pristines-on-demand/tools/dev/unix-build/Makefile.svn (original) +++ subversion/branches/pristines-on-demand/tools/dev/unix-build/Makefile.svn Wed Feb 2 13:04:31 2022 @@ -53,6 +53,12 @@ PWD = $(shell pwd) UNAME = $(shell uname) RUBY = $(shell which ruby 2>/dev/null) ifeq ($(RUBY),) +RUBY = $(shell which ruby27 2>/dev/null) +ifeq ($(RUBY),) +RUBY = $(shell which ruby26 2>/dev/null) +ifeq ($(RUBY),) +RUBY = $(shell which ruby25 2>/dev/null) +ifeq ($(RUBY),) RUBY = $(shell which ruby24 2>/dev/null) ifeq ($(RUBY),) RUBY = $(shell which ruby23 2>/dev/null) @@ -73,6 +79,9 @@ endif # 2.1 endif # 2.2 endif # 2.3 endif # 2.4 +endif # 2.5 +endif # 2.6 +endif # 2.7 ifeq ($(UNAME),OpenBSD) # Pick the correct base compiler (ie. clang rather than ancient gcc 4.2.1) @@ -115,7 +124,7 @@ SERF_OLD_VER = 0.3.1 CYRUS_SASL_VER = 2.1.25 SQLITE_VER = 3160200 LIBMAGIC_VER = 5.30 -RUBY_VER = 2.4.4 +RUBY_VER = 2.7.4 BZ2_VER = 1.0.6 PYTHON_VER = 3.7.5 PYTHON2_VER = 2.7.13 @@ -151,7 +160,7 @@ SHA256_${NEON_DIST} = db0bd8cdec329b48f5 SHA256_${CYRUS_SASL_DIST} = 418c16e6240a4f9b637cbe3d62937b9675627bad27c622191d47de8686fe24fe SHA256_${SQLITE_DIST} = 65cc0c3e9366f50c0679c5ccd31432cea894bc4a3e8947dabab88c8693263615 SHA256_${LIBMAGIC_DIST} = 694c2432e5240187524c9e7cf1ec6acc77b47a0e19554d34c14773e43dbbf214 -SHA256_${RUBY_DIST} = 254f1c1a79e4cc814d1e7320bc5bdd995dc57e08727d30a767664619a9c8ae5a +SHA256_${RUBY_DIST} = 3043099089608859fc8cce7f9fdccaa1f53a462457e3838ec3b25a7d609fbc5b SHA256_${BZ2_DIST} = a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd SHA256_${PYTHON_DIST} = 8ecc681ea0600bbfb366f2b173f727b205bb825d93d2f0b286bc4e58d37693da SHA256_${PYTHON2_DIST} = a4f05a0720ce0fd92626f0278b6b433eee9a6173ddf2bced7957dfb599a5ece1 @@ -207,7 +216,7 @@ SERF_OLD_URL = https://svn.apache.org/re SQLITE_URL = https://www.sqlite.org/2017/$(SQLITE_DIST) CYRUS_SASL_URL = https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-${CYRUS_SASL_VER}/$(CYRUS_SASL_DIST) LIBMAGIC_URL = ftp://ftp.astron.com/pub/file/$(LIBMAGIC_DIST) -RUBY_URL = https://cache.ruby-lang.org/pub/ruby/2.4/$(RUBY_DIST) +RUBY_URL = https://cache.ruby-lang.org/pub/ruby/2.7/$(RUBY_DIST) BZ2_URL = https://stsp.name/distfiles/$(BZ2_DIST) PYTHON_URL = https://python.org/ftp/python/$(PYTHON_VER)/$(PYTHON_DIST) PYTHON2_URL = https://python.org/ftp/python/$(PYTHON2_VER)/$(PYTHON2_DIST) @@ -556,6 +565,8 @@ $(GNU_ICONV_OBJDIR)/.retrieved: $(DISTDI cd $(SRCDIR)/libiconv-$(GNU_ICONV_VER) && \ patch -p0 < $(GNU_ICONV_OBJDIR)/lib_encodings.def.diff && \ patch -p0 < $(GNU_ICONV_OBJDIR)/lib_aliases.gperf.diff + cd $(SRCDIR)/libiconv-${GNU_ICONV_VER} && \ + sed -i 's/gcc/${CC}/' Makefile.devel touch $@ # configure gnu-iconv @@ -1239,33 +1250,6 @@ $(RUBY_OBJDIR)/sparc64_buserror.patch: echo >> $@.tmp ' #ifdef STRICT_ALIGNMENT' echo >> $@.tmp ' #if defined(HAVE_TRUE_LONG_LONG) && SIZEOF_LONG_LONG > SIZEOF_VALUE' echo >> $@.tmp ' #define ALIGNMENT_SIZE SIZEOF_LONG_LONG' - echo >> $@.tmp '@@ -2094,7 +2104,8 @@' - echo >> $@.tmp ' unref_destination(iobj, 0);' - echo >> $@.tmp ' REMOVE_ELEM(&iobj->link);' - echo >> $@.tmp ' }' - echo >> $@.tmp '- else if (iobj != diobj && IS_INSN_ID(diobj, jump) &&' - echo >> $@.tmp '+ else if (iobj != diobj && IS_INSN(&diobj->link) &&' - echo >> $@.tmp '+ IS_INSN_ID(diobj, jump) &&' - echo >> $@.tmp ' OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) {' - echo >> $@.tmp ' replace_destination(iobj, diobj);' - echo >> $@.tmp ' remove_unreachable_chunk(iseq, iobj->link.next);' - echo >> $@.tmp '@@ -2136,6 +2147,7 @@' - echo >> $@.tmp ' * L2:' - echo >> $@.tmp ' */' - echo >> $@.tmp ' else if ((piobj = (INSN *)get_prev_insn(iobj)) != 0 &&' - echo >> $@.tmp '+ IS_INSN(&piobj->link) &&' - echo >> $@.tmp ' (IS_INSN_ID(piobj, branchif) ||' - echo >> $@.tmp ' IS_INSN_ID(piobj, branchunless))) {' - echo >> $@.tmp ' if (niobj == (INSN *)get_destination_insn(piobj)) {' - echo >> $@.tmp '@@ -2176,7 +2188,7 @@' - echo >> $@.tmp ' }' - echo >> $@.tmp ' ' - echo >> $@.tmp ' for (;;) {' - echo >> $@.tmp '- if (IS_INSN_ID(nobj, jump)) {' - echo >> $@.tmp '+ if (IS_INSN(&nobj->link) && IS_INSN_ID(nobj, jump)) {' - echo >> $@.tmp ' replace_destination(iobj, nobj);' - echo >> $@.tmp ' }' - echo >> $@.tmp ' else if (prev_dup && IS_INSN_ID(nobj, dup) &&' mv -f $@.tmp $@ ifeq ($(UNAME),OpenBSD)