Checkout Tools
  • last updated 19 mins ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Update wiki links to point to the new(ish) Confluence Wiki.
  1. … 4 more files in changeset.
Add resolver support for moved-file vs moved-file upon update.

The resolver now supports move vs move tree conflicts for files after

an update operation.

Two new resolution operations are available:

(m) - override incoming move and merge incoming changes from 'alpha-moved'

to 'alpha-also-moved'

(M) - accept incoming move and merge local changes from 'alpha-also-moved'

to 'alpha-moved'

Where the file was originally called 'alpha', was renamed to 'alpha-moved'

in the repository, and renamed to 'alpha-also-moved' in the working copy.

Because the local move is broken during the update operation when the

delete-half of the move is updated, the resolver only has the copied half

move available in the working copy. To find the local move destination the

resolver queries the working copy database for nodes which are copies of

the conflict victim's repository path. This can of course lead to ambiguous

results in case a node is first copied and then moved, in which case the

resolver offers the user a choice of local move targets in the usual way.

* subversion/include/private/svn_wc_private.h

(svn_wc__find_copies_of_repos_path): Declare.

* subversion/libsvn_client/conflicts.c

(conflict_tree_update_local_moved_away_details): New conflict details struct.

(resolve_both_moved_file_update_keep_local_move,

resolve_both_moved_file_update_keep_incoming_move): New resolution handlers.

(conflict_tree_get_details_update_local_moved_away): New details fetcher

which locates copied nodes corresponding to the local move.

(get_both_moved_file_paths): New helper function.

(conflict_tree_get_description_update_both_moved_file_merge,

conflict_tree_get_description_update_both_moved_file_move_merge): New

functions which describe incoming move vs local move conflicts flagged

during updates of files.

(configure_option_both_moved_file_merge): Hook up the new options.

(svn_client_conflict_option_get_moved_to_abspath_candidates2,

svn_client_conflict_option_set_moved_to_abspath2,

conflict_type_specific_setup): Support the newly added conflict options.

* subversion/libsvn_wc/node.c

(svn_wc__find_copies_of_repos_path): New.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_COPIES_OF_REPOS_RELPATH): New query which locates copies of a

particular repository relpath with a particular node kind in working copy.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_find_copies_of_repos_path): New wc_db API to execute above query.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_find_copies_of_repos_path): Declare.

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

(create_file_move_vs_file_move_update_conflict): New helper function.

(test_update_file_move_vs_file_move,

test_update_file_move_vs_file_move_accept_move, test_funcs): New tests

which exercise both of the newly added conflict resolution options.

  1. … 6 more files in changeset.
* subversion/libsvn_wc/wc_db.c

(svn_wc__db_find_working_nodes_with_basename): Remove unused variable.

Fix issue #4694 "cherry-pick edit after file was moved on source branch"

Add conflict resolver support for cherry-picking changes from files which

have been moved on the merge source branch. Support multiple merge target

candidates, and run a file merge by default if only one candidate exists.

This implementation extends the existing "local move file text merge"

resolution option with support for 'move siblings' as merge targets.

I am still considering whether this case conceptually deserves a dedicated

resolution option. However, it would be nice to backport this feature to

SVN 1.10. The only API change required by this implementation is allowing

another 'option' parameter value for the existing API functions

svn_client_conflict_option_get_moved_to_abspath_candidates()

and svn_client_conflict_option_set_moved_to_abspath(). This change is

ABI compatible, with the only caveat that a new 'svn' binary running

on top of an older libsvn_client could trigger an input assertion.

Because we require 'svn' to be kept in sync with the libraries this

should not be a problem in practice.

We can still improve the API for >= 1.11 later.

* subversion/include/private/svn_wc_private.h

(svn_wc__find_working_nodes_with_basename): Declare.

* subversion/include/svn_client.h

(svn_client_conflict_option_get_moved_to_abspath_candidates,

svn_client_conflict_option_set_moved_to_abspath): Document that

svn_client_conflict_option_local_move_file_text_merge is now

a valid option parameter for these functions.

* subversion/libsvn_client/conflicts.c

(conflict_tree_local_missing_details): Add and document wc_siblings

and preferred_sibling_idx fields.

(collect_sibling_move_candidates): New helper function.

(conflict_tree_get_details_local_missing): Try to find the 'local missing'

