Checkout Tools
  • last updated 2 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates

Changeset 1659418 is being indexed.

Resolve an old TODO from one of the op-depth bump helper functions:

Cleanup some test code.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_LAYER_FOR_REPLACE): Remove unused inner query.

* subversion/libsvn_wc/wc_db.c

(db_extend_parent_delete): Remove unused diagnostics argument.

(insert_base_node): Update caller.

(svn_wc__db_op_copy_layer_internal): Use a simple check to see

when a parent delete might need extension.

  1. … 1 more file in changeset.
Make the (non recursive) revert db operation properly report tree conflicts

that it creates by both fixing what is stored in the tree conflict and by

properly creating notifications.

Note that a recursive revert wouldn't encounter this problem as it

would just break the moves.

* subversion/libsvn_wc/token-map.h

(kind_map): New array.

* subversion/libsvn_wc/wc-queries.sql

(STMT_CREATE_REVERT_LIST): Only add interesting rows.

(STMT_SELECT_REVERT_LIST_RECURSIVE): Make the revert information available

instead of just the name.

(STMT_CREATE_UPDATE_MOVE_LIST): Store kind as token like in other places,

to allow transforming to revert information.

(STMT_MOVE_NOTIFY_TO_REVERT): New statement.

* subversion/libsvn_wc/wc_db.c

(op_revert_txn): Only bump moved nodes after they have been moved to the

final op-depth. Transform move_update information into revert information.

(revert_list_read): Simplify, since we can now assume only normal reverts

are in the list.

(svn_wc__db_revert_list_notify): Handle new tree conflict notifications and

pass kind when available.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_op_raise_moved_away_internal): New function.

* subversion/libsvn_wc/wc_db_update_move.c

(update_move_list_add): Set kind as token instead of as integer.

(svn_wc__db_update_move_list_notify): Read kind as token.

(resolve_delete_raise_moved_away): Rename to...

(svn_wc__db_op_raise_moved_away_internal): ... this. Make public and add

delete_op_depth argument, to allow bumping from a higher root node.

(break_moved_away_children): Use existing kind column to improve

notifications.

* subversion/tests/cmdline/move_tests.py

(revert_del_root_of_move): New function.

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

(move_in_delete): Remove ### comment.

(test_funcs): Remove XFail marker from move_in_delete.

  1. … 6 more files in changeset.
Improve depth correctness during tree conflict resolving a bit more by

requiring that the proper op-depth of the nodes is passed around instead

of some 'good enough depth'. This made some buggy corner cases around not-

present nodes visible, which are now also fixed.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_DEPTH_NODE): Add moved fields. Remove nonsensical field.

(STMT_SELECT_OP_DEPTH_CHILDREN): Request strict ordering via existing index.

(STMT_SELECT_OP_DEPTH_CHILDREN_EXISTS): New query with presence filter.

(STMT_SELECT_OP_DEPTH_MOVED_TO): Require that the node actually exists

or it wouldn't be a move.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_get_children_op_depth): Remove function.

(svn_wc__db_depth_get_info): Update column index.

(svn_wc__db_op_depth_moved_to): Redefine function as...

(svn_wc__db_scan_moved_to_internal): ... this, with stricter op-depth

definition.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_base_moved_to): Tweak documentation.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_get_children_op_depth): Remove function.

(svn_wc__db_op_depth_moved_to): Rename to...

(svn_wc__db_scan_moved_to_internal): ... this and update docs.

* subversion/libsvn_wc/wc_db_update_move.c

(find_src_op_depth): New function.

(mark_tc_on_op_root): If there is no old kind, there can't be

a replacement.

(tc_editor_delete): Pass new kind to improve tree conflict.

(get_info): Directly use db query to get items pre-sorted without

copying twice, and to avoid not-present node bugs.

(drive_tree_conflict_editor): Remove unused arguments. Move check

to caller.

(update_moved_away_conflict_victim): Use scan_moved_to after obtaining

the source op-depth. Move assertion here. Update caller.

(svn_wc__db_bump_moved_away): Update caller.

(break_moved_away): Obtain proper depth instead of passing some

good enough depth.

  1. … 4 more files in changeset.
Fix yet another case where we corrupted the move tracking information during

conflict resolving. When breaking a move it was possible that moved_here

was reset, but moved_to kept.

