Checkout Tools
  • last updated 1 hour ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Convert db-tests.c's initial state generation to a similar C struct as used

in op-depth-tests.c, to allow handling future database format updates

without rewriting all sql manually.

* subversion/libsvn_wc/wc-checks.sql

(STMT_STATIC_VERIFY): Extend further. This time to fix some NULL cases

caused by joining.

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

(TESTING_DATA): Remove NODES and ACTUAL init.

(NOT_MOVED,

NO_COPY_FROM): New defines.

(nodes_init_data,

actual_init_data): New variables, manually extracted from TESTING_DATA.

(create_open): Update caller.

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

(create_fake_wc): Update caller.

* subversion/tests/libsvn_wc/utils.c

(includes): Add token-map.h.

(svn_test__create_fake_wc): Use db queries to fill wc.db if data

provided.

* subversion/tests/libsvn_wc/utils.h

(svn_test__nodes_data_t,

svn_test__actual_data_t): New types.

(svn_test__create_fake_wc): Add arguments to pass initial nodes and

actual rows.

  1. … 4 more files in changeset.
Make it easier to run the sql static verifications on a working copy

by creating a private api and adding a small helper tool using this

api.

If you need a typical example you could use

[[

$ svn-wc-db-tester svn-test-work/libsvn_wc/db-test/test_getting_info

J/J-e (depth=2) DBV0061: Moved to without target

K/K-b (depth=1) DBV0061: Moved to without target

svn-wc-db-tester: E155035: Found one or more potential wc.db inconsistencies

]]

* build.conf

(svn-wc-db-tester): New tool.

(__MORE__): Add new tools.

(x509-parser): Add description.

* subversion/libsvn_wc/wc-checks.sql

(STMT_STATIC_VERIFY): Extend. Separate id from message to support api.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_verify_db_full_internal,

svn_wc__db_verify_db_full): New functions.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_verify_cb_t): New typedef.

(svn_wc__db_verify_db_full): New function.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_verify_db_full_internal): New function.

* subversion/libsvn_wc/wc_db_wcroot.c

(verify_sqlite): Rename to...

(verify_db_cb): ... this. Implement svn_wc__db_verify_cb_t.

(close_wcroot): Update caller.

* tools/dev/wc-ng/svn-wc-db-tester.c

New file, based on the svnraisetreeconflict code.

  1. … 6 more files in changeset.
Checkpoint extensions to the verification statements.

Currently all tests except db-tests, entries-compatibility, one

op-depth test and 2 upgrade tests keep the database valid according

to this set of checks.

* subversion/libsvn_wc/wc-checks.sql

(STMT_STATIC_VERIFY): Extend verifications.

Fix svn_wc__db_op_make_copy_internal()'s handling of mixed revision BASE trees.

This fixes some issues around tree conflict handling, and improves

database consistency.

* build/transform_sql.py

(process_file): Allow passing columns and binding variables as argument of

IS_STRICT_DESCENDANT_OF, like the other macros.

* subversion/libsvn_wc/wc-checks.sql

(STMT_STATIC_VERIFY): Add documentation to the older statements. Extend.

* subversion/libsvn_wc/wc-queries.sql

(STMT_DELETE_WORKING_BASE_DELETE): Split into non-recursive...

(STMT_DELETE_WORKING_BASE_DELETE_RECURSIVE): ... and recursive variants.

(STMT_INSERT_WORKING_NODE_FROM_BASE_COPY): Allow replacing nodes, and

handle moved_to when doing that.

* subversion/libsvn_wc/wc_db.c

(db_base_remove): Update caller.

(make_copy_txn): Add recursion arguments to determine when a new op-depth

is needed. Simplify code, by moving the initial shadowing to the calling

function.

(make_copy_move_moved_to): New function.

(svn_wc__db_op_make_copy_internal): Update caller. Shadow all nodes with

base-deleted before calling make_copy_txn. Move moved-to information

to this layer.

* subversion/tests/cmdline/tree_conflict_tests.py

(update_delete_mixed_rev): Remove XFail. Tweak status value.

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

(make_copy_mixed): New function. Tests svn_wc__db_op_make_copy_internal.

make_copy_and_delete_mixed): New functions. Tests svn_wc__db_base_remove

and shows an existing issue with move handling on base-delete.

(test_list): Add new items.

  1. … 5 more files in changeset.
More manual wc-db test scenario fixes: Make the entries-compat base-set

follow the rules of a valid wc-ng database.

* subversion/libsvn_wc/wc-checks.sql