node which corresponds to the conflict victim in the working copy.

Technically, this would require scanning the log for every item in the WC.

However, assuming a cherry-pick from a moved file to a non-moved file, we

can use a short-cut: The basename of the non-moved file is already known

because it must match one of the locations which the moved file was moved

from. So we can restrict tracing of log history to nodes with a basename

which occurs in the chain of file moves on the merge source branch.

(resolve_local_move_file_merge, configure_option_local_move_file_merge):

Add support for merging to WC siblings of conflict victims which are

'locally missing'.

(svn_client_conflict_option_get_moved_to_abspath_candidates,

svn_client_conflict_option_set_moved_to_abspath): Add support for the

svn_client_conflict_option_local_move_file_text_merge resolution option.

* subversion/libsvn_wc/node.c

(svn_wc__find_working_nodes_with_basename): New private API function which

simply forwards to wc_db.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_PRESENT_HIGHEST_WORKING_NODES_BY_BASENAME_AND_KIND): New query.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_find_working_nodes_with_basename): New wc_db API function which

finds present working nodes with a given basename.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_find_working_nodes_with_basename): Declare.

* subversion/svn/conflict-callbacks.c

(build_tree_conflict_options, handle_tree_conflict): Support multiple merge target

candidates with the svn_client_conflict_option_local_move_file_text_merge option.

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

(test_funcs): Mark test_cherry_pick_post_move_edit as PASS.

  1. … 8 more files in changeset.
Rename svn_wc__find_repos_node_in_wc() to svn_wc__db_find_repos_node_in_wc().

This namespace is more appropriate for wc_db code, and we might eventually

want to expose a similar libsvn_wc inteface which libsvn_client can use.

No functional change.

* subversion/libsvn_wc/conflicts.c

(svn_wc__guess_incoming_move_target_nodes): Update caller.

* subversion/libsvn_wc/wc_db.c,

subversion/libsvn_wc/wc_db.h

(svn_wc__find_repos_node_in_wc): Rename to ...

(svn_wc__db_find_repos_node_in_wc): ... this.

  1. … 2 more files in changeset.
Record the move target path in a moved-away tree conflict skel.

Updates can modify the NODES table in ways which discard local move

information about tree conflict victims. One example is:

echo foo >> epsilon/foo.txt

svn mv epsilon alpha

svn ci # create r2

svn up -r1

svn mv epsilon beta

svn up -r2

When 'epsilon' is updated to r2, a tree conflict is raised and the move

'epsilon' -> 'beta' is deleted from the NODES table. 'beta' remains a copy.

$ svn status

A + beta

! C epsilon

> local dir moved away, incoming dir delete or move upon update

$

The conflict skel for the tree conflict on 'epsilon' now contains:

(tree () moved-away deleted epsilon)

This leaves the resolver with insufficient information about the local

move 'epsilon' -> 'beta' which existed before the update. To resolve this

conflict we must be able to identify the copy 'beta' as one potential move

target. The fact that copyfrom on 'beta' points to 'epsilon' is insufficient

because, in the general case, this copy could have occurred independently

of the tree conflict.

As of this commit, the tree conflict skel also records a move destination

path, 'beta' in our example:

(tree () moved-away deleted epsilon beta)

Apart from recording the path in the skel, this commit introduces no other

visible change in behaviour. In the future, the conflict resolver will be

able to make use of this new information to correlate the copy 'beta' with

the conflict victim 'epsilon' in the above example.

Note that old clients will simply ignore the new extra element at the end

of the conflict skel.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_skel_add_tree_conflict): Add move_dst_op_root_abspath

parameter and append it to the skel if it is non-NULL.

(svn_wc__conflict_read_tree_conflict): Return the move_dst_op_root_abspath

if present in the conflict skel.

(read_tree_conflict_desc, resolve_tree_conflict_on_node,

svn_wc__conflict_tree_update_break_moved_away,

svn_wc__conflict_tree_update_incoming_move,

svn_wc__conflict_tree_update_local_add): Update callers.

* subversion/libsvn_wc/conflicts.h

(svn_wc__conflict_skel_add_tree_conflict,

svn_wc__conflict_read_tree_conflict): Update declaration and docstring.

* subversion/libsvn_wc/questions.c

(internal_conflicted_p): Update caller.

* subversion/libsvn_wc/tree_conflicts.c

