Checkout Tools
  • last updated 7 hours ago
Constraints: committers
Constraints: files
Constraints: dates
Fix various typos detected by codespell

* libsvn_client/add.c, libsvn_client/blame.c, libsvn_client/commit_util.c,

libsvn_client/conflicts.c, libsvn_client/copy.c, libsvn_client/diff.c,

libsvn_client/export.c, libsvn_client/import.c, libsvn_client/merge.c,

libsvn_client/mergeinfo.c, libsvn_client/mergeinfo.h, libsvn_client/patch.c,

libsvn_client/switch.c, libsvn_client/update.c, libsvn_delta/branch_compat.c,

libsvn_delta/compat.c, libsvn_delta/compose_delta.c, libsvn_delta/svndiff.c,

libsvn_delta/xdelta.c, libsvn_diff/deprecated.c, libsvn_diff/diff_file.c,

libsvn_fs/fs-loader.c, libsvn_fs_base/bdb/locks-table.c, libsvn_fs_base/fs.c,

libsvn_fs_base/key-gen.c, libsvn_fs_base/notes/fs-history,

libsvn_fs_base/reps-strings.c, libsvn_fs_base/tree.c,

libsvn_fs_fs/cached_data.c, libsvn_fs_fs/hotcopy.c, libsvn_fs_fs/index.c,

libsvn_fs_fs/low_level.c, libsvn_fs_fs/pack.c, libsvn_fs_fs/structure,

libsvn_fs_fs/temp_serializer.c, libsvn_fs_fs/transaction.c,

libsvn_fs_fs/tree.c, libsvn_fs_fs/util.h, libsvn_fs_x/cached_data.c,

libsvn_fs_x/caching.c, libsvn_fs_x/hotcopy.c, libsvn_fs_x/id.h,

libsvn_fs_x/index.c, libsvn_fs_x/low_level.c, libsvn_fs_x/pack.c,

libsvn_fs_x/rev_file.c, libsvn_fs_x/structure, libsvn_fs_x/temp_serializer.c,

libsvn_fs_x/transaction.c, libsvn_fs_x/tree.c, libsvn_fs_x/util.h,

libsvn_ra/ra_loader.c, libsvn_ra/ra_loader.h, libsvn_ra/util.c,

libsvn_ra/wrapper_template.h, libsvn_ra_local/ra_plugin.c,

libsvn_ra_serf/commit.c, libsvn_ra_serf/get_file.c,

libsvn_ra_serf/property.c, libsvn_ra_serf/ra_serf.h, libsvn_ra_serf/update.c,

libsvn_ra_serf/util.c, libsvn_ra_svn/client.c, libsvn_ra_svn/cyrus_auth.c,

libsvn_ra_svn/marshal.c, libsvn_repos/authz_parse.c, libsvn_repos/commit.c,

libsvn_repos/compat.c, libsvn_repos/hooks.c, libsvn_repos/load.c,

libsvn_repos/log.c, libsvn_repos/notify.c, libsvn_repos/repos.c,

libsvn_repos/repos.h, libsvn_subr/cache-memcache.c, libsvn_subr/cmdline.c,

libsvn_subr/config_file.c, libsvn_subr/date.c, libsvn_subr/gpg_agent.c,

libsvn_subr/io.c, libsvn_subr/object_pool.c, libsvn_subr/path.c,

libsvn_subr/prompt.c, libsvn_subr/string.c, libsvn_subr/sysinfo.c,

libsvn_subr/temp_serializer.c, libsvn_subr/utf.c, libsvn_subr/utf8proc.c,

libsvn_subr/version.c, libsvn_subr/win32_xlate.c, libsvn_subr/x509parse.c,

libsvn_wc/conflicts.c, libsvn_wc/conflicts.h, libsvn_wc/copy.c,

libsvn_wc/lock.c, libsvn_wc/wc_db.c, libsvn_wc/wc_db.h,


(): Spelling fixes

  1. … 83 more files in changeset.
* everywhere: Run tools/dev/ to remove

trailing whitespace before we branch 1.14.

  1. … 101 more files in changeset.
Followup to r1874093, add Windows-specific argument escaping

Rather than directly using apr_pescape_shell(), use apr_escape_shell() to give

an indication whether escaping is needed. If APR reports no escaping is