(STMT_STATIC_VERIFY): Add another verification.

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

(TESTING_DATA): Fix op-depths. Add missing row. Use base-deleted for

actual deletes, not 'not-present'.

  1. … 1 more file in changeset.
Fix the op-depth calculations in db-tests.c, to no longer trip +-

every validation rule of op-depths. This involved changing

a local added subdir (with descendants at the same op-depth!)

into a copy.

These testcases were written before NODES introduced op-depth,

and the tests were only updated to not trigger test failures.

* subversion/libsvn_wc/wc-checks.sql

(STMT_STATIC_VERIFY): Make ancestor check a bit stricter.

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

(TESTING_DATA): Tweak setup.

(test_pdh): Install ancestor for not-present to avoid

error.

(validate_abspath): Tweak function to print paths on error.

(test_scan_addition): Tweak expectations after transforming

add into a copy.

(test_scan_deletion): Tweak test. Minor change to handle

working delete.

  1. … 1 more file in changeset.
Make it possible to run sqlite queries that use user defined functions

when the child pools of the pool containing the sqlite database

are being cleaned up.

This is necessary to use op-depth calculations in verification queries.

(or to run queries at all when the verification triggers are used)

* subversion/libsvn_subr/sqlite.c

(clear_sqlite_function): New function.

(svn_sqlite__create_scalar_function): Document nasty problem.

Create function pool in global pool.

* subversion/libsvn_wc/wc-checks.sql

(STMT_STATIC_VERIFY): Extend verifications.

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

(relpath_depth_sqlite): New function (stub).

(test_verify_parsable): Define relpath_depth.

  1. … 2 more files in changeset.
Fix more cases where the direct db operations in the C tests create nonstandard

db instances.

* subversion/libsvn_wc/wc-checks.sql

(STMT_STATIC_VERIFY): Extend tests.

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

(TESTING_DATA): Give present directories a depth and remove pristine data

from local additions that aren't copies.

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

(TESTING_DATA): Give present directories a depth; files a checksum and

remove pristine data from local additions.

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

(insert_actual): When turning a directory in a file, really make it a file.

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

(test_verify_parsable): New function, verifying the check statements.

(test_funcs): Add test_verify_parsable.

* subversion/tests/libsvn_wc/wc-test-queries.sql

(STMT_ENSURE_EMPTY_PRISTINE): New statement.

(STMT_NODES_SET_FILE): Set checksum, remove depth.

  1. … 5 more files in changeset.
Update the test data in db-test.c to at least pass the current static

validations. Add two missing intermediate directories, and remove

values that shouldn't be set.

* subversion/libsvn_wc/wc-checks.sql

(STMT_STATIC_VERIFY): Add column for op-depth value to queries.

* subversion/libsvn_wc/wc_db_wcroot.c

(verify_sqlite): Update usage.

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

(TESTING_DATA): Tweak values to set columns NULL that should be NULL.

(test_children): Update expected results.

(test_working_info): Update expected results.

  1. … 2 more files in changeset.
Stop storing values in columns of NODES rows where their presence implies that

they shouldn't have those values, in the few code paths that still added them.

* subversion/libsvn_wc/wc-checks.sql

(STMT_STATIC_VERIFY): Extend verifications.

* subversion/libsvn_wc/wc_db.c

(insert_base_node,

insert_working_node): Stop storing depth, properties when the

node has not a present status.

* subversion/tests/libsvn_wc/wc-test-queries.sql

(STMT_INSERT_NODE): Don't add values invalid for this presence.

  1. … 2 more files in changeset.
Commit a disabled simple hack to apply some verifications at the time we close

a wc.db file. This code identified some ACTUAL cleanup problems.

No functional changes (unless VERIFY_ON_CLOSE is defined in maintainer mode)

* subversion/libsvn_wc/wc-checks.sql

(STMT_STATIC_VERIFY): New statement.

* subversion/libsvn_wc/wc_db_wcroot.c

(includes): Add svn_pools.h

(VERIFY_ON_CLOSE): Document undefined macro.

(verify_sqlite): New function, disabled by VERIFY_ON_CLOSE.

(close_wcroot): Call verify_sqlite if defined, and when

SVN_CMDLINE_VERIFY_SQL_AT_CLOSE is set.

  1. … 1 more file in changeset.
Allow file externals to bend the rules for normal NODES. Update the

insert code to allow checking for file externals directly.

This makes the currently XFailing externals test "update a file external

without committing target" get a bit further, but doesn't fix it.