(svn_wc__add_tree_conflict): Update caller.

* subversion/libsvn_wc/update_editor.c

(open_root, check_tree_conflict, add_directory, open_directory,

add_file, open_file, change_file_prop): Update callers.

* subversion/libsvn_wc/upgrade.c

(svn_wc__upgrade_conflict_skel_from_raw): Update caller.

* subversion/libsvn_wc/wc_db.c

(revert_maybe_raise_moved_away): Update caller.

* subversion/libsvn_wc/wc_db_update_move.c

(create_tree_conflict, fetch_conflict_details): Update callers.

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

(test_serialize_tree_conflict): Update test expectations.

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

(check_db_conflicts): Update caller.

  1. … 9 more files in changeset.
Don't ignore error returns.

c: [skip]

Found by: danielsh

using tools/dev/warn-unused-result.sh

  1. … 7 more files in changeset.
In the conflict resolver, fix the locating of move targets in the

working copy during merges. The previous implementation only worked

for update/switch, because it assumed that a move target's revision

would always match the incoming-new revision of the conflict victim.

This was a design mistake, since this condition won't hold for merges.

Found by: brane

* subversion/include/private/svn_wc_private.h

(svn_wc__guess_incoming_move_target_nodes): Remove 'rev' parameter.

* subversion/libsvn_client/conflicts.c

(follow_move_chains): Move target candidates from libsvn_wc are now

identified only by URL. So check ancestry between the conflict victim

and each move target candiate in case their revisions do not match.

Add 'victim_repos_relpath' parameter.

(init_wc_move_targets, configure_option_local_move_file_merg): Pass the

victim's repos relpath to follow_move_chains().

* subversion/libsvn_wc/conflicts.c

(svn_wc__guess_incoming_move_target_nodes): Remove 'rev' parameter.

* subversion/libsvn_wc/wc-queries.sql

(STMT_FIND_REPOS_PATH_IN_WC): Ignore the revision column.

* subversion/libsvn_wc/wc_db.c

(svn_wc__find_repos_node_in_wc): Remove 'rev' parameter.

* subversion/libsvn_wc/wc_db.h

(svn_wc__find_repos_node_in_wc): Remove 'rev' parameter.

  1. … 5 more files in changeset.
Following up on r1807584, remove unnecessary SQL statements from

the WC schema definition and simplify a step in the upgrade process.

* subversion/libsvn_wc/wc-metadata.sql

(STMT_CREATE_NODES): Remove and include into STMT_CREATE_SCHEMA.

(STMT_CREATE_NODES_TRIGGERS): Likewise.

(STMT_CREATE_EXTERNALS): Likewise.

(STMT_UPGRADE_TO_31_ALTER_TABLE, STMT_UPGRADE_TO_31_FINALIZE):

Combine these statements into a single ...

(STMT_UPGRADE_TO_31): ... which is new.

(STMT_UPGRADE_TO_32): Remove as unused.

(-- format: YYY): Remove as unused, it converted to a comment anyway.

* subversion/libsvn_wc/wc_db.c

(init_db): Remove use of deleted SQL statements.

* subversion/libsvn_wc/upgrade.c

(bump_to_31): Remove the manual check for the existence of the

NODES.inherited_props column since we no longer support the

unreleased formats prior to format 20 that did not have

a NODES table.

* subversion/tests/libsvn_wc/utils.c

(svn_test__create_fake_wc): Remove use of deleted SQL statements.

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

(schema_statements): Remove use of deleted SQL statements.

  1. … 4 more files in changeset.
Raise a malfunction instead of segfaulting due to a null pointer dereference

with a corrupted wc.db

Found by: TortoiseSVN dump

* subversion/libsvn_wc/wc_db.c

(db_read_repos_info): Raise malfunction if WORK_DEL_RELPATH and

BASE_DEL_RELPATH are null. We have the same check in get_info_for_copy().

Add a conflict resolver option which follows an incoming file move.

This new option works for update, switch, and merge operations.

There is no unit test for this option yet.

I have not tested reverse-updates or reverse-merges yet.

We need many many additional tests anyway.

* subversion/include/private/svn_wc_private.h

(svn_wc__guess_incoming_move_target_node): Declare.

* subversion/include/svn_client.h

(svn_client_conflict_option_incoming_move_file_text_merge): New option ID.

* subversion/libsvn_client/conflicts.c