needed, simply surround the argument in double-quotes to handle any embedded


When escaping is needed, on Unix we continue to use APR's escaping +

post-processing for whitespace. On Windows, perform the escaping ourselves per

these rules:

1. Surround the string with double-quotes

2. Escape any double-quotes or backslashes preceding a double-quote

3. Escape any metacharacters, including double-quotes, with ^

* subversion/libsvn_subr/cmdline.c

(escape_path): Refactored as above

Happy (not-now-so-)new year, 2020!


* subversion/libsvn_subr/version.c (svn_version_extended):

Bump copyright year to 2020.

  1. … 1 more file in changeset.
Complete the upgrade of array insert/delete functions.

For issue #4840 "Merge assertion failure in svn_sort__array_insert".

This changes all remaining callers, in other areas of Subversion, to use the

new array insert/delete functions that return standard Subversion errors if

inputs are out of bounds, and removes the old versions of those functions.

These are private functions so the public API is not affected.

* subversion/include/private/svn_sorts_private.h

* subversion/libsvn_subr/sorts.c


svn_sort__array_delete): Remove.


svn_sort__array_delete2): Rewrite as the only version, instead of calling

the old version. No functional change.

Elsewhere: update all callers.

  1. … 17 more files in changeset.
Require at least version 1.5 of APR

Since r1874057, the apr_pescape_shell() API is being used to escape filenames

when invoking $SVN_EDITOR. This was added to APR in 1.5.0, released on



(): Document new minimum APR version

* build/generator/

(_find_apr): Bump minimal_apr_version to 1.5.0


(APR_VER_REGEXES): Bump minor version in 1.x regex to 1.5


(APR_VERSION): Specify 1.5.0 as default version

* subversion/include/private/svn_dep_compat.h

(apr_time_from_msec): Removed, since it's provided by APR 1.4.0 or later

* subversion/include/svn_types.h

(apr_hash_this_key, apr_hash_this_key_len, apr_hash_this_val): Remove

prototypes, since they're provide by APR 1.5.0 or later

* subversion/libsvn_subr/iter.c

(hash_do_baton): Remove condition requiring APR 1.4.0 to define this type

(svn_iter_apr_hash): Remove pre-APR 1.4.0 code

(apr_hash_this_key, apr_hash_this_key_len, apr_hash_this_val): Remove

definitions, since they're provided by APR 1.5.0 or later

* subversion/libsvn_subr/pool.c

(apr_pool_create_unmanaged_ex): Remove conditional alias to

apr_pool_create_core_ex, for APR versions < 1.3.3

  1. … 6 more files in changeset.
Followup to r1874057, escape whitespace instead of quoting filename

As danielsh pointed out, only specific characters can be escaped by a backslash

in quoted shell strings. Rather than surrounding the escaped path with double

quotes, post-process the quoted path and manually escape any whitespace that is


* subversion/libsvn_subr/cmdline.c

(escape_path): New function, wrapper around apr_pescape_shell(), which

handles escaping of whitespace.

(svn_cmdline__edit_file_externally, svn_cmdline__edit_string_externally):

Call the new function instead of apr_pescape_shell()

* subversion/tests/cmdline/

(update_accept_conflicts): Include ';' in renamed path ("p; i"), to ensure

non-whitespace escaping is handled correctly.

  1. … 1 more file in changeset.
Escape filenames when invoking $SVN_EDITOR

Per, $SVN_EDITOR is invoked

through the shell instead of directly executed. The user is expected to

properly escape/quote $SVN_EDITOR, but svn was putting the filename directly

into the command without any escaping. This therefore breaks attempts to,

e.g., run the editor from the merge conflict dialog when a path has special


Update locations where we invoke the editor to quote the filename as well as

escape shell special characters using apr_pescape_shell(). The quotes are

needed in addition to the escaping, since apr_pescape_shell() does not escape


* subversion/libsvn_subr/cmdline.c

(svn_cmdline__edit_file_externally, svn_cmdline__edit_string_externally):

Quote and escape, via apr_pescape_shell(), the filename in the command line.

* subversion/tests/cmdline/

(update_accept_conflicts): Rename "A/D/G/pi" to "A/D/G/p i" before performing