As part of this fix I made two database statements more similar.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_OP_DEPTH_MOVED_PAIR): Rename to...

(STMT_SELECT_MOVED_DESCENDANTS_SHD): and rename some aliases.

(STMT_SELECT_MOVED_DESCENDANTS): Rename to...

(STMT_SELECT_MOVED_DESCENDANTS_SRC): and update query layout and result

columns.

* subversion/libsvn_wc/wc_db.c

(op_revert_txn): Update caller to avoid db query that might fail to

obtain information we already have.

(moved_descendant_commit): Update statement usage.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_resolve_break_moved_away_internal): Remove function.

(svn_wc__db_op_break_move_internal): New function.

* subversion/libsvn_wc/wc_db_update_move.c

(resolve_delete_raise_moved_away): Update query usage.

(break_move): Rename to...

(svn_wc__db_op_break_move_internal): ... this and verify if the move

source actually exists (which in some cases it didn't)

(svn_wc__db_resolve_break_moved_away_internal): Rename to...

(break_moved_away): ... this. Update caller.

(break_moved_away_children_internal): Rename to...

(break_moved_away_children): ... this. Update statement usage.

The original code read a non existing op-depth column and as

such always got op-depth 0.

(svn_wc__db_resolve_break_moved_away,

svn_wc__db_resolve_break_moved_away_children): Update caller.

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

(del4_update_edit_AAA): Extend test. The original version had an

assumption on the bug, but masked the real problem because it

only tested the move source.

  1. … 4 more files in changeset.
Instead of transforming nodes into an copy by changing their op-depth make

a proper copy, to allow the layer bump code to handle further edge cases

like things that are recorded while shadowing.

* subversion/libsvn_wc/wc-queries.sql

(STMT_UPDATE_OP_DEPTH_RECURSIVE): Remove query.

(STMT_COPY_OP_DEPTH_RECURSIVE): New query.

* subversion/libsvn_wc/wc_db.c

(make_copy_txn): Remove two unused arguments and their handling.

Move the flush, conflict and work item code to caller.

(svn_wc__db_op_make_copy_internal): New function, containing some

bits from make_copy_txn() and some from svn_wc__db_op_make_copy(),

running inside a transaction. Allow handling the other valid make-copy

case.

(svn_wc__db_op_make_copy): Call svn_wc__db_op_make_copy_internal to

do several queries inside a transaction.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_op_make_copy): Extend documentation.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_op_make_copy_internal): New function.

* subversion/libsvn_wc/wc_db_update_move.c

(tc_editor_delete): Use svn_wc__db_op_make_copy_internal() to make

the copy.

  1. … 4 more files in changeset.
* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_OP_DEPTH_MOVED_PAIR): The op-depth we want to use is the

same for all records, so only query it once.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_OP_DEPTH_MOVED_PAIR): Use a normal join to make it easier

to compare this statement with others.

Remove more duplicated DB operations in the move-update logic.

* subversion/libsvn_wc/wc-queries.sql

(STMT_DELETE_WORKING_OP_DEPTH_ABOVE): Remove unused statement.

* subversion/libsvn_wc/wc_db_update_move.c

(tc_editor_delete): No need to remove nodes here, when the layer copying

handles this later. Avoids bad intermediate DB states and losing move info.

  1. … 1 more file in changeset.
Turn the replace_moved_layer() function in the move-update logic into an

internal wc_db function. This allows hiding a few more functions that are

too easy to abuse. And this function might be useful outside the move logic.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_DESCENDANTS_OP_DEPTH_RV): Handle incomplete presence.

(STMT_SELECT_NO_LONGER_MOVED_RV): Obtain shadowing information.

(STMT_DELETE_NO_LOWER_LAYER): Remove unused statement.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_extend_parent_delete): Make static and rename to...

(db_extend_parent_delete): ... this.

(svn_wc__db_retract_parent_delete): Make static and rename to...

(db_retract_parent_delete): ... this.

(insert_base_node,

db_base_remove): Update caller.

(svn_wc__db_op_copy_layer_internal): New function.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_extend_parent_delete,

svn_wc__db_retract_parent_delete): Remove functions.

(svn_wc__db_op_copy_layer_internal): New function.

* subversion/libsvn_wc/wc_db_update_move.c

(delete_move_leaf): Remove function. Folded queries to fold this

function into its only caller.