(conflict_tree_incoming_delete_details): Add 'moved_to_abspath'.

(resolve_merge_incoming_added_file_text_merge): Fix typo in comment.

(resolve_incoming_move_file_text_merge): New resolver function.

(configure_option_incoming_move_file_merge): New option config function.

(svn_client_conflict_tree_get_resolution_options): Configure new option.

* subversion/libsvn_wc/conflicts.c

(svn_wc__guess_incoming_move_target_node): Implement. This function

attempts to map a deleted tree conflict victim to a working copy node

which corresponds to the incoming move target.

* subversion/libsvn_wc/wc-queries.sql

(STMT_FIND_REPOS_PATH_IN_WC): New query. Returns all local relpaths at

the 'working' layer (i.e. from nodes_current) which map to a particular

repository path at a particular revision.

* subversion/libsvn_wc/wc_db.c

(svn_wc__find_repos_node_in_wc): New. Runs the above query.

* subversion/libsvn_wc/wc_db.h

(svn_wc__find_repos_node_in_wc): Declare.

* subversion/svn/conflict-callbacks.c

(builtin_resolver_options): Wire up the new option in the conflict menu.

  1. … 7 more files in changeset.
* subversion/libsvn_wc/wc_db.c

(relocate_txn): Add missing newline. Note a few more limitations.

Remove some dead code from libsvn_wc. We always use the function that

also looks in parent directories instead of this function that gives

just a result when the node itself has the data.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_IPROPS): Remove unused query.

* subversion/libsvn_wc/wc_db.c

(db_read_cached_iprops,

svn_wc__db_read_cached_iprops): Remove functions.

  1. … 1 more file in changeset.
Replace an ugly assertion caused by a corrupt working copy database with an

almost as ugly, but better to diagnose error message.

Somehow these few cases which should be completely impossible to trigger

without editing wc.db are reported as TortoiseSVN exception reports.

I explicitly add these extra checks only to the most common read operation,

as this function is usually called first and catching every invalid working

copy database is impossible without a performance and a maintenance impact.

* subversion/libsvn_subr/token.c

(svn_token__from_word_err): Ensure NULL is handled safely.

* subversion/libsvn_wc/wc_db.c

(column_token_err): New helper function.

(read_info): Use column_token_err when parsing tokens.

  1. … 1 more file in changeset.
Fix a theoretical segfault when trying to resolve a conflict that doesn't

exist in ACTUAL, but when an ACTUAL row does exist.

I don't know if this problem ever occured, but fixing this case doesn't

affect performance. (All callers appear to check if a conflict exists

before calling this function)

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_op_mark_resolved_internal): Don't segfault when the node has

an ACTUAL node but no conflict stored in it.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_op_mark_resolved): Extend docs a bit.

  1. … 1 more file in changeset.
Resolve a segfault on an incoming delete of an ancestor of a switched path

in a tree with other changes.

Found by: TortoiseSVN dump

ivan

(Reproduction recipe and patch by me)

* subversion/libsvn_wc/wc_db.c

(make_copy_txn): Properly detect a switched tree in all cases.

* subversion/tests/cmdline/update_tests.py

(update_delete_switched): New function.

(test_list): Add update_delete_switched.

  1. … 1 more file in changeset.
Resolve a possible segfault (caused by using an uninitialized variable)

on reverting the root of a move but not its descendants.

Found by: TortoiseSVN dump

ivan

(Reproduction recipe and patch by me)

You probably need valgrind or some debug diagnostics (such as used by the

windows maintainer build) to find the problem.

* subversion/libsvn_wc/wc_db.c

(revert_maybe_raise_moved_away): New function, extracted from...

(op_revert_txn): ... here. Reduce scope of some variables.

* subversion/tests/cmdline/revert_tests.py

(moved_dir_partial): New function.

(test_list): Add revert_upwards.

  1. … 1 more file in changeset.
Rename public API svn_relpath_limit() to svn_relpath_prefix().

No functional change intended.

* subversion/include/svn_dirent_uri.h

(svn_relpath_limit): Rename to ...

(svn_relpath_prefix): ... this.

* subversion/libsvn_subr/dirent_uri.c

(svn_relpath_limit,

svn_relpath_prefix): Sync. implementation with declaration.

* subversion/libsvn_wc/wc_db.c

