Checkout Tools
  • last updated 3 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Follow up to r1849080: move a private function out of a public header.

* subversion/include/svn_dirent_uri.h: Update file-level docstrin.

(svn_relpath__internal_style): Removed.

* subversion/include/private/svn_dirent_uri_private.h: New file.

(svn_relpath__make_internal): Renamed from svn_relpath__internal_style.

* subversion/libsvn_subr/dirent_uri.c,

subversion/svndumpfilter/svndumpfilter.c,

subversion/tests/libsvn_subr/dirent_uri-test.c,

subversion/bindings/javahl/native/Path.cpp:

Include private/svn_dirent_uri_private.h and use svn_relpath__make_internal

instead of svn_relpath__internal_style.

* subversion/bindings/swig/python/svn/core.py

(__all__): Remove mention of svn_relpath__internal_style from the comment.

  1. … 6 more files in changeset.
Change a private function's signature to prevent potential assertions.

* subversion/include/svn_dirent_uri.h

(svn_relpath__internal_style): Change prototype so that the function can

return an error instead of aborting if anything goes wrong.

* subversion/libsvn_subr/dirent_uri.c

(svn_relpath__internal_style): Update the implementation.

* subversion/bindings/javahl/native/Path.cpp (Relpath::initfunc),

* subversion/svndumpfilter/svndumpfilter.c (sub_main),

* subversion/tests/libsvn_subr/dirent_uri-test.c (test_relpath_internal_style):

Updated all callers.

  1. … 4 more files in changeset.
Make the port requirements of svn_uri_is_canonical() match the

port guarantees made by svn_uri_canonicalize(). This fixes a

client SEGV when handling invalid URLs in svn:externals.

The function svn_uri_canonicalize() always returns canonical URLs,

by definition, but being canonical does not guarantee that an URL

is valid. The function svn_uri_is_canonical() should always return

TRUE on canonical URLs even if the URL is invalid, i.e. it should

not be more stringent that svn_uri_canonicalize().

* subversion/libsvn_subr/dirent_uri.c

(svn_uri_is_canonical): Relax port checks to match svn_uri_canonicalize.

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

(uri_canonical_tests): Add some invalid URLs that can still be canonical.

* subversion/tests/cmdline/externals_tests.py

(invalid_uris_in_repo): New.

(test_list): Add new tests.

* subversion/tests/cmdline/externals_tests_data/invalid_uris_in_repo.dump: New.

  1. … 4 more files in changeset.
At present some of the output from svn_uri_canonicalize() fails

to be canonical according to svn_uri_is_canonical(). Add some

test cases to show this but protect with #if 0 until we decide

what the behaviour should be.

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

(uri_canonical_tests[]): Add some more cases, but #if 0.

(test_uri_is_canonical): Test svn_uri_is_canonical() on all

canonical forms.

Fix a few more test assumptions for not Windows.

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

(uri_canonical_tests,

test_dirent_from_file_url): Fix assumptions.

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

(uri_canonical_tests): Following up on r1692269, fix compilation

on !Windows platforms.

Following up on r1692259 and r1692264 fix another !Windows assumption

in a regression test.

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

(test_dirent_from_file_url): Don't expect the '\' to be handled as on Windows

on all platforms.

Following up on r1692262, fix canonicalizing the separator directly behind

a windows drive letter usage.

If the separator in this location was %2F it wouldn't be converted to '/',

unlike in other locations of the url... instead it would be converted to %25,

which is the escaped version of '%'.

* subversion/libsvn_subr/dirent_uri.c

(canonicalize): Handle a final '/' in the same way as the generic code.

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

(uri_canonical_tests): Extend testcase.

  1. … 1 more file in changeset.
Following up on r1692259, fix some !Windows test assumptions in

the dirent from url regression tests. Add a few more tests.

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

(test_dirent_from_file_url): Stop assuming that '|' is converted to ':'

on not Windows platforms.

Fix an ugly case where svn_uri_canonicalize() returned a not canonical

uri when invoked with a Window specific drive relative url.

Using repository urls like 'file:///c:hi' or 'file:///c:hi/repos' would

raise not-canonical assertions even though they got through the canonicalize

function.

* subversion/libsvn_subr/dirent_uri.c

(canonicalize): Canonicalize drive relative file urls to a canonical form

instead of leaving them not canonical.

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

(uri_canonical_tests): Extend testset.

  1. … 1 more file in changeset.
In the file:/// to dirent conversion code, handle a '\' directly after a

Windows drive letter at the start of a path like a '/' dirent separator.

This avoids handling these dirents as (drive) relative paths, which