the merge, so the test exercises the changes above.

  1. … 1 more file in changeset.
Fix issue #4840 "Merge assertion failure in svn_sort__array_insert".

This replaces the implementation of svn_rangelist_merge2() with a correct

and simpler one.

* subversion/libsvn_subr/mergeinfo.c


rangelist_merge2): Delete.












rangelist_merge): New.

(svn_rangelist_merge2): Adjust to call the new implementation.

* subversion/tests/libsvn_subr/mergeinfo-test.c




test_rangelist_merge_random_semi_c_inputs): Remove XFAIL.

  1. … 1 more file in changeset.
Restore a debug-mode assertion; perform additional validation in debug

mode only.

A follow-up to r1872118.

For issue #4840 "Merge assertion failure in svn_sort__array_insert".

* subversion/libsvn_subr/mergeinfo.c

(rangelist_merge2): Restore a debug-mode assertion.

(svn_rangelist_merge2): Perform additional validation in debug

mode only.

Avoid aborting on assertion failure in the area of mergeinfo calculations.

Instead, raise a catchable assertion error.

If an error occurs in svn_rangelist_merge2(), produce a more detailed error

message to aid in debugging.

Introduce and use 'svn_sort__array_insert2()' which checks its inputs. The

old version of this function was aborting on out-of-range inputs. Introduce

and use 'svn_sort__array_delete2()' likewise, as similar issues may show up

here too. The old version of this function was ignoring calls with

out-of-range inputs. The old versions of both functions are still in use

elsewhere in the Subversion libraries.

For issue #4840, "Merge assertion failure in svn_sort__array_insert".

* subversion/include/private/svn_sorts_private.h,



svn_sort__array_delete2): New.

* subversion/libsvn_client/merge.c


insert_child_to_merge): Allow returning an error.

Everywhere: use svn_sort__array_insert2() and svn_sort__array_delete2().

* subversion/libsvn_subr/mergeinfo.c

(adjust_remaining_ranges): Allow returning an error.

(dual_dump): Replace this old debug helper...

(rangelist_to_string_debug): ... with this new one.

(svn_rangelist_merge2): Extract the body of this function into a local

'rangelist_merge2', leaving the original as an error-checking

wrapper. If an error occurs, report its inputs.

(rangelist_is_sorted): New.

Everywhere: use svn_sort__array_insert2() and svn_sort__array_delete2().

* subversion/tests/libsvn_subr/mergeinfo-test.c

(test_rangelist_merge_random_non_validated_inputs): Expect assertion

failures; ignore them.

(test_funcs): Expect that test to pass now.

  1. … 3 more files in changeset.
Raise an error on trying to convert invalid mergeinfo to a string.

Instead of converting invalid mergeinfo to a diagnostic string (r1872030),

immediately raise an error so as not to risk the diagnostic string finding

its way into versioned data.

A follow-up to r1872030.

For issue #4840, "Merge assertion failure in svn_sort__array_insert".

Suggested by: danielsh

* subversion/libsvn_subr/mergeinfo.c

(range_to_string): Raise an error on invalid input.

(range_to_string_debug): New.

(svn_rangelist__canonicalize): Use range_to_string_debug() within an error


(svn_rangelist_to_string): Update the calls to range_to_string().

Avoid converting invalid mergeinfo to bogus valid-looking mergeinfo.

For issue #4840, "Merge assertion failure in svn_sort__array_insert".

The internal representation of mergeinfo is not supposed to include

empty ranges. If a representation of an empty range did occur, perhaps

due to a bug in mergeinfo processing or improper data passed to an API,

the mergeinfo printing functions produced bogus valid-looking output.

For example, for a range with (.start == .end == 10), it wrote "10-11".

This was very confusing when seen in error messages and debugging.

Instead, print a diagnostic output in the form "[empty-range@10*]".

This output is not intended be accepted as input by the parsing


* subversion/libsvn_subr/mergeinfo.c

(range_to_string): Print diagnostic output instead of bogus output for

an empty range.

Merge the swig-py3 branch to trunk.
  1. … 61 more files in changeset.
Properly identify the newest macOS release in 'svn --version --verbose'.

* subversion/libsvn_subr/sysinfo.c (release_name_from_minor_version):

macOS 10.15.x is called "Catalina".