(read_children_info,

read_single_info,

scan_addition,

svn_wc__db_scan_moved,

svn_wc__db_scan_moved_to_internal): Update callers.

* subversion/libsvn_wc/wc_db_update_move.c

(create_node_tree_conflict,

bump_moved_layer,

svn_wc__db_op_raise_moved_away_internal): Same.

  1. … 3 more files in changeset.
When obtaining conflicts from wc-db, also allow directly obtaining properties.

We already read from the records that have the data, so this doesn't have a

real cost, while reading them separately (introduced in r1667228) does.

The final result after the combination of these patches is that we provide

better information using less database transactions, so this provides an

overall performance improvement.

This patch also makes the resolver avoid creating temporary files during

resolves where the code already knows that nobody is using these files,

because there is no resolver callback.

* subversion/libsvn_wc/conflicts.c

(read_prop_conflict_descs): Stop abusing no tempfile flag for not showing

details. Only read base properties if we don't already have them.

(svn_wc__read_conflicts): Allow obtaining skel in one step, and not reading

not-tree conflicts.

(resolve_tree_conflict_on_node,

svn_wc__mark_resolved_text_conflict,

svn_wc__mark_resolved_prop_conflicts): Update caller.

(conflict_status_walker): Use one db operation instead of two.

* subversion/libsvn_wc/copy.c

(copy_versioned_file,

remove_node_conflict_markers): Update caller.

* subversion/libsvn_wc/delete.c

(create_delete_wq_items): Update caller.

* subversion/libsvn_wc/entries.c

(read_one_entry): Update caller.

* subversion/libsvn_wc/info.c

(build_info_for_node): Update caller.

(svn_wc__get_info): Update caller.

* subversion/libsvn_wc/props.c

(svn_wc__create_prejfile): Update caller.

* subversion/libsvn_wc/questions.c

(internal_conflicted_p): Update caller.

* subversion/libsvn_wc/tree_conflicts.c

(svn_wc__get_tree_conflict): Update caller.

* subversion/libsvn_wc/wc.h

(svn_wc__read_conflicts): Add two arguments.

* subversion/libsvn_wc/wc_db.c

(op_revert_txn): Update caller.

(svn_wc__db_read_conflict,

svn_wc__db_read_conflict_internal): Handle properties.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_read_conflict): Add optional properties argument.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_read_conflict_internal): Add optional properties argument.

* subversion/libsvn_wc/wc_db_update_move.c

(create_tree_conflict,

bump_moved_layer,

svn_wc__db_op_raise_moved_away): Update caller.

* subversion/libsvn_wc/workqueue.c

(run_prej_install,

run_set_text_conflict_markers,

run_set_property_conflict_marker): Update caller.

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

(test_prop_conflict_resolving,

test_binary_file_conflict): Update caller.

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

(check_db_conflicts): Update caller.

  1. … 15 more files in changeset.
Don't lose files that replace file externals, when they are replaced

by actual file. The regression test for this issue uncovered the

commit fix in r1663991, but the change to db_base_remove() in this

revision resolves the problem in a different way.

* subversion/libsvn_wc/externals.c

(svn_wc__external_remove): When deleting a file external, request

addition of a not-present marker in its place.

* subversion/libsvn_wc/wc-queries.sql

(STMT_DELETE_BASE_RECURSIVE): Include node itself.

* subversion/libsvn_wc/wc_db.c

(db_base_remove): Detect if a deleted file external really needs

to be replaced by a marker. Update caller.

* subversion/tests/cmdline/externals_tests.py

(file_external_to_normal_file): New test.

(test_list): Add file_external_to_normal_file.

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

(check_db_rows): Don't use print_row before all values are set

in the row struct to avoid segfaults.

(revert_file_externals): Expect not_present rows to appear.

  1. … 4 more files in changeset.
Properly calculate the after-commit repository path of adds/replacements.

When a switched node is replaced (or a not present node has a different

repository path), the node was recorded as committed at a different

url then where it was actually committed.

A regression test (involving file externals) will be added shortly.

[ Note from the future: The test was added in r1664035. ]

[ Note from the further future: Another test was added in r1666258. ]

* subversion/libsvn_wc/wc_db.c

(determine_repos_info): Rename to...

(determine_commit_repos_info): ... this, to make it clear that it

follows commit rules. Properly follow the shadowing rules for

calculating the commit paths.

