pristine-store-test.c

Checkout Tools
  • last updated 2 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Switch the pristine file install code in libsvn_wc to using the recently added

install streams.

On Windows these streams avoid opening and closing the same file a few times,

which avoids influence from outside processes such as indexers and

virusscanners on the intermediate operations. In many corporate environments

with strict on access virusscanners (as well as on network drives) this

will hugely improve checkout times.

* subversion/include/private/svn_io_private.h

(svn_stream__install_delete,

svn_stream__install_get_info): New functions.

* subversion/libsvn_subr/stream.c

(svn_stream__install_get_info,

svn_stream__install_delete): New function.

* subversion/libsvn_wc/adm_crawler.c

(svn_wc__internal_transmit_text_deltas): Update caller.

* subversion/libsvn_wc/externals.c

(edit_baton): Store install data instead of path.

(apply_textdelta,

close_file): Update caller.

* subversion/libsvn_wc/update_editor.c

(handler_baton): Add install data.

(window_handler): Update caller. Remove now unused variable.

(lazy_open_target): Update caller.

(apply_textdelta): Pass final path for error information instead of the now

completely hidden intermediate path.

(svn_wc_add_repos_file4): Update caller. Extract local file handling.

Remove obsolete comment.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_install_data_t): New struct.

(svn_wc__db_pristine_prepare_install): Update output state.

(svn_wc__db_pristine_install): Use baton for input.

(svn_wc__db_pristine_install_abort): New function.

* subversion/libsvn_wc/wc_db_pristine.c

(includes): Add svn_io.h and private/svn_io_private.h

(pristine_install_txn): Use install stream to avoid opening the files

many times.

(svn_wc__db_install_data_t): New struct.

(svn_wc__db_pristine_prepare_install): Initialize svn_wc__db_install_data_t.

(svn_wc__db_pristine_install): Install file using install stream.

(svn_wc__db_pristine_install_abort): New function.

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

(pristine_write_read,

pristine_delete_while_open,

reject_mismatching_text): Update caller.

  1. … 7 more files in changeset.
Following up on r1577109, reorder checksum arguments of

svn_wc__db_pristine_prepare_install to match the order of

svn_wc__db_pristine_install.

No functional changes.

* subversion/libsvn_wc/adm_crawler.c

(svn_wc__internal_transmit_text_deltas): Update caller.

* subversion/libsvn_wc/externals.c

(apply_textdelta): Update caller.

* subversion/libsvn_wc/update_editor.c

(lazy_open_target,

svn_wc_add_repos_file4): Update caller.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_pristine_prepare_install): Swap checksum arguments.

* subversion/libsvn_wc/wc_db_pristine.c

(svn_wc__db_pristine_prepare_install): Swap checksum arguments.

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

(pristine_write_read,

pristine_delete_while_open,

reject_mismatching_text): Update caller.

  1. … 5 more files in changeset.
Make the few remaining places that prepare files for installing use

svn_wc__db_pristine_prepare_install() to allow further refactoring the

pristine install work.

* subversion/libsvn_wc/merge.c

(merge_file_trivial): Use the same api to obtain a tempdir as the rest

of the merge code.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_pristine_get_tempdir): Remove function.

* subversion/libsvn_wc/wc_db_pristine.c

(svn_wc__db_pristine_get_tempdir): Remove function.

(pristine_get_tempdir): Integrate svn_wc__db_pristine_get_tempdir.

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

(write_and_checksum_temp_file): Remove function.

(pristine_write_read,

pristine_delete_while_open,

reject_mismatching_text): Use svn_wc__db_pristine_prepare_install.

  1. … 3 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.
Use SVN_TEST_ASSERT_ERROR macro rather than coding the error comparison.

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

(test_svn_subst_translate_string2): Use macro.

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

(test_getting_info): Use macro.

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

(test_op_revert, copy_wc_wc_server_excluded, layered_moved_to,

update_within_move): Use macro.

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

(pristine_write_read, reject_mismatching_text): Use macro.

  1. … 3 more files in changeset.
The semi-annual trailing whitespace cleansing ritual.

* everywhere:

for extsn in c h cpp java py pl rb; do

sed -i -e 's/[ \t]*$//' `find . -name "*.$extsn" | xargs grep '[ \t]$' -l`

done

  1. … 144 more files in changeset.
Delete an API that I introduced but never used.

* subversion/libsvn_wc/workqueue.h,

subversion/libsvn_wc/workqueue.c

(svn_wc__wq_build_pristine_get_translated): Delete.

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

(pristine_get_translated): Delete.

(test_funcs): Remove that test from the list.

  1. … 2 more files in changeset.
In our pristine store we store the length (in bytes) of the pristine streams.

We can use this (and the new had_props boolean of _read_info()) to further

optimize the file comparison code below svn_wc__internal_file_modified_p(),

without additional IO.

* If a file doesn't have properties, it doesn't need translation, so

don't perform DB queries to get the translation details from the properties.

* If a file doesn't need translation *and* doesn't match the pristine

size, it is not equal to the pristine file.

* subversion/libsvn_wc/adm_crawler.c