Fix an issue with the readline implementation for file streams that could

cause excessive memory usage for inputs containing one or multiple \0 bytes.

This is the likely cause of the OOM reported in

(I think that the problem itself is a regression introduced by me in 1.10.)

Note: one thing I noticed while preparing the fix is that our `readline_fn`

functions for different streams have inconsistent behavior if the input data

contains \0 bytes. More specifically, they may return different `line` values,

that may either be truncated at \0 or actually contain the whole data between

EOLs, including \0 bytes. For now, this patch only fixes the excessive memory

usage problem, and I noted this related problem in the test and left it for

future work.

* subversion/libsvn_subr/stream.c

(readline_apr_lf, readline_apr_generic): Reallocate the buffer based on its

current size, instead of calculating the new size based on the already

prealloc'd size. There are no actual benefits in reallocating based on

`blocksize`, and in the described case with \0 bytes doing so also backfires

and may cause excessive allocations due to the actual size of the string

being less than we expect it to. A degenerate case of the erroneous

behavior is ...

* subversion/tests/libsvn_subr/stream-test.c

(test_stream_readline_file_nul): ...exploited in this new test.

(test_funcs): Run new test.

* subversion/tests/libsvn_subr

(): Adjust svn:ignore.

  1. … 2 more files in changeset.
Issue #4828: by default, hide global options too.

* subversion/libsvn_subr/opt.c

(print_command_info3, subcommand_help): Let 'verbose' apply to global options a well.

* subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout

Adjust expected help output.

  1. … 1 more file in changeset.
Issue #4828: remind user they can use '-v' to show experimental subcommands.

* subversion/libsvn_subr/opt.c

(print_generic_help_body3): Show a reminder if experimental subcommands were


Issue #4828: remind user they can use '-v' to show experimental options.

* subversion/libsvn_subr/opt.c

(print_command_info3): Show a reminder if experimental options were


Issue #4828, Hide experimental commands and options by default.

* subversion/libsvn_subr/opt.c


print_generic_help_body3): Show commands and options starting with

'x-' only if new 'with_experimental' option is true.

(print_generic_help): Extracted from 'svn_opt_print_generic_help3', to

take the new 'with_experimental' option.

(subcommand_help): Extracted from 'svn_opt_subcommand_help4', to

take the new 'with_experimental' option.

(svn_opt_print_help5): Let the 'verbose' option control 'with

experimental', when printing help. The 'verbose' option previously was

not used here except for the case of printing version info.

* subversion/svn/svn.c

Let 'help' take the '-v' option.

* subversion/tests/cmdline/getopt_tests_data/svn_help_stdout

* subversion/tests/cmdline/getopt_tests_data/svn--help_stdout

Adjust the expected output.

* tools/dist/

[Accidental change; reverted in 1866189.]

  1. … 4 more files in changeset.
When compiling SQLite, enable the SQLITE_OMIT_WAL compile-time option.

We don't use WAL (write-ahead logging) feature of SQLite, but just keeping it

enabled has a visible I/O performance penalty, because SQLite has to check if

the write-ahead log file is present on disk. In a couple of my experiments,

disabling this feature resulted in a ~10% faster `svn st` on a large working


* subversion/libsvn_subr/sqlite3wrapper.c


When compiling SQLite, set the SQLITE_DEFAULT_MEMSTATUS=0 compile-time option.

This is the recommended option that is not enabled by default. Setting it to

zero avoids using a mutex (and thus suffering a performance penalty) during

every sqlite3_malloc() call, where this mutex is used to properly update the

allocations stats. We don't use sqlite3_status(), so set this option to zero.


* subversion/libsvn_subr/sqlite3wrapper.c


Win32: fix an incorrect error status being propagated to the caller in case

where we fail to stat the destination path while being in the middle of a

failed rename.

So, if we fail to stat the destination in the middle of such rename, propagate

the *original* error. Because overriding the original error with the new one

loses information about the actual cause of failure and may even confuse some

of the callers, who for instance attempt to recover in case of an EACCES,

since they may not be receiving that error at all.

(This is the behavior we had for a long time, even before r1865518, but now

seems to be an appropriate moment to fix that)

* subversion/libsvn_subr/io.c

(win32_file_rename): Use a separate `stat_err` for the case of the failed