(commit_node): Update caller.

Introduce svn_error_quick_wrapf(), a variable-arguments version of

svn_error_quick_wrap(). Use it to simplify previous uses of the latter.

* subversion/include/svn_error.h

* subversion/libsvn_subr/error.c

(svn_error_quick_wrapf): New function and macro of the same name.

* subversion/libsvn_fs_fs/hotcopy.c

(hotcopy_body): Use it.

* subversion/libsvn_subr/io.c

(svn_io_copy_perms,

svn_io_open_unique_file3): Use it.

* subversion/libsvn_wc/wc_db.c

(read_info): Use it.

* subversion/libsvn_wc/wc_db_wcroot.c

(svn_wc__db_wcroot_parse_local_abspath): Use it.

* subversion/svnbench/svnbench.c

(sub_main): Use it.

* subversion/svn/svn.c

(sub_main): Use it.

  1. … 7 more files in changeset.
Fix the most acute problems in the regression in the entries compatibility

code that made it impossible to read the 'parent stubs' of nodes when there

is an obstructing working copy. This fixes the status/entry run in the

revert test that didn't work with entries, and a case in the entries

compatibility tests that only happened to work, just because the child

directory was similar to what was recorded in the ancestor.

This makes entries.c include the private wc_db api, which is ugly.

But I think it is a better solution than using sqlite directly,

and hardcoding wc_id 1 as we did before.

There are still a few remaining cases where we read info from the

obstructing working copy, but these don't affect the creation

of the stub fields.

* subversion/libsvn_wc/entries.c

(SVN_WC__I_AM_WC_DB): Define.

(includes): Add wc_db_private.h

(get_info_for_deleted,

read_one_entry): Add wcroot, relpath arguments as alternate

for the still passed db, abspath. Use wc_db internal

functions where available to be able to read below obstruction

when reading from the parent dir.

(read_entries_new): Pass wcroot, dir_relpath.

(read_entry_pair): Rename to...

(read_entry_pair_txn): ... this and pass wcroot, dir_relpath.

(read_entry_pair): New wrapper function. Obtaining wcroot and lock.

(read_entries): Rename wcroot_* arguments to dir_* as wcroot isn't

the right name in wc-ng. Obtain wcroot instance and use wc_db lock

around call.

(svn_wc__entries_read_internal): Remove sqlite level lock, as read

entries obtains a better lock itself.

* subversion/libsvn_wc/wc_db.c

(scan_deletion_txn): Rename to..

(scan_deletion): ... this.

(svn_wc__db_scan_deletion_internal): New function.

(svn_wc__db_scan_deletion): Update caller.

(get_info_for_copy,

db_read_repos_info,

relocate_txn): Update caller.

(svn_wc__db_scan_addition_internal): New function.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_scan_addition_internal,

svn_wc__db_scan_deletion_internal): New function.

* subversion/tests/cmdline/revert_tests.py

(revert_obstructing_wc): Expect status to work normally.

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

(test_stubs): Add assertion that would have failed before this patch.

  1. … 4 more files in changeset.
Simplify a few more code paths using the smarter Sqlite macros introduced

some time ago.

* subversion/libsvn_wc/upgrade.c

(upgrade_working_copy_baton_t,

upgrade_working_copy_txn): Remove helpers, as we can just...

(svn_wc_upgrade): ... use SVN_SQLITE__WITH_LOCK() and call the function

directly.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_txn_callback_t): Move callback type here.

(with_finalization): Write out some portions of SVN_SQLITE__WITH_LOCK(),

in a function that has initimite knowledge anyway, to avoid keeping

further unused code alive.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_txn_callback_t): Remove type.

(svn_wc__db_with_txn): Remove function.

* subversion/libsvn_wc/wc_db_util.c

(db_txn_callback_t,

txn_baton_t): Remove type.

(run_txn,

svn_wc__db_with_txn): Remove function.

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

(tree_dump_txn): Remove function.

(tree_dump): Directly call svn_wc__internal_walk_children().

  1. … 4 more files in changeset.
Make the working copy status reporter always report tree conflicts; even if

the node with the tree conflict is shadowed by a file, somewhere up the

tree.

Usually the status walker doesn't descend below files that used to be

directories, but after this patch it will descend if there are tree

conflicts below this file.

This fixes the ugly case that currently the tree conflict resolver doesn't