causes unexpected behavior in functions that typically expect to only

see rooted paths.

'\' characters further on in the path are kept as-is, because the '\'

character is valid inside some repository paths, even though not all

ra implementations might handle these.

Note that this change explicitly doesn't change the uri canonicalization

rules, as that would require a working copy format bump. And therefore

it still allows file://A:repos/dir style paths, but this form causes far

less confusion than file://A:\repos\dir being handled as a single component.

* subversion/libsvn_subr/dirent_uri.c

(svn_uri_get_dirent_from_file_url): Handle '\' characters directly

after a drive reference as '/'.

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

(test_dirent_from_file_url): Add regression tests.

  1. … 1 more file in changeset.
Add more svn_uri_canonicalize() test cases for multiple slashes

after the scheme.

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

(uri_canonical): Add tests for "http:////example.com" and

"http://///////example.com/" test cases. In both cases,

expect "http:///example.com" as result.

Add an svn_uri_canonicalize() test case that shows the expected

behaviour for 3 slashes after the scheme. The 3rd slash is always

retained, as in http:/// -> http:///, even if the scheme doesn't

support it (the file: scheme does, but http: actually does not).

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

(uri_canonical): Add "http:///example.com" test case.

Provide a new function svn_cert__match_dns_identity() to handling

matching hostnames in X.509 certs as described in RFC 6125.

* subversion/tests/libsvn_subr/dirent_uri-test.c: New tests.

* subversion/include/private/svn_cert.h: New file.

* subversion/libsvn_subr/dirent_uri.c

(svn_cert__match_dns_identity): New function.

* subversion/libsvn_ra_serf/util.c

(ssl_server_cert): Use svn_cert__match_dns_identity() instead of

apr_fnmatch().

  1. … 3 more files in changeset.
Following the availability of apr_hash_this_key() etc. in APR v1.5, use

these in Subversion code instead of svn__apr_hash_index_key() etc. Provide

substitutes only when APR is too old to provide them.

* subversion/include/svn_types.h,

subversion/libsvn_subr/iter.c

(svn__apr_hash_index_key,

svn__apr_hash_index_klen,

svn__apr_hash_index_val):

Rename to apr_hash_this_key, apr_hash_this_key_len, apr_hash_this_val.

Declare and define them only if APR is older than 1.5.

Everywhere else: track the renames.

  1. … 102 more files in changeset.
Resolve assertion triggered by the test added in r1604736, by properly

detecting a canonical relpath, with special behavior where we are about to

use it.

* subversion/libsvn_client/diff.c

(diff_repos_wc): Properly calculate anchor and target when the target is ".."

* subversion/tests/cmdline/diff_tests.py

(diff_parent_dir): Extend test to verify an actual change via both . and .. .

Remove XFail marker.

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

(test_relpath_is_canonical): Add test value, verifying current behavior.

"../.." is verified as canonical, so we can't just redefine "..".

Relpaths just don't have a magic value to select the parent dir.

  1. … 2 more files in changeset.
Make the C tests work with the --enable-optimize configure option.

Because the main() function used to be defined in libsvn_test,

the -flto option (which performs rather aggressive link-time

optimizations) would cause the linker to remove all "unreferenced"

static functions ... which includes all the actual tests.

Which this change, main() is now defined in each test driver.

* subversion/tests/svn_test.h

(test_funcs, svn_test_max_threads): Remove external declarations.

(svn_test_main): New prototype for the (existing-but-renamed) test driver.

(SVN_TEST_MAIN): Bolierplate macro that generates a main() implementation.

* subversion/tests/svn_test_main.c

(svn_test_main): Renamed from 'main', and takes two extra parameters,

'max_threads' and 'test_funcs'. Propagates test_funcs to get_array_size,

do_test_num and do_tests_concurrently.

(get_array_size, do_test_num,

test_params_t, test_thread, do_tests_concurrently): Require a test_funcs

parameter. All uses updated.

* subversion/tests/libsvn_client/client-test.c,

subversion/tests/libsvn_client/mtcc-test.c,

subversion/tests/libsvn_delta/random-test.c,

subversion/tests/libsvn_delta/window-test.c,

subversion/tests/libsvn_diff/diff-diff3-test.c,

subversion/tests/libsvn_diff/parse-diff-test.c,

subversion/tests/libsvn_fs/fs-test.c,

subversion/tests/libsvn_fs/locks-test.c,

subversion/tests/libsvn_fs_base/

subversion/tests/libsvn_fs_base/changes-test.c,

subversion/tests/libsvn_fs_base/fs-base-test.c,

subversion/tests/libsvn_fs_base/strings-reps-test.c,

subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c,

subversion/tests/libsvn_fs_x/fs-x-pack-test.c,

subversion/tests/libsvn_fs_x/string-table-test.c,

subversion/tests/libsvn_ra/ra-test.c,

subversion/tests/libsvn_ra_local/ra-local-test.c,

subversion/tests/libsvn_repos/repos-test.c,

subversion/tests/libsvn_subr/auth-test.c,

subversion/tests/libsvn_subr/cache-test.c,

subversion/tests/libsvn_subr/checksum-test.c,

subversion/tests/libsvn_subr/compat-test.c,

subversion/tests/libsvn_subr/config-test.c,

subversion/tests/libsvn_subr/crypto-test.c,

subversion/tests/libsvn_subr/dirent_uri-test.c,

subversion/tests/libsvn_subr/error-code-test.c,

subversion/tests/libsvn_subr/error-test.c,

subversion/tests/libsvn_subr/hashdump-test.c,

subversion/tests/libsvn_subr/io-test.c,

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

subversion/tests/libsvn_subr/named_atomic-test.c,

subversion/tests/libsvn_subr/opt-test.c,

subversion/tests/libsvn_subr/packed-data-test.c,

subversion/tests/libsvn_subr/path-test.c,

subversion/tests/libsvn_subr/prefix-string-test.c,

subversion/tests/libsvn_subr/priority-queue-test.c,

subversion/tests/libsvn_subr/revision-test.c,

subversion/tests/libsvn_subr/root-pools-test.c,

subversion/tests/libsvn_subr/skel-test.c,

subversion/tests/libsvn_subr/spillbuf-test.c,

subversion/tests/libsvn_subr/sqlite-test.c,

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

subversion/tests/libsvn_subr/string-test.c,

subversion/tests/libsvn_subr/subst_translate-test.c,

subversion/tests/libsvn_subr/time-test.c,

subversion/tests/libsvn_subr/translate-test.c,

subversion/tests/libsvn_subr/utf-test.c,

subversion/tests/libsvn_wc/conflict-data-test.c,

subversion/tests/libsvn_wc/db-test.c,

subversion/tests/libsvn_wc/entries-compat.c,

subversion/tests/libsvn_wc/op-depth-test.c,

subversion/tests/libsvn_wc/pristine-store-test.c,

subversion/tests/libsvn_wc/wc-queries-test.c,

subversion/tests/libsvn_wc/wc-test.c:

(max_threads): Renamed from svn_test_max_threads and made static.

(test_funcs): Made static.

(SVN_TEST_MAIN): Expanded boilerplate main() function.

  1. … 54 more files in changeset.
Add "--parallel" option to our C tests.

Besides shaving off a few seconds off our total test execution time,

parallel execution also stresses our code and the tests themselves

harder. It uncovers things like improperly separated working sets

that make post-failure analysis harder.

Parallel mode is only available with APR 1.3+ and threads enabled.

The option will simply be ignored in other configurations. Further

limitations are cleanups being delayed to after all tests completed

and segfaults not being intercepted.

Some tests can't be executed in parallel. Therefore, we introduce

svn_test_max_threads a simple upper limit to the number of threads

supported that each test must define alongside the test_funcs array.

This patch sets it to "1" in many cases because the tests are so

small that multi-threaded execution is simply not worth it.

* build/run_tests.py

(TestHarness._run_c_test): Pass --parallel option to the individual

test applications.

* subversion/tests/svn_test.h

(svn_test_max_threads): Declare new external setting to be set by

every test application.

* subversion/tests/svn_test_main.c

(parallel): New command line option presence flag.

(parallel_opt,

cl_options): Declare the new "--parallel" option.

(svn_test_add_dir_cleanup): Synchronize shared pool access since

this might be called from multiple

threads at the same time.

(log_results): Result logger function factored out from do_test_num

to be shared between serialized and parallel test

execution code.

(do_test_num): Use that new function.

(test_params_t,

test_thread,

do_tests_concurrently): Threads, their parameter and the thread

starter for thread-pooled test execution.

(main): Handle the new option.

Call concurrent execution when in PARALLEL mode.

* subversion/tests/libsvn_delta/random-test.c

subversion/tests/libsvn_subr/named_atomic-test.c

(svn_test_max_threads): These tests don't support concurrent execution.

* subversion/tests/libsvn_delta/random-test.c

subversion/tests/libsvn_delta/window-test.c

subversion/tests/libsvn_diff/parse-diff-test.c

subversion/tests/libsvn_ra_local/ra-local-test.c

subversion/tests/libsvn_ra/ra-test.c

