Checkout Tools
  • last updated 8 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Replace some calls to svn_io_file_info_get() with svn_io_file_size_get()

where it makes sense.

* subversion/libsvn_diff/binary_diff.c

(create_compressed): Use svn_io_file_size_get() and remove now unused

local variable FINFO.

* subversion/libsvn_diff/diff_file.c

(datasources_open): Use svn_io_file_size_get().

* subversion/libsvn_fs_fs/stats.c

(get_file_size): Remove.

(read_phys_pack_file, read_phys_revision_file): Use svn_io_file_size_get()

instead of local helper get_file_size().

* subversion/svnrdump/dump_editor.c

(close_file): Use svn_io_file_size_get() instead of apr_file_info_get()

and remove some legacy error handling.

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

(test_spillbuf__file_attrs): Use svn_io_file_size_get() instead of

svn_io_file_info_get().

  1. … 4 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.
Following up on r1561688, switch almost every caller of svn_stream_read() to

its successor svn_stream_read_full(). Do this to resolve many deprecation

warnings (and to avoid somebody else accidentally doing the invalid conversion

to svn_stream_read2()).

There are no functional changes as svn_stream_read() is a direct call to

svn_stream_read_full().

* subversion/libsvn_delta/svndiff.c

(read_one_byte): Update caller.

* subversion/libsvn_delta/text_delta.c

(txdelta_next_window,

tpush_write_handler,

apply_window,

svn_txdelta_send_stream): Update caller.

* subversion/libsvn_fs_base/lock.c

(svn_fs_base__get_locks): Update caller.

* subversion/libsvn_fs_fs/recovery.c

(read_handler_recover): Update caller.

* subversion/libsvn_fs_x/cached_data.c

(get_dir_contents): Update caller.

* subversion/libsvn_fs_x/pack.c

(write_reps_containers): Update caller.

* subversion/libsvn_repos/load.c

(read_key_or_val,

parse_text_block,

svn_repos_parse_dumpstream3): Update caller.

* subversion/libsvn_subr/config_file.c

(parser_getc): Update caller.

* subversion/libsvn_subr/hash.c

(svn_hash__read_entry):

* subversion/libsvn_subr/packed_data.c

(read_stream_uint,

read_stream_data,

svn_packed__data_read): Update caller.

* subversion/libsvn_subr/subst.c

(translated_stream_read,

read_handler_special): Update caller.

* subversion/libsvn_wc/adm_crawler.c

(read_handler_copy): Update caller.

* subversion/mod_dav_svn/repos.c

(deliver): Update caller.

* subversion/svnserve/serve.c

(get_file): Update caller.

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

(test_spillbuf_stream): Update caller.

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

(test_stream_from_string,

test_stream_compressed,

test_stream_seek_stringbuf,

test_stream_seek_translated,

test_stream_compressed_empty_file): Update caller.

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

(pristine_delete_while_open): Update caller.

* subversion/tests/svn_test_fs.c

(svn_test__stream_to_string): Update caller.

* tools/server-side/fsfs-stats.c

(read_windows): Update caller.

  1. … 18 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.
Merge fsx branch into /trunk with no conflicts.

Remove BRANCH-README.

  1. … 83 more files in changeset.
Revert part of r1509137: Remove extended constructors for spillbuf reader

and the spillbuf stream wrapper.

* subversion/include/private/svn_subr_private.h

(svn_spillbuf__reader_create_extended,

svn_stream__from_spillbuf_extended): Removed.

* subversion/libsvn_subr/spillbuf.c

(svn_spillbuf__reader_create_extended,

svn_stream__from_spillbuf,

svn_stream__from_spillbuf_extended): Removed.

(stream_from_reader): Renamed to svn_stream__from_spillbuf.

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

(test_spillbuf_reader): Renamed from test_spillbuf__reader.

(test_spillbuf_stream): Renamed from test_spillbuf__stream.

(test_spillbuf_reader_spill_all,

test_spillbuf_stream_spill_all): Removed.

(test_funcs): Deleted obsolete tests.

  1. … 2 more files in changeset.
Fix a number of style nits in the spillbuf implementation.

* subversion/include/private/svn_subr_private.h,

subversion/libsvn_subr/spillbuf.c,

subversion/tests/libsvn_subr/spillbuf-test.c: According to our style guide

in declarations * binds to the name, not the type of the variable.

Found by: gstein

  1. … 2 more files in changeset.
Add some more constructors, accessors and tests for spillbufs.

* subversion/include/private/svn_subr_private.h