GetFileAttributes() call. If we failed to stat the file, return the

original `err` status to the caller.

* subversion/libsvn_subr/io.c

(win32_file_rename): Rename `status` to `err`. This lays the groundwork for

fixing the incorrect error status being propagated to the caller in case

where we fail to stat the destination path while being in the middle of

a failed rename.

Win32: prevent svn_io_file_rename2() from spinning in the retry loop in a

racy case where the rename function clears the read-only attribute from the

destination file, but another thread or process is quick enough to set it

back before the original rename function has a chance to proceed.

Despite sounding like an uncommon case, this may happen when the API is

being used to atomically update the file contents while also altering its

read-only attribute (and where such updates can occur in parallel).

Fix this by including the call that clears the read-only attribute on the

destination into the retry loop instead of calling it only once before


* subversion/libsvn_subr/io.c

(win32_file_rename): Handle EACCES/EEXIST and attempt to clear the

destination read-only attribute if it's there.

(svn_io_file_rename2): Don't call svn_io_set_file_read_write() in the

Win32-specific portion of this function, since clearing the read-only

attribute is now a part of the win32_file_rename() function.

Win32: tweak the SSL certificate validation override to avoid hitting the wire

for URL based objects and revocation checks.

The primary purpose of this callback is to resolve SVN_AUTH_SSL_UNKNOWNCA

failures using CryptoAPI and Windows local certificate stores. To do so, we

should be fine with just using the immediately available data on the local


Doing the opposite of that appears to be troublesome, as always connecting

to remote CRL and OCSP endpoints can result in spurious errors or significant

(user-reported) network stalls caused by timeouts if the endpoints are

inaccessible or unreliable.

The new approach should also be in par with the default basic behavior of

several major browsers, for example:

* subversion/libsvn_subr/win32_crypto.c

(windows_validate_certificate): Use the CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL

and CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY flags when preparing the

certificate chain. Ignore errors in obtaining valid revocation information

when verifying the chain, as they could be induced by the new cache-only


* subversion/libsvn_subr/io.c

(io_win_check_path): Tweak comment, no functional changes.

io: Implement the functions that check for node existence using the native

Win32 APIs on Windows:




This changeset aims for two distinct things:

1) First of all, starting from r1833621, these functions were patched to stop

checking symlinks on Windows. The root cause for this change has been an

incorrect implementation of stat in APR that didn't properly distinguish

between various types of reparse points, some of which are not symlinks.

Providing the custom implementation allows us to remove the hack and

properly handle such reparse points irrespectively of the APR version

in use.

Additional details on the core of the issue can be found here:



2) These APIs are used in various performance-critical code paths such as

in the core part of `svn st`.

On Win32 the necessary answers for these particular functions can be

obtained with a single call to GetFileAttributes(), which is much faster

than using the generic stat implementations from APR 1.6.x and 1.7.x

(I believe that it would be even slower in the latter case).

A couple of quick tests show about 20%-25% improvement in the speed of

`svn st` for a large working copy. The improvement may be more significant

with indexers or virus scanners, as just asking for file attributes may

completely avoid opening a file (by retrieving the result through the

fast I/O QueryOpen).

* subversion/libsvn_subr/io.c

(FILE_ATTRIBUTE_TAG_INFO, FileAttributeTagInfo): Add these definitions

for old versions of Windows SDK.

(typedef GetFileInformationByHandleEx_t,

get_file_information_by_handle_ex_proc): New.

(win_init_dynamic_imports): Import `GetFileInformationByHandleEx()`.

(win32_get_file_information_by_handle): New helper function.

(io_win_check_path): New helper with the Win32 implementation required

for the "check path" functions.



svn_io_check_special_path): Invoke the new helper.

(io_check_path): Undo the workaround from r1833621 that stopped passing

APR_FINFO_LINK when performing a stat.

Follow up to r1854072: Reduce the number of file-open operations on Windows.

* subversion/libsvn_subr/io.c (svn_io_dir_remove_nonrecursive):

On Windows, only remove the read-only flag from the directory after

the initial deletion failed.

Patch by: kotkov

Follow up to r1854072: Fix a typo in Windows-specific code.

* subversion/libsvn_subr/io.c (io_set_readonly_flag): Fix function signature.