subversion/tests/libsvn_subr/auth-test.c

subversion/tests/libsvn_subr/cache-test.c

subversion/tests/libsvn_subr/checksum-test.c

subversion/tests/libsvn_subr/compat-test.c

subversion/tests/libsvn_subr/config-test.c

subversion/tests/libsvn_subr/crypto-test.c

subversion/tests/libsvn_subr/dirent_uri-test.c

subversion/tests/libsvn_subr/error-code-test.c

subversion/tests/libsvn_subr/error-test.c

subversion/tests/libsvn_subr/hashdump-test.c

subversion/tests/libsvn_subr/mergeinfo-test.c

subversion/tests/libsvn_subr/named_atomic-test.c

subversion/tests/libsvn_subr/opt-test.c

subversion/tests/libsvn_subr/packed-data-test.c

subversion/tests/libsvn_subr/path-test.c

subversion/tests/libsvn_subr/prefix-string-test.c

subversion/tests/libsvn_subr/priority-queue-test.c

subversion/tests/libsvn_subr/revision-test.c

subversion/tests/libsvn_subr/root-pools-test.c

subversion/tests/libsvn_subr/skel-test.c

subversion/tests/libsvn_subr/spillbuf-test.c

subversion/tests/libsvn_subr/sqlite-test.c

subversion/tests/libsvn_subr/stream-test.c

subversion/tests/libsvn_subr/string-test.c

subversion/tests/libsvn_subr/subst_translate-test.c

subversion/tests/libsvn_subr/time-test.c

subversion/tests/libsvn_subr/utf-test.c

subversion/tests/libsvn_wc/conflict-data-test.c

subversion/tests/libsvn_wc/wc-queries-test.c:

(svn_test_max_threads): These are too small to benefit from multi-threading.

* subversion/tests/libsvn_client/client-test.c

subversion/tests/libsvn_diff/diff-diff3-test.c

subversion/tests/libsvn_fs_base/changes-test.c

subversion/tests/libsvn_fs_base/fs-base-test.c

subversion/tests/libsvn_fs_base/strings-reps-test.c

subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c

subversion/tests/libsvn_fs/fs-test.c

subversion/tests/libsvn_fs/locks-test.c

subversion/tests/libsvn_fs_x/fs-x-pack-test.c

subversion/tests/libsvn_fs_x/string-table-test.c

subversion/tests/libsvn_repos/repos-test.c

subversion/tests/libsvn_subr/io-test.c

subversion/tests/libsvn_subr/translate-test.c

subversion/tests/libsvn_wc/db-test.c

subversion/tests/libsvn_wc/op-depth-test.c

subversion/tests/libsvn_wc/wc-test.c

(svn_test_max_threads): Set concurrency limit to whatever various test

runs suggested as the most efficient value.

* subversion/tests/libsvn_wc/entries-compat.c

subversion/tests/libsvn_wc/pristine-store-test.c

(svn_test_max_threads): Set concurrency limit to "unbounded".

  1. … 54 more files in changeset.
Use SVN_VA_NULL instead of plain NULL in variable-arguments lists in all

remaining cases, as far as I can discover, following r1536307 (introducing

SVN_VA_NULL) and r1543394 (warning about missing or inappropriate sentinels for

some Subersion functions).

[Lots of implementation files]: Replace NULL with SVN_VA_NULL in function

calls with variable argument lists.

  1. … 37 more files in changeset.
Introduce a null-pointer constant that we can use as a termination sentinel

in variable argument lists. This avoids the ugliness of writing

"(char *) NULL" all over the place.

* subversion/include/svn_types.h (SVN_VA_NULL): New symbol.

* subversion/include/svn_dirent_uri.h (svn_dirent_join_many),

subversion/include/svn_path.h (svn_path_join_many),

subversion/include/svn_xml.h (svn_xml_make_open_tag):

Update docstrings, mentioning SVN_VA_NULL as the argument list terminator.

[Lots of implementation files]: Replace typecast-NULL with SVN_VA_NULL in

function calls with variable argument lists.

  1. … 89 more files in changeset.
Cast NULL to (char *) in vararg calls to svn_dirent_join_many

and svn_path_join_many.

* subversion/libsvn_fs_fs/lock.c

(digest_path_from_digest, digest_path_from_path): here

* subversion/libsvn_fs_fs/transaction.c

(create_txn_dir, create_txn_dir_pre_1_5): here

* subversion/libsvn_fs_fs/util.c