* subversion/libsvn_wc/wc-checks.sql

(STMT_VERIFICATION_TRIGGERS:03):

Document real check behavior and add a file external exception.

* subversion/libsvn_wc/wc-queries.sql

(STMT_INSERT_NODE): Add file external argument.

* subversion/libsvn_wc/wc_db.c

(insert_base_baton_t): Add file_external boolean.

(insert_base_node): Bind file external if requested.

(insert_external_node): Ask insert_external_node to add the file external

int.

  1. … 2 more files in changeset.
* subversion/libsvn_wc/wc-checks.sql

(validation_03): Use EXISTS rather than COUNT.

* subversion/libsvn_wc/wc-checks.sql

(no_repository_updates, validation_01, validation_02,

validation_03, validation_04): Use full keyword and lowercase

table names to match wc-queries.sql.

* subversion/libsvn_wc/wc-checks.sql

(validation_03, validation_04): Use more efficient SQL expressions.

Add another WC DB validation, and fix a test that was not obeying it.

* subversion/libsvn_wc/wc-checks.sql

(validation_04): New trigger statement.

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

(test_read_write_tree_conflicts): Create a DB row for the parent directory

of the conflict victims.

  1. … 1 more file in changeset.
Install WC DB validation triggers as temporary triggers on opening the DB.

* subversion/libsvn_wc/wc-checks.sql

(no_repository_updates, validation_01, validation_02, validation_03):

Declare these as temporary.

* subversion/libsvn_wc/wc_db_wcroot.c

(svn_wc__db_wcroot_parse_local_abspath): After opening the DB, install

the validation triggers.

  1. … 1 more file in changeset.
Add another WC DB verification trigger. This one requires that parent rows

are added before their children, so adjust a function that was adding the

parent row after the children. As noted in r1127834, the triggers are

currently installed in such a way that they will not be active until the WC

format is bumped to 29.

* subversion/libsvn_wc/wc-checks.sql

(validation_03): New trigger statement.

* subversion/libsvn_wc/wc_db.c

(make_copy_txn): Add the parent row before the child rows.

  1. … 1 more file in changeset.
Write some WC DB verification triggers in SQL. Add code that will install

them into all new and upgraded DBs when the WC format is bumped to 29.

The verification will not be active until then.

* subversion/libsvn_wc/wc-checks.sql

(STMT_VERIFICATION_TRIGGERS): New name for the group of statements.

(validation_01, validation_02): New trigger statements.

(valid_repos_id_insert): Delete this obsolete trigger statement; it

operated on the old 'BASE_NODE' table.

* subversion/libsvn_wc/wc-queries.sql

Include wc-checks.sql.

* subversion/libsvn_wc/upgrade.c

(bump_to_29): Install the verification trigger statements.

* subversion/libsvn_wc/wc_db.c

(create_db): Install the verification trigger statements.

* Makefile.in

Add wc-checks.sql as a dependency of wc-queries.h.

  1. … 4 more files in changeset.
Add svn:eol-style=native to all SQL files.
  1. … 4 more files in changeset.
Test out my new and fancy ASF commit priviledges by changing the copyright

wording in our license headers to reflect ownership by the ASF.

* NOTICE:

Change terminology to ASF, and update a link.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the ASF, and update the project website.

* everywhere:

Change license text to reflect ASF ownership.

  1. … 891 more files in changeset.
Relicense Subversion under the Apache License, Version 2.0.

* NOTICE: New.

* LICENSE: New.

* COPYING,

subversion/LICENSE: Remove.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the SVN Corp, and that it contains contributions from

many people, as referenced in NOTICE.

* subversion/bindings/swig/python/LICENSE_FOR_PYTHON_BINDINGS:

Relicense the SVN parts under Apache 2.0.

* everywhere:

Change copyright notices in file headers to reflect the Apache 2.0 license.

  1. … 882 more files in changeset.
Create some infrastructure to add additional constraints/checks within the

WC datastore, for developers only.

* subversion/libsvn_wc/wc-checks.sql: new set of SQL commands to create

triggers to perform checks on all operations in the database.

* subversion/libsvn_wc:

(svn:ignore): ignore the wc-checks.h (generated) file

* Makefile.in: clean out the generated wc-checks.h

* build/generator/gen_win.py:

(WinGeneratoreBase._create_sqlite_headers): add new .sql file

* subversion/libsvn_wc/entries.c:

(svn_wc__entries_init): if SVN_DEBUG is defined, then exec all the

statements from wc-checks into the new database.

  1. … 4 more files in changeset.