even see these tree conflicts, unless it just created them. So it certainly

wouldn't have resolved them properly.

* subversion/libsvn_wc/status.c

(svn_wc__internal_status_t): New struct.

(edit_baton): Update status type.

(internal_status,

assemble_status,

assemble_unversioned): Produce svn_wc__internal_status_t instead of

svn_wc_status3_t.

(send_status_structure,

send_unversioned_item): Update caller.,

(one_child_status): Update has descendants check.

(hash_stash): Copy private values.

(tweak_status_hash): Update init.

(find_dir_repos_relpath): Update usage.

(make_dir_baton): Update has descendants check.

(is_sendable_status): Update type.

(handle_statii): Update has descendants check.

(close_directory): Update caller.

(svn_wc__internal_walk_status): Update has descendants check.

(internal_status): Update output type.

(svn_wc_status3): Update caller.

(svn_wc_dup_status3): Create svn_wc__internal_status_t, but duplicate

only svn_wc_status3_t.

* subversion/libsvn_wc/wc-queries.sql

(STMT_FIND_CONFLICT_DESCENDANT): New query.

* subversion/libsvn_wc/wc_db.c

(find_conflict_descendants): New function.

(read_children_info): Set has_descendants on a node if it is a directory in

WORKING/ACTUAL or it was a directory at some layer, and has actual

descendants.

(read_single_info): Set has_descendants.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_info_t): Add boolean.

* subversion/tests/cmdline/stat_tests.py

(status_missing_conflicts): New test.

(test_list): Add status_missing_conflicts.

  1. … 4 more files in changeset.
Fix another misreported reason in the update editor, and the resolver to

handle this change without affecting features.

As part of this fix a few TODO's in the move-update conflict resolver code,

by combining the group of functions that handled breaking moves, and creating

moved_away conflicts to just two functions, that can handle the direct move

and descendant cases alike, and with proper op-depth handling.

Combining the functions uncovered yet another op-depth bug where the break

moves operation was applied to the wrong layer.

* subversion/libsvn_wc/conflicts.c

(resolve_tree_conflict_on_node): Update caller.

(conflict_status_walker_baton): Add boolean.

(conflict_status_walker): Set value in baton if we resolved something.

(svn_wc__resolve_conflicts): Continue as long as we resolved something

in the previous batch. Handle depth filtering in second pass.

Use the resolved_one boolean.

* subversion/libsvn_wc/update_editor.c

(check_tree_conflict): Report local replacements as replacements, even when

whatever was there was moved to make the conflict resolver pick the

right strategy.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_MOVED_DESCENDANTS_SHD): Remove now unused query.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_op_break_move_internal): Rename argument to match task.

(db_op_mark_resolved): Rename to...

(svn_wc__db_op_mark_resolved_internal): ... this.

(svn_wc__db_op_mark_resolved): Update caller.

(op_revert_txn): Update caller. Pass proper origin depth.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_resolve_delete_raise_moved_away): Rename to...

(svn_wc__db_op_raise_moved_away): ... this.

(svn_wc__db_resolve_break_moved_away,

svn_wc__db_resolve_break_moved_away_children): Combine into..

(svn_wc__db_op_break_moved_away): ... this.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_op_break_move_internal): Rename argument.

(svn_wc__db_op_mark_resolved_internal): Rename argument.

* subversion/libsvn_wc/wc_db_update_move.c

(find_src_op_depth): Return a more generic error, as this function

is used in more places than inside the conflict resolver.

(get_tc_info): Remove function.

(fetch_conflict_details): New function, partially based on get_tc_info.

(svn_wc__db_op_raise_moved_away_internal): Update argument. Fetch true

delete depth for created conflicts.

(svn_wc__db_resolve_delete_raise_moved_away): Rename to...

(svn_wc__db_op_raise_moved_away): ... this. Use SVN_WC__DB_WITH_TXN4()

to obtain everything inside a transaction. Mark conflict resolved

before installing new tree conflicts.

(break_moved_away_children): Rename to...

(break_moved_away): ... this and handle both cases in a single function.

(svn_wc__db_resolve_break_moved_away): Rename to...

(svn_wc__db_op_break_moved_away): ... this. Update caller. Use

SVN_WC__DB_WITH_TXN4() to calculate values inside txn.

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

(FILE_EXTERNAL): New macro.