(svn_spillbuf__get_memory_size, svn_spillbuf__get_filename,

svn_spillbuf__get_file, svn_spillbuf__reader_create_extended,

svn_stream__from_spillbuf_extended): New functions.

* subversion/libsvn_subr/spillbuf.c

(svn_spillbuf__get_memory_size, svn_spillbuf__get_filename,

svn_spillbuf__reader_create_extended): Implement.

(stream_from_reader): New private helper function.

(svn_stream__from_spillbuf, svn_stream__from_spillbuf_extended):

Implement using stream_from_reader.

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

(test_spillbuf__reader, test_spillbuf_reader_spill_all,

test_spillbuf__stream, test_spillbuf_stream_spill_all,

test_spillbuf__file_attrs, test_spillbuf_file_attrs,

test_spillbuf_file_attrs_spill_all): New tests and helpers.

(test_funcs): Add new tests.

  1. … 2 more files in changeset.
Add spill-all-data functionality to spillbufs.

* subversion/include/private/svn_subr_private.h

(svn_spillbuf__create_extended): New spillbuf constructor.

* subversion/libsvn_subr/spillbuf.c

(init_spillbuf_extended, init_spillbuf): Fix thinko: the temp_path field is

set in in svn_spillbuf__write and should not be initialized.

(svn_spillbuf__create_extended): Implement.

(svn_spillbuf__write): Optionally write the in-memory contents to the

newly created spill file.

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

(test_spillbuf__basic, test_spillbuf_basic_spill_all,

test_spillbuf__callback, test_spillbuf_callback_spill_all,

test_spillbuf__file, test_spillbuf_file_spill_all,

test_spillbuf__interleaving, test_spillbuf_interleaving_spill_all,

test_spillbuf__rwfile, test_spillbuf_rwfile_spill_all,

test_spillbuf__eof, test_spillbuf_eof_spill_all): New tests and helpers.

(test_funcs): Add new tests.

  1. … 2 more files in changeset.
Code police: array initialized from parenthesized string constant -- may not

be portable.

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

(basic_data): Remove parentheses.

* subversion/include/private/svn_mutex.h

* subversion/include/private/svn_subr_private.h

* subversion/include/private/svn_named_atomic.h

* subversion/libsvn_ra_serf/sb_bucket.c

* subversion/libsvn_subr/spillbuf.c

* subversion/libsvn_subr/svn_mutex.c

* subversion/libsvn_subr/svn_named_atomic.c

* subversion/libsvn_subr/gpg_agent.c

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

* subversion/tests/libsvn_wc/wc-incomplete-tester.c

(.): Set svn:eol-style to native. No text changes necessary.

  1. … 9 more files in changeset.
While writing a test to validate spill buffer behavior when reading

precisely to the end... I discovered a bug. The SPILL_START value

within the spillbuf was not properly reset.

Fix the bug, and add the test which found it.

* subversion/libsvn_subr/spillbuf.c:

(read_data): reset SPILL_START

* subversion/tests/libsvn_subr/spillbuf-test.c:

(test_spillbuf_eof): add new test for validating behavior around the

EOF of the spill file.

  1. … 1 more file in changeset.
Create a helper function for reading/verifying spillbuf reads.

* subversion/tests/libsvn_subr/spillbuf-test.c:

(CHECK_READ): wrapper macro for SVN_ERR() around ...

(check_read): ... this new function. read and verify some data from

the given spillbuf.

(test_spillbuf_basic, test_spillbuf_interleaving,

test_spillbuf_rwfile): use new CHECK_READ macro

The spillbuf code cannot assume the caller has seeked to the END of

the file, since the file is private. (this was a valid assumption in

the original code within ra_serf; careful callers performed that seek)

Now: on every write, we seek to the end of the spill file.

A new test has been written which fails before the spillbuf change,

and succeeds with the change.

* subversion/libsvn_subr/spillbuf.c:

(svn_spillbuf__write): seek to the end of the spill file

* subversion/tests/libsvn_subr/spillbuf-test.c:

(test_spillbuf_interleaving): clarify some comments

(test_spillbuf_write): new test to validate a write into the

spillbuf while it has started processing reads

  1. … 1 more file in changeset.
Purge trailing whitespace, in the spirit of r1138109.

  1. … 97 more files in changeset.
Create a stream which is wrapped around a spillbuffer.

* subversion/include/private/svn_subr_private.h

(svn_stream__from_spillbuf): New.

* subversion/libsvn_subr/spillbuf.c

(spillbuf_baton, read_handler_spillbuf, write_handler_spillbuf,

svn_stream__from_spillbuf): New.

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

(test_spillbuf_stream): New.

(test_funcs): Run the new test.

  1. … 2 more files in changeset.