(svn_fs_fs__path_rev_packed, svn_fs_fs__path_rev_shard,

svn_fs_fs__path_rev, svn_fs_fs__path_revprops_shard,

svn_fs_fs__path_revprops_pack_shard, svn_fs_fs__path_revprops,

svn_fs_fs__path_txn_dir, svn_fs_fs__path_txn_proto_rev,

svn_fs_fs__path_txn_proto_rev_lock, svn_fs_fs__path_node_origin): here

* subversion/libsvn_fs_x/lock.c

(digest_path_from_digest, digest_path_from_path): here

* subversion/libsvn_fs_x/transaction.c

(create_txn_dir): here

* subversion/libsvn_fs_x/util.c

(svn_fs_x__path_rev_packed, svn_fs_x__path_rev_shard,

svn_fs_x__path_revprops_shard,

svn_fs_x__path_revprops_pack_shard,

svn_fs_x__path_txn_dir, svn_fs_x__path_txn_proto_rev,

svn_fs_x__path_txn_proto_rev_lock, svn_fs_x__path_node_origin): here

* subversion/libsvn_subr/config_file.c

(svn_config__sys_config_path, svn_config_get_user_config_path): here

* subversion/libsvn_wc/adm_files.c

(svn_wc__adm_child): here

* subversion/libsvn_wc/upgrade.c

(build_lockfile_path, bump_to_29): here

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_temp_wcroot_tempdir): here

* subversion/libsvn_wc/wc_db_pristine.c

(get_pristine_fname): here

* subversion/mod_authz_svn/mod_authz_svn.c

(get_access_conf): here

* subversion/tests/cmdline/entries-dump.c

(entries_dump): here

* subversion/tests/libsvn_client/client-test.c

(test_patch): here

* subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c

(pack_filesystem, pack_even_filesystem, recover_fully_packed): here

* subversion/tests/libsvn_fs_x/fs-x-pack-test.c

(pack_filesystem, pack_even_filesystem, recover_fully_packed): here

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

(test_dirent_join): here

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

(test_path_join): here

* subversion/tests/libsvn_wc/entries-compat.c

(test_entries_alloc, test_stubs): here

  1. … 18 more files in changeset.
Fix a bug in svn_uri_is_canonical; it would begin path verification at

the beginning of the host name, and if the host name was "." would think

it found an invalid path segment.

* subversion/libsvn_subr/dirent_uri.c (svn_uri_is_canonical):

Set the segment pointer to the beginning of the schema data before

verifying same, otherwise it would point at the beginning of the

host name.

* subversion/tests/libsvn_subr/dirent_uri-test.c (uri_canonical):

Add a couple cases that tripped up the buggy svn_uri_is_canonical.

  1. … 1 more file in changeset.
Allow ipv6 addresses encoded in urls in the common

http://[::1]/svn/repos format.

by extending our canonical urls a tiny bit.

* subversion/libsvn_subr/dirent_uri.c

(canonicalize,

svn_uri_is_canonical): Allow lower case [] ipv6 addresses.

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

(uri_canonical_tests): Add a few ipv6 testcases.

  1. … 1 more file in changeset.
* subversion/tests/libsvn_subr/dirent_uri-test.c

(test_uri_dirname): Extend test a bit.

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

(uri_canonical_tests): Following up on r1409146, add a few more test values.

Resolve a specific case where calling svn_uri_get_file_url_from_dirent()

doesn't return a canonical uri.

* subversion/libsvn_subr/dirent_uri.c

(svn_uri_get_file_url_from_dirent): Make sure "C:/" returns a canonical url.

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

(test_file_url_from_dirent): Update expected result. Test result for being

canonical.

  1. … 1 more file in changeset.
Fix a memory read bug.

Found by: Tony Butt <tjb{_AT_}cea.com.au>

* subversion/libsvn_subr/dirent_uri.c

(svn_dirent_skip_ancestor, svn_relpath_skip_ancestor,

uri_skip_ancestor): Don't read beyond end of child.

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

(dirent_ancestor_tests, uri_ancestor_tests): Extend.

  1. … 1 more file in changeset.
* subversion/tests/libsvn_subr/dirent_uri-test.c

(test_dirent_canonicalize,

test_relpath_canonicalize,

uri_canonical_tests,

test_dirent_is_canonical,

test_relpath_is_canonical): Add testvalue for '//foo'.

With help of rhuijben, make dirent_uri-test.exe#32 work on Windows systems

without a D: drive.

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

(test_dirent_condense_targets): If a path that is going to be "condensed"

is on a D: drive, first test if a D: drive actually exists, and skip

it if there is no such drive (otherwise, our call to apr_filepath_merge

will error out with APR_EBADPATH making the test fail).

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

(uri_canonical_tests): Add two testcases to cover current behavior.