(read_and_checksum_pristine_text): Update caller.

* subversion/libsvn_wc/adm_files.c

(svn_wc__get_pristine_contents): Add size argument.

* subversion/libsvn_wc/adm_files.h

(svn_wc__get_pristine_contents): Add size argument.

* subversion/libsvn_wc/adm_ops.c

(svn_wc_get_pristine_contents2): Update caller.

* subversion/libsvn_wc/copy.c

(copy_pristine_text_if_necessary): Update caller.

* subversion/libsvn_wc/diff.c

(apply_textdelta): Update caller.

* subversion/libsvn_wc/questions.c

(compare_and_verify): Don't do work that we can avoid, by receiving a bit

more information from the caller. If we don't translate and the filesize

doesn't match, don't read the files.

(svn_wc__internal_file_modified_p): Retrieve the filesize and whether we have

properties and pass that to compare_and_verify.

* subversion/libsvn_wc/update_editor.c

(apply_textdelta): Update caller.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_PRISTINE_SIZE): New query.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_pristine_read): Add argument.

* subversion/libsvn_wc/wc_db_pristine.c

(pristine_read_baton_t): Add field.

(pristine_read_txn): Use new query. Set size if requested; allow NULL

contents.

(svn_wc__db_pristine_read): Set new argument in baton.

* subversion/libsvn_wc/workqueue.c

(process_commit_file_install): Don't force a sha1 comparison.

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

(pristine_write_read,

pristine_delete_while_open): Update caller.

  1. … 12 more files in changeset.
* subversion/tests/libsvn_wc/pristine-store-test.c

(create_repos_and_wc): Remove an unused output parameter. Adjust all

callers.

In the libsvn_wc tests, make some utility functions more public, starting to

create something like the 'sandbox' module of the Python tests.

* subversion/tests/libsvn_wc/utils.h

(svn_test__sandbox_t): Move here from 'op-depth-test.c' and rename from

'wc_baton_t'.

(svn_test__sandbox_create): New function.

(svn_test__create_repos_and_wc): Delete.

* subversion/tests/libsvn_wc/utils.c

(svn_test__create_repos_and_wc): Rename to create_repos_and_wc() and make

'static'. Improve comments.

(svn_test__sandbox_create): New function.

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

(wc_baton_t): Move to 'utils.h' and rename to 'svn_test__sandbox_t'.

Propagate this rename throughout this file.

(test_*): Simplify the initialization by using svn_test__sandbox_create()

instead of svn_test__create_repos_and_wc().

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

(create_repos_and_wc): Use svn_test__sandbox_create() instead of

svn_test__create_repos_and_wc().

  1. … 3 more files in changeset.
Fix a test that passed on a debug build but failed on a release build.

A follow-up to r1075942.

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

(reject_mismatching_text): Skip this test if not built in debug mode, as

the functionality under test is only present in debug mode.

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

(pristine_delete_while_open): Compare strings properly, not expecting

null terminators. A follow-up to r1075961.

Make the pristine text store guarantee that a pristine text stream being

read will remain readable even if the text is deleted from the store. To

ensure that a recently deleted pristine file can be reinstated, on Windows

we rename it to a new unique name before deleting it. This is probably not

the most efficient way to work on Windows.

* notes/wc-ng/pristine-store

(A-3(d)): Update the procedure for reading a pristine text.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_pristine_read): State that the stream will remain readable.

Also document 'db' and 'wri_abspath'.

* subversion/libsvn_wc/wc_db_pristine.c

(pristine_read_txn): Document that the stream will remain readable.

(pristine_get_tempdir): New function, factored out of ...

(svn_wc__db_pristine_get_tempdir): ... here.

(remove_file): New function.

(pristine_remove_baton_t): Add a 'wcroot' object.

(pristine_remove_if_unreferenced_txn): Use remove_file() so that file

removal can always be followed by re-creating a new file of the same

name even on Windows.

(pristine_remove_if_unreferenced): Initialize the new member of the

pristine_remove_baton_t.

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

(pristine_delete_while_open, reject_mismatching_text): New tests.

(test_funcs): Run them.

  1. … 3 more files in changeset.
Factor out a test function.

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

(write_and_checksum_temp_file): New function, factored out of ...

(pristine_write_read, pristine_get_translated): ... these.

In the C unit test suite, replace all uses of SVN_ERR_ASSERT() with

SVN_TEST_ASSERT() to not have a failed assertion core dump the

process.

Suggested by: danielsh

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

* subversion/tests/libsvn_subr/eol-test.c,

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

* subversion/tests/svn_test_fs.c:

s/SVN_ERR_ASSERT/SVN_TEST_ASSERT/g.

  1. … 3 more files in changeset.
Remove cancellation parameters from the new svn_wc_add_from_disk() API. It

was not yet implemented and since the API only operates on a single node,

not recursively, there is no advantage to checking for cancellation here

rather than in the callers that want it.

* subversion/include/svn_wc.h,

subversion/libsvn_wc/adm_ops.c

(svn_wc_add_from_disk): Remove the cancellation callback parameters and

the TODO note about implementing it.

* subversion/libsvn_client/add.c