* subversion/tests/libsvn_subr/spillbuf-test.c

(test_spillbuf_file): Remove integer bitness conversion warning.

Extend a test to cover the false negative that svn_spillbuf__is_empty() had.

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

(test_spillbuf_interleaving): Test some svn_spillbuff__get_size() calls.

(The last one tests for the bug; the former ones are for good measure.)

Change the spillbuf to remember how much content it has written to the

spill file. This removes the false-positive from the is_empty() function.

However, for some upcoming work, we need the size... so get_size() now

takes over for is_empty() and uses that file size.

* subversion/include/private/svn_subr_private.h:

(svn_spillbuf__is_empty): removed in favor of ...

(svn_spillbuf__get_size): ... this. note the use of svn_filesize_t since

we are storing (potentially-large) content into a file.

* subversion/libsvn_subr/spillbuf.c:

(struct svn_spillbuf_t): add SPILL_SIZE member

(svn_spillbuf__is_empty): renamed to ...

(svn_spillbuf__get_size): ... this, and logic altered

(svn_spillbuf__write): add to the new SPILL_SIZE member

(read_data): limit the amount read from the file to only what we stored

into the file. if the file empties, then close it.

* subversion/tests/libsvn_subr/spillbuf-test.c:

(test_spillbuf_basic, test_spillbuf_file): track rename

  1. … 2 more files in changeset.
Rename the private APIs to include a double-underscore, per convention. We

have no solid convention for typedefs (which are not exposed by the

library callpoints), so they remain unchanged.

Suggested by: philip

* subversion/include/private/svn_subr_private.h:

* subversion/libsvn_subr/spillbuf.c:

* subversion/libsvn_repos/reporter.c:

* subversion/tests/libsvn_subr/spillbuf-test.c:

(...): rename the functions

  1. … 3 more files in changeset.
Add a test for the new spillbuf reader.

* subversion/tests/libsvn_subr/spillbuf-test.c:

(test_spillbuf_reader): new test

(test_funcs): add the new test

Rebuild svn_spillbuf_write() to pack the content into existing memory

blocks, rather than allocating a block per write.

* subversion/libsvn_subr/spillbuf.c:

(svn_spillbuf_write): no longer restrict the size of the write, and

spill to the file if *this* write will cause the maxsize to be

exceeded (rather than creating the spill if a *prior* write had

exceeded the maxsize). loop on writing the content into memory blocks.

* tests/libsvn_subr/spillbuf-test.c:

(test_spillbuf_file): compensate for the new tail-memblock packing of

written content.

(test_spillbuf_interleave): compensate for the new tail-memblock

packing. also adjust the maxsize to compensate for the change in when

a spill is decided: make it larger to delay when the file is created.

* include/private/svn_subr_private.h:

(): adjust the documentation on writing behavior (restrictions lifted)

  1. … 2 more files in changeset.
Add a pool parameter to the spill buffer's read callback, and add a test

for the callback.

* subversion/include/private/svn_subr_private.h:

(svn_spillbuf_read_t): add a SCRATCH_POOL parameter

* subversion/libsvn_subr/spillbuf.c:

(svn_spillbuf_write): delete the file on close, rather than pool

cleanup. we may periodically close the file during the course of a

spill buffer's usage.

(svn_spillbuf_process): create an iterpool and pass it to the callback

* subversion/tests/libsvn_subr/spillbuf-test.c:

(read_callback): new callback for reading content from the buffer

(test_spillbuf_callback): new test for the callback style of reading

(test_funcs): add new test

  1. … 2 more files in changeset.
Add a test of interleaving reads and writes.

* subversion/test/libsvn_subr/spillbuf-test.c:

(test_spillbuf_interleaving): interleave a series of writes and reads to

ensure the data comes out in the proper order and content.

(test_funcs): add new test

Add another test to validate some of the behavior of reading from the

spill file.

* subversion/tests/libsvn_subr/spillbuf-test.c:

(basic_data): extracted from test_spillbuf_basic's DATA localvar

(test_spillbuf_basic): move DATA to global. add a final empty test.

(test_spillbuf_file): add a test for the reading behavior of the file:

it will read BLOCKSIZE data rather than hunks corresponding to the

size of the original writes. in-memory blocks will retain the original

write sizes.

(test_funcs): add the new test

Initial test for the new spill buffer code.

* build.conf:

(spillbuf-test): new test. adjust related sections, too.

* subversion/tests/libsvn_subr:

(svn:ignore): ignore spillbuf-test

* subversion/tests/libsvn_subr/spillbuf-test.c: new test

  1. … 2 more files in changeset.