(replace_moved_layer): Moved to wc_db.c as svn_wc__db_op_copy_layer_internal.

(drive_tree_conflict_editor): Update caller. Verify lock.

(bump_moved_layer): Update caller. Verify lock on origin.

  1. … 3 more files in changeset.
Stop doing some work twice in the move-update logic, now that we can rely

on the layer duplicate code to the right thing.

* subversion/libsvn_wc/wc-queries.sql

(STMT_DELETE_NO_LOWER_LAYER,

STMT_REPLACE_WITH_BASE_DELETED): Remove recursion over descendants.

* subversion/libsvn_wc/wc_db_update_move.c

(delete_move_leaf): Stop handling descendants too, as our only caller

does that for us.

* subversion/libsvn_wc/wc_db_update_move.c

(delete_move_leaf): This function is called per node, so no need to recurse.

(update_moved_away_node): Remove unneeded call.

Handled from the layer update.

  1. … 1 more file in changeset.
Make the move-update-bump code properly recursive.

Some of the functions documented that they implemented recursive behavior,

but didn't really work this way as you can't use an Sqlite statement in

multiple places at once. Once the function returns the statement is used

as it was left in the inner function.

This allows integrating the two separate parts of the layer copy code.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_NO_LONGER_MOVED_RV): New statement.

(STMT_SELECT_MOVED_PAIR3): Update query to only find moves at the intended

op-depth.

* subversion/libsvn_wc/wc_db_update_move.c

(update_moved_away_node): Remove call to delete_move_leaf, that was already

documented to be placed wrong.

(replace_moved_layer): Use standard argument ordering. Implement the delete

part of the layer copying.

(drive_tree_conflict_editor): Update caller.

(bump_moved_layer): Cleanup argument usages. Pass calculated path.

(bump_pair_t): New struct.

(bump_moved_away): Cache query results to allow recursing. Otherwise the

statement is done once the inner function returns. Remove source hash,

as we can no longer get in an endless loop because we use strict op-depth.

(svn_wc__db_bump_moved_away): Update caller.

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

(nested_move_update): Extend test.

(move4_update_delself_AAA): Update expected results. Extend test.

  1. … 2 more files in changeset.
Make the move-update bumping code properly ignore not-present nodes

on the move target. These nodes can exist when moving a node with

not-present nodes (like after a commit, svn up -r 0), or when a mixed

revision tree would be recorded as move.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_LAYER_FOR_REPLACE): Extend query to obtain info about current

data at destination.

(STMT_SELECT_CHILDREN_OP_DEPTH): Rename to...

(STMT_SELECT_DESCENDANTS_OP_DEPTH_RV): ... this to document that it selects

more than immediate children. Ignore not-present nodes.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_extend_parent_delete): Add optional output argument.

(insert_base_node): Update caller.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_extend_parent_delete): Add optional output argument.

* subversion/libsvn_wc/wc_db_update_move.c

(tc_editor_delete): Update query user.

(update_moved_away_node): Update caller.

(replace_moved_layer): Use improved query. Add some still commented logic

detecting cases where a new node is added unshadowed, which in some

cases need special handling.

  1. … 3 more files in changeset.
Make some op-depth diagnostics code in wc_db capable of handling moves

that don't copy the exact whole layer. (Which is possible during conflict

handling and when the root of a mixed revision move is represented as move)

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_OP_DEPTH_MOVED_TO): Simplify query to avoid the case where

values might be NULL.

* subversion/libsvn_wc/wc_db.c

(follow_moved_to): Update query usage. Add some comments.

  1. … 1 more file in changeset.
Properly remove the working copy delete information for descendants of nodes that

are removed by the 'update move' handling. This resolves a case of an invalid

database state identified by the move4_update_delself_AAA() op-depth test.

* subversion/libsvn_wc/wc-queries.sql

(STMT_DELETE_WORKING_BASE_DELETE): Make the '0' for BASE nodes configurable

to allow using this same query for higher layers.

* subversion/libsvn_wc/wc_db.c

(db_base_remove): Update statement usage.

* subversion/libsvn_wc/wc_db_update_move.c

(delete_move_leaf): Replace baton with separate arguments. Retract

base-deletes recursively, instead of only for the node itself.

(update_moved_away_node): Update caller.

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

(move4_update_delself_AAA): Update assumptions, after fixing the root cause.