(add_file, add_dir_recursive): Remove cancellation arguments here, since

cancellation is already checked for at this level.

(add_parent_dirs): Remove cancellation arguments here, and add an explicit

cancellation check, since this function is recursive.

* subversion/libsvn_client/patch.c

(install_patched_target): Remove null cancellation arguments.

(create_missing_parents, install_patched_prop_targets): Remove

cancellation arguments here, and add an explicit cancellation check.

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

(wc_add): Remove null cancellation arguments.

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

(pristine_get_translated): Remove null cancellation arguments.

  1. … 5 more files in changeset.
Avoid dragging libsvn_client as a dependency to libsvn_test, because that makes

every C test file depend on every C library source file. Instead, the two

source files that use the shared subroutine svn_test__create_repos_and_wc() now

explicitly list the source file containing that function in build.conf.

* build.conf

(libsvn_test): Remove dependency on libsvn_client.

(pristine-store-test, op-depth-test): Add utils.c as a source file.

* subversion/tests/libsvn_wc/utils.c: Renamed from...

* subversion/tests/svn_test_utils.c: ... here.

* subversion/tests/libsvn_wc/utils.h: Renamed from...

* subversion/tests/svn_test_utils.h: ... here.

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

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

(utils.h, svn_test_utils.h): Track rename in #include's.

  1. … 6 more files in changeset.
Share a utility function in the C tests.

* subversion/tests/svn_test_utils.c,

subversion/tests/svn_test_utils.h

New files, containing svn_test__create_repos_and_wc().

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

(create_repos_and_wc): Re-write as a simple wrapper around

svn_test__create_repos_and_wc().

* build.conf

(libsvn_test): Add libsvn_client as a dependency.

  1. … 3 more files in changeset.
* subversion/tests/libsvn_wc/pristine-store-test.c

(pristine_get_translated): Use the new svn_wc_add_from_disk() instead of

svn_wc_add4().

Remove the pristine store "check mode" options, as we do not intend to

implement them.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_checkmode_t): Delete.

(svn_wc__db_pristine_check): Remove the check-mode parameter. Write a

proper doc string.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_pristine_check): Remove the (unused) check-mode parameter.

(svn_wc__db_pristine_get_path): Adjust caller.

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

(pristine_write_read): Adjust callers.

  1. … 2 more files in changeset.
* subversion/tests/libsvn_wc/pristine-store-test.c

(pristine_get_translated):

Obtain a lock on the parent before adding a node.

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

(pristine_get_translated): Simplify the code to make it more readable.

Suggested by: gstein

Following up on the introduction of svn_uri_get_dirent_from_file_url(),

introduce svn_uri_get_file_url_from_dirent() to make it easier to convert

a dirent in a canonical url in a compatible way.

* subversion/include/svn_dirent_uri.h

(svn_uri_get_dirent_from_file_url): Add '*' for doxygen.

(svn_uri_get_file_url_from_dirent): New function.

* subversion/libsvn_subr/dirent_uri.c

(svn_uri_get_file_url_from_dirent): New function.

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

(test_patch): Use svn_uri_get_file_url_from_dirent instead

of using local variant.

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

(make_and_open_local_repos, check_split_url):

Use svn_uri_get_file_url_from_dirent().

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

(test_dirent_from_file_url,

test_dirent_from_file_url_errors): Fix test output.

(test_file_url_from_dirent): New function.

(test_funcs): Add test_file_url_from_dirent.

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

(create_repos_and_wc): Use svn_uri_get_file_url_from_dirent().

* subversion/tests/svn_test_fs.c

(svn_test__current_directory_url): Remove function.

* subversion/tests/svn_test_fs.h

(svn_test__current_directory_url): Remove function.

  1. … 7 more files in changeset.
Add a new work queue item that will fetch a pristine text and translate it

to working-copy form and write it to a specified new file.

* subversion/libsvn_wc/workqueue.c

(OP_PRISTINE_GET_TRANSLATED): New macro.

(pristine_get_translated, run_pristine_get_translated,

svn_wc__wq_build_pristine_get_translated): New functions.

(dispatch_table): Add OP_PRISTINE_GET_TRANSLATED.

* subversion/libsvn_wc/workqueue.h

(svn_wc__wq_build_pristine_get_translated): New function.

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

(pristine_get_translated): New test.

(test_funcs): Add the new test.

  1. … 2 more files in changeset.
Implement the pristine text "check" function.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_pristine_check): Implement (ignoring the 'mode' parameter).

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

(pristine_write_read): Add testing of svn_wc__db_pristine_check().

  1. … 1 more file in changeset.
Add a function for deleting unreferenced pristine text files.

* subversion/libsvn_wc/wc_db.c,

subversion/libsvn_wc/wc_db.h

(svn_wc__db_pristine_remove): New function.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_ANY_PRISTINE_REFERENCE, STMT_DELETE_PRISTINE): New queries.

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

(pristine_write_read): Also trivially test a removal.

  1. … 3 more files in changeset.
Add a test file for testing the pristine store.

* build.conf

(pristine-store-test): New target.

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

New file, with one test.

  1. … 1 more file in changeset.