(print_row): Handle a few more cases with C compatible output.

(del4_update_edit_AAA,

move4_update_delself_AAA): Update expected results.

  1. … 7 more files in changeset.
Make 'svn info' return its WC results in a stable order, by making

the db funtion that returns these paths provide an array instead

of an hash. Info is the only function using this db operation.

Found by: brane

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_read_single_info): Add name.

(svn_wc__db_read_children_walker_info): Change return type.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_read_children_walker_info): Create array instead of hash.

Add name to item.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_NODE_CHILDREN_WALKER_INFO): Request stable ordering,

which we get by default (as that is how the parent index works).

* subversion/libsvn_wc/node.c

[(includes): Accidentally add svn_nodes_private.h Reverted in r1662033.]

(walker_helper): Update caller.

  1. … 3 more files in changeset.
Reduce scope of some variables within the commit processing, now that

we can assume that the query provides all the moves, including those

below the current node.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_global_commit): Remove unused argument. Restructuring changes

are already in the db.

* subversion/libsvn_wc/wc_db.c

(commit_node): Remove unused argument. Assume that a to be committed node

is either a BASE node or an op-root. (Others are first bumped into BASE).

Fix breaking moves in two more logical parts. Remove children test.

(process_committed_leaf,

svn_wc__db_global_commit): Update caller.

  1. … 1 more file in changeset.
Fix the move state corruption problem found during the recent wc-db

work, where an incoming delete was turned into a copy, but some moves

that can't be represented after making a copy were only half broken.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_MOVED_DESCENDANTS_SHD,

STMT_SELECT_MOVED_DESCENDANTS_SRC): Also scan the node itself for moves.

* subversion/libsvn_wc/wc_db.c

(db_move_moved_to): New function. Similar to the old make_copy_move_moved_to.

(db_move_moved_to_down_recursive): New function.

Extracted from svn_wc__db_op_make_copy_internal.

(make_copy_txn): Introduce not present nodes after recursing, to avoid making

the move information invalid. Move moves to the original shadowing layer

if we can't represent them in WORKING. Update caller.

(svn_wc__db_op_make_copy_internal): Update caller.

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

(verify_db_callback,

verify_db): New function.

(make_copy_mixed,

make_copy_and_delete_mixed): Call verify_db to fail on

invalid db state.

(test_list): Remove XFail marker from make_copy_and_delete_mixed.

  1. … 2 more files in changeset.
Consolidate all places in libsvn_wc where we 'determine if a tree has

modifications', because all of them had similar shortcomings where

they missed certain kinds of changes.

This consolidates the svnversion, crop and update checks for

modifications to a single function that handles all cases.

* subversion/include/private/svn_wc_private.h

(svn_wc__has_local_mods): Add ignore_unversioned argument.

* subversion/libsvn_client/copy.c

(pin_externals_prop): Update caller.

* subversion/libsvn_client/merge.c

(ensure_wc_is_suitable_merge_target): Update caller.

* subversion/libsvn_wc/crop.c

(modcheck_baton_t): Remove struct.

(modcheck_callback,

allow_crop): Remove function.

* subversion/libsvn_wc/questions.c

(modcheck_baton_t,

modcheck_callback): Move here from update_editor.c.

Support ignore_unversioned.

(svn_wc__node_has_local_mods): Move here. Perform db changes check first.

(svn_wc__has_local_mods): Use svn_wc__node_has_local_mods.

* subversion/libsvn_wc/revision_status.c

(svn_wc_revision_status2): Update caller.

* subversion/libsvn_wc/update_editor.c

(modcheck_baton_t,

modcheck_callback,

svn_wc__node_has_local_mods): Move to questions.c.

(check_tree_conflict): Update caller.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_BASE_FILES_RECURSIVE): Remove statement.

* subversion/libsvn_wc/wc.h

(svn_wc__node_has_local_mods): Add argument.

* subversion/libsvn_wc/wc_db.c

(has_local_mods): Rename to...

(has_db_mods): ... and leave walking the working copy to the status walker.

(svn_wc__db_has_local_mods): Rename to...

(svn_wc__db_has_db_mods): ... this.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_revision_status): Remove cancel callbacks. Update documentation.

* subversion/libsvn_wc/wc_db_update_move.c

(tc_editor_delete): Update caller.

  1. … 11 more files in changeset.