(test_funcs): Mark move4_update_delself_AAA PASS.

  1. … 3 more files in changeset.
Reintegrated the remote-only-status branch.
  1. … 25 more files in changeset.
In the delete node processing: obtain the node data directly via a query

instead of a read info and upto three more functions. Retrieving the

op-depth of the interesting layers earlier avoids a lot of unneeded

guessing, which appear to cause some bugs that I intend to fix in followup

patches.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_MOVED_FOR_DELETE): Replace subquery with value.

* subversion/libsvn_wc/wc_db.c

(delete_node): Obtain op_depth of what to delete and what to keep to avoid

having to query for these values many times.

  1. … 1 more file in changeset.
* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_MOVED_PAIR3): Following up on r1567109, define the complete

ordering instead of only that of paths.

Resolve an unneeded dependency on undocumented and version specific Sqlite

behavior. Without this patch some moved nodes might not be bumped during

update.

This resolves two failures in the test suite when running the tests with

the SVN_SQLITE_REVERSE_UNORDERED_SELECTS compile time option. Without this

patch these same errors can also occur when Sqlite chooses an unexpected

query plan.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_MOVED_PAIR3): Use a UNION ALL and order by to make the query

report the matched rows in the ordering we expect in the C code.

(read: ancestor first)

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_LOCAL_RELPATH_OP_DEPTH): Tweak query to always return results

in an explicit order, as the usage of this query requires ancestors to be

inserted before their children.

Update a query to work slightly faster and to reduce the dependency on

explicitly unspecified sqlite behavior.

This fixes 30 op-depth tests when running the tests with our verification

triggers in maintainer mode *combined with*

SVN_SQLITE_REVERSE_UNORDERED_SELECTS.

Note that this problem doesn't affect non maintainer mode behavior, as

we don't rely on the ordering there.

* subversion/libsvn_wc/wc-queries.sql

(STMT_INSERT_DELETE_FROM_NODE_RECURSIVE): Tweak query to force inserting

the rows in a strict order. Assume that the op-root matches our check.

(STMT_INSERT_DELETE_LIST): Update to match

STMT_INSERT_DELETE_FROM_NODE_RECURSIVE, to make sure notifications

match actual behavior.

Apply some minor preparing and correctness changes for the move logic in

libsvn_wc.

This patch adds support for telling the wc_db revision bump whether an actual

update was performed. With this knowledge a lot of move handling logic can

be simplified for the generic case in future patches.

Some parts of this patch are to make sure some move behavior patches I have

kept local for some time don't have to keep in sync with more files than

necessary.

* subversion/libsvn_wc/externals.c

(close_edit): Update caller.

* subversion/libsvn_wc/update_editor.c

(edit_baton): Add variable.

(close_directory): Update editor baton on edit actions.

(close_edit): Pass edited value.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_LOCAL_RELPATH_OP_DEPTH): Add column.

* subversion/libsvn_wc/wc_db.c

(bump_revisions_post_update): Add argument. Add comment.

(svn_wc__db_op_bump_revisions_post_update): Pass argument

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_op_bump_revisions_post_update): Add argument.

* subversion/libsvn_wc/wc_db_update_move.c

(replace_moved_layer): Properly extend parent delete.

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

(check_tree_conflict_repos_path): Turn possible segfault in proper

test error.

  1. … 6 more files in changeset.
* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_NODE_CHILDREN_INFO): Ask the database for the items in the order

where we don't handle intermediate depths more than we should.

Fix a very ugly case in 'svn status' where 'svn status wc' and

'svn status wc/path' could show a different status for path.

This also makes 'svn status' always describe the highest moved_to when

there are multiple moves from a single location.

(This behavior was undefined before, but identical to what you would get with

the usual index usage in sqlite)

This patch has the nice side effect that it resolves the most common crash

report in the current AnkhSVN version: an assertion caused by an invalid

move stored in wc.db.

* subversion/libsvn_wc/status.c

(read_info): Move this function into wc_db.c to allow using a lock and

access to private apis.

(assemble_status): Update caller. Update moved_to usage.

(get_dir_status,

get_child_status,

svn_wc__internal_walk_status): Update caller.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_MOVED_TO_NODE): New query.

* subversion/libsvn_wc/wc_db.c

(read_children_info): Set moved_here as documented: only for op-roots.

Don't duplicate name for every higher layer.

Hook moved_to information in a linked list, to provide users all move

information.

(read_single_info,

svn_wc__db_read_single_info): New function. Based on status' read_info,

but reports more accurage results on shadowed nodes.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_moved_to_info_t): New struct.

(svn_wc__db_info_t): Describe all moved_tos.

(svn_wc__db_read_single_info): New function.

* subversion/tests/cmdline/stat_tests.py

(status_move_missing_direct): Remove XFail marker.

  1. … 4 more files in changeset.
* subversion/libsvn_wc/wc-queries.sql

(STMT_INSTALL_WORKING_NODE_FOR_DELETE): Make overwriting existing records

an error (which would show a failure in svn_wc__db_extend_parent_delete)

* subversion/libsvn_wc/wc-queries.sql

(STMT_COMMIT_DESCENDANTS_TO_BASE,

STMT_COMMIT_UPDATE_ORIGIN): Use RELPATH_SKIP_JOIN() in query to handle

specific corner cases properly.

When bumping an updated tree don't assume the origin is always BASE, as this

same function should also used for recursive move updates.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_HAS_NON_FILE_CHILDREN,

STMT_SELECT_HAS_GRANDCHILDREN): Make op_depth an argument. Limit results to help Sqlite.

* subversion/libsvn_wc/wc_db_update_move.c

(depth_sufficient_to_bump): Order arguments properly. Add op_depth argument.

(bump_moved_away): Update documentation for this and expected followup.

  1. … 1 more file in changeset.
Apply more strict op_depth fixes to move handling to properly handle

shadowed moves.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_OP_DEPTH_MOVED_TO): Match the requested node with its direct

shadowing move by a join.

(STMT_SELECT_MOVED_HERE): Remove unused query.

* subversion/libsvn_wc/wc_db.c

(clear_moved_here): Use the moved_to relative path, as that is unique,

because the moved_from relpath doesn't have to be. This also allows

removing a now unused query. Return error when the target is not found.

(db_base_remove): Update caller. Use different column of existing query.

(follow_moved_to): Simplify code, based on the new query. Don't hide moves

that don't specify the same revision or repos_relpath. While they are

out of sync they are still moves, that need to be tracked... or the

conflict handling isn't able to resolve the problem.

  1. … 1 more file in changeset.
Add a working copy query test to automatically find queries with an idential

query plan as not having duplicates reduces maintenance and helps avoiding

query planner costs.

* subversion/libsvn_wc/upgrade.c

(migrate_single_tree_conflict_data): Use existing instead of specialized

queries.

* subversion/libsvn_wc/wc-queries.sql

(STMT_DELETE_MOVED_BACK): Remove duplicate.

(STMT_UPDATE_ACTUAL_CONFLICT_DATA,

STMT_INSERT_ACTUAL_CONFLICT_DATA): Remove duplicates.

* subversion/libsvn_wc/wc_db.c

(handle_move_back): Update query user.

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

(includes): Add svn_hash.h.

(test_query_duplicates): New function.

(test_funcs): Add test_query_duplicates.

  1. … 3 more files in changeset.
Following up on r1538702, really restrict the moves to what is moved

at a specific op-depth by using an existing query.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_MOVED_PAIRS_DEPTH): Remove now unused query.

* subversion/libsvn_wc/wc_db_update_move.c

(break_moved_away_children_internal): Use more restricted query.

  1. … 1 more file in changeset.
Tweak some wc.db query usages in preparation for changing

svn_wc__db_retract_parent_delete()'s behavior to keep

the moved to state valid.

No functional changes.

* subversion/libsvn_wc/wc-queries.sql

(STMT_DELETE_NODE): Redefine with additional argument, as this name

didn't explain the true behavior anyway.

(STMT_DELETE_ALL_LAYERS): Rename to ...

(STMT_DELETE_NODE_ALL_LAYERS): ... this, to document that it removes

all layers of a node by its name.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_retract_parent_delete): Implement logic in c that used to be

performed in sqlite to allow handling other cases. Document what needs

to be fixed. As this function is only used within sqlite transactions

there is no measurable performance impact.

(remove_node_txn,

commit_node): Use STMT_DELETE_NODE_ALL_LAYERS instead of the old,

but (identical) STMT_DELETE_NODE.

  1. … 1 more file in changeset.