Checkout Tools
  • last updated 39 mins ago
Constraints: committers
Constraints: files
Constraints: dates
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_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_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.



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_accept_move, test_funcs): New tests

which exercise both of the newly added conflict resolution options.

  1. … 6 more files in changeset.
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


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_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_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


* 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,


(svn_wc__find_repos_node_in_wc): Rename to ...

(svn_wc__db_find_repos_node_in_wc): ... this.

  1. … 2 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.
Add an implementation of a new resolver option which resolves "incoming add

vs local add upon update" by merging the local and incoming directory trees.

It mirrors the same resolution option we already support for 'svn merge'.

The implementation for update is entirely different, though. It is merging

the new BASE tree with a locally added tree, both stored in wc.db, whereas

the same resolution option for merge is driven by a repository diff.

This is still work in progress. It mostly works, but there are no tests yet

to confirm that it is working well. But it is functionally complete and good

enough to be committed now.

* subversion/include/private/svn_wc_private.h

(svn_wc__conflict_tree_update_local_add): Declare.

* subversion/libsvn_client/conflicts.c

(resolve_update_incoming_added_dir_merge): New resolver function.

(configure_option_incoming_added_dir_merge): Configure new resolver function.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_tree_update_local_add): New private libsvn_wc API function

which backs the new resolution option.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_update_local_add): Declare.

* subversion/libsvn_wc/wc_db_update_move.c

(): Update notes on top of this file to document our procedure for updating

locally added directories.

(create_tree_conflict): Handle 'old_version' being NULL, as it is when

a conflict is due to a local addition.

(update_local_add_baton_t, added_node_baton_t): New types for a small

editor-style collection of functions which do the actual ground work.

(update_local_add_mark_node_edited, update_local_add_mark_parent_edited,

mark_update_add_add_tree_conflict, update_incoming_add_merge_props,

update_local_add_notify_obstructed_or_missing): New helper functions.

(tc_editor_update_add_new_file, tc_editor_update_add_new_directory,

tc_editor_update_add_merge_files, tc_editor_update_add_merge_dirprops):

New editor-style callbacks which modify working copy state.

(update_locally_added_node): Drives the former editor functions according

to differences between the post-update BASE layer and the directory tree

which was locally added at the same path before the update was executed.

(update_local_add): The body of svn_wc__db_update_local_add().

This runs within a wc.db transaction.

(svn_wc__db_update_local_add): New wc_db API function for updating locally

added directory trees.

  1. … 4 more files in changeset.
Revert r1771924.

Leaving nested conflicts within the tree conflict victim of an incoming

move after update does not seem to be the best approach. It is unclear how

we can make sure the victim, which is now left behind as a non-conflicted copy,

will eventually be removed to complete the incoming move.

I will try another idea next, which is to move any conflicted children into

the incoming move destination and let their conflicts be resolved there.

  1. … 5 more files in changeset.
[ Note from the future: Reverted in r1772051 ].

Make sure to preserve local changes for nodes which become victims of a

nested incoming move during an update.

With a nested move of a file, previous code flagged a tree conflict at a path

where this file was expected to sit relative to its moved parent.

This was wrong, since the file was not moved along with the parent, but was

also moved. So the real location of the missing file is unknown at that point.

Worse, conflict test 25 has shown that local changes to this file ended up

being deleted after resolving the parent's tree conflict.

Instead, we must keep the parent's copy around if any new conflicts appear

within its children. This preserves local modifications and allows the

resolver to resolve these conflicted children later on.

This change has some loose ends. The nested conflict cannot be resolved yet,

and I'm not sure how we can eventually decide to delete the original conflict

victim (the parent) in order to complete the incoming move operation after

resolving all the nested conflicts. Perhaps we need a new flag in conflict

storage for this?

* subversion/libsvn_client/conflicts.c

(resolve_incoming_move_dir_merge): If new conflicts remain after resolving

the update of an incoming move, do not blow the conflict victim away.

Delete its tree conflict marker instead but otherwise leave it unchanged.

This allows nested conflicts to be dealt with later on.

* subversion/include/private/svn_wc_private.h,


(svn_wc__conflict_tree_update_incoming_move): New output parameter

'new_conflicts_remain'. Pass it on.

* subversion/libsvn_wc/wc_db.h,


(svn_wc__db_update_incoming_move); New output parameter


(update_move_baton_t): New field 'raised_new_conflicts'.

(mark_tc_on_op_root, tc_editor_add_directory,

tc_editor_incoming_add_directory, tc_editor_add_file,

tc_editor_incoming_add_file, tc_editor_alter_directory,

tc_editor_alter_file, tc_editor_update_incoming_moved_file,

tc_editor_delete, tc_incoming_editor_delete): Set the 'raised_new_conflicts'

flag in the update_move_baton if a new conflict is raised.

(tc_editor_update_incoming_moved_file): Likewise, and also change the

way conflicts are recorded: If the move destination is missing, then

flag a conflict at the move source, not at the move destination (which

is not really known at this point).

(update_incoming_move): New output parameter 'new_conflicts_remain'.

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

(test_update_incoming_dir_move_with_nested_file_move): Adjust test

expectations accordingly.

  1. … 5 more files in changeset.
Rename the conflict resolver's "merge_local_changes" family of functions

to "update_incoming_move". Originally these were intended to be used during

merges as well, but that won't be necessary.

* subversion/include/private/svn_wc_private.h, subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_tree_merge_local_changes): Rename to ...

(svn_wc__conflict_tree_update_incoming_move): ... this. Adjust docstring.

Track rename of svn_wc__db API function.

* subversion/libsvn_client/conflicts.c

(resolve_incoming_move_dir_merge): Track rename.

* subversion/libsvn_wc/wc_db.h, subversion/libsvn_wc/wc_db_update_move.c

(merge_local_changes): Rename to ...

(update_incoming_move): ... this.

(svn_wc__db_merge_local_changes): Rename to ...

(svn_wc__db_update_incoming_move): ... this. Track above rename.

  1. … 4 more files in changeset.
Corrected spelling mistakes in comments.

* subversion/include/private/svn_utf_private.h

(svn_utf__glob): as above

* subversion/include/svn_fs.h

(svn_fs_refresh_revision_props): as above

* subversion/libsvn_fs_fs/fs.h

(): as above

* subversion/libsvn_fs_fs/pack.c

(tweak_path_for_ordering): as above

* subversion/libsvn_fs_fs/temp_serializer.h

(): as above

* subversion/libsvn_fs_x/pack.c

(): as above

* subversion/libsvn_subr/prefix_string.c

(): as above

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_wclock_find_root): as above

* subversion/svn/conflict-callbacks.c

(find_option_by_id): as above

* tools/dev/fsfs-access-map.c

(): as above

Obvious fix.

  1. … 9 more files in changeset.
In the conflict resolver, start adding support for merging local edits in

the working copy into an incoming moved directory.

This code is still very rough. It lacks docstrings. Many things won't work yet.

But it already makes 'svn update' apply local file edits to an incoming move,

and makes an existing regression test XPASS, so I'm happy enough to put the

current state of things in to keep working on it incrementally.

* subversion/include/private/svn_wc_private.h

(svn_wc__conflict_tree_merge_local_changes): Declare.

* subversion/libsvn_client/conflicts.c

(resolve_incoming_move_dir_merge): Merge local changes with support from

new functionality added to libsvn_wc in this commit.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_tree_merge_local_changes): New. This function merges

local changes (i.e. the delta between BASE and WORKING) from one

directory in the working copy to another.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_merge_local_changes): Declare.

* subversion/libsvn_wc/wc_db_update_move.c

(tc_editor_merge_local_file_change): New TC editor receiver function.

(get_working_info): New helper function. Similar to get_infp() but returns

information about the WORKING tree.

(walk_local_changes): Recursive walker which drives the TC editor per node.

(merge_local_changes, svn_wc__db_merge_local_changes): New TC editor driver.

Has not been tested yet beyond merging of simple file edits.

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

(test_funcs): Remove XFAIL marker from test_merge_incoming_move_dir2.

  1. … 5 more files in changeset.
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.h

(svn_wc__db_op_raise_moved_away: Fix typo in comment.

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.
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.



svn_wc__mark_resolved_prop_conflicts): Update caller.

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

* subversion/libsvn_wc/copy.c


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_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



svn_wc__db_op_raise_moved_away): Update caller.

* subversion/libsvn_wc/workqueue.c



run_set_property_conflict_marker): Update caller.

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


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.
Fix #include guards and Doxygen mark-up that does not match a file's actual


Found by grepping:

grep "@file" subversion/*/*.* subversion/*/*/*.* subversion/*/*/*/*.* |

grep -vi "/\([^:/]\+\): \* @file \1"

grep "\(ifndef\|define\|endif\) \+.*_H\>" subversion/include/*.h \

subversion/include/*/*.h |

grep -vi "/\([^:/.]\+\).h:\#\(ifndef\|define\|endif.*\) \1_H"

* subversion/include/private/svn_dep_compat.h,



Correct the @file filename.

* subversion/include/svn_opt.h

Correct the #include guards.

  1. … 3 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


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.



assemble_unversioned): Produce svn_wc__internal_status_t instead of



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


* 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


(read_single_info): Set has_descendants.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_info_t): Add boolean.

* subversion/tests/cmdline/

(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_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.


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


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.


svn_wc__db_global_commit): Update caller.

  1. … 1 more file 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.


allow_crop): Remove function.

* subversion/libsvn_wc/questions.c


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



svn_wc__node_has_local_mods): Move to questions.c.

(check_tree_conflict): Update caller.

* subversion/libsvn_wc/wc-queries.sql


* 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.
Make svn_wc__db_base_delete() take a single argument to specify that you

either want to keep the working copy the same (by copying to WORKING

if necessary), or want to remove everything.

This removes some of the calculation logic from the callers and as

such causes some behavior changes that need further tweaks. The current

behavior already fixes a few bugs, but I'm not entirely sure why this

has so much effect on the conflict resolver without changing the

NODES layout, nor the conflict skels.

* subversion/libsvn_wc/crop.c


svn_wc_exclude): Update caller.

* subversion/libsvn_wc/externals.c

(svn_wc__external_remove): Update caller.

* subversion/libsvn_wc/update_editor.c

(delete_entry): Simplify calculations that can be done in the

db layer.

(close_edit): Update caller.

* subversion/libsvn_wc/wc_db.c

(db_base_remove): Calculate what must be done on a single argument.

Always process moves, not only when somebody installs a new conflict.

Remove a bit of double work.

(svn_wc__db_base_remove): Update caller.

(svn_wc__db_op_make_copy_internal): Make moving the moves to the direct

delete of BASE optional in the internal api.

(svn_wc__db_op_make_copy): Update caller.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_base_remove): Update prototype and docs.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_op_make_copy_internal): Add argument.

* subversion/libsvn_wc/wc_db_update_move.c

(tc_editor_delete): Update caller.

* subversion/libsvn_wc/workqueue.c

(run_base_remove): Update caller.

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

(base_dir_insert_remove): Update caller.

(move_away_delete_update): Assume still moved.

(move_retract): Update assumptions.

(move_update_parent_replace): Assume still moved.

(make_copy_and_delete_mixed): Update caller. Assume one move fixed.

(test_funcs): Mark some more functions XFail that can't be resolved

by the existing conflict resolver setting.

  1. … 8 more files in changeset.
Remove 3 unused arguments from svn_wc__db_op_remove_node().

* subversion/libsvn_wc/delete.c

(svn_wc__internal_remove_from_revision_control): Update caller.

* subversion/libsvn_wc/wc_db.c

(remove_node_txn): Remove 3 arguments and code processing them.

(svn_wc__db_op_remove_node): Update caller.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_op_remove_node): Update arguments and docs.

  1. … 2 more files in changeset.
In preparation for some cleanup of the working copy crop (and backing) code,

and a big number of bugfixes in svn_wc__db_base_remove() make it possible to

install a not-present node with the svn_wc__db_base_remove() function.

* subversion/libsvn_wc/crop.c

(crop_children): Update caller.

* subversion/libsvn_wc/externals.c

(svn_wc__external_remove): Update caller.

* subversion/libsvn_wc/update_editor.c


close_edit): Update caller.

* subversion/libsvn_wc/wc_db.c

(db_base_remove): Remove support for removing locks and allow

setting an excluded node instead of just not-present.

(bump_node_revision): Use just one of the 20 features of

db_base_remove, by doing the delete directly.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_base_remove): Update arguments and docs.

* subversion/libsvn_wc/workqueue.c

(run_base_remove): Update caller.

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

(base_dir_insert_remove): Update caller.

  1. … 6 more files in changeset.
Fix 'svn info'-s url calculation on a few status values where it previously

performed unneeded work (or could cause a segfault. See regression test).

To do this combine the db-operation to fetch the intended url and the

node function to fetch the intended commit location.

This saves a few more db queries in info and merge calculations, and

fixes a few corner cases. (E.g. repos_root_url could be null in keyword

expansion, while url wasn't)

* subversion/libsvn_wc/info.c

(build_info_for_node): Remove intermediate calculations of url based

on original_* as the values were ignored anyway. (Because this

is an invalid approach)

Use svn_wc__db_read_repos_info() read info to obtain a bit more than

just the url, to avoid more db queries.

(svn_wc__get_info): Update caller.

* subversion/libsvn_wc/node.c

(svn_wc__internal_get_repos_info): Remove function. Use db variant.

(svn_wc__node_get_repos_info): Update caller.

(svn_wc__node_get_url): Update caller.

* subversion/libsvn_wc/translate.c

(svn_wc__expand_keywords): Update caller.

* subversion/libsvn_wc/wc_db.c

(read_url_txn): Rename to...

(db_read_repos_info): ... this and return more detailed repository.

information. Prefer working delete information over base delete

to handle fetching revision, and to avoid being fooled by switches.

(svn_wc__db_read_url): Rename to...

(svn_wc__db_read_repos_info): ... this and provide more info.

* subversion/libsvn_wc/wc.h

(svn_wc__internal_get_repos_info): Remove function.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_read_url): Rename to...

(svn_wc__db_read_repos_info): ... this.

* subversion/tests/cmdline/

(node_hidden_info): New test.

(test_list): Add node_hidden_info.

  1. … 6 more files in changeset.
Avoid a db query per childnode when walking children during merge calculations

by performing the 'hidden' filtering inside sqlite on a common operation.

* subversion/include/private/svn_wc_private.h

(svn_wc__node_get_children_of_working_node): Remove show_hidden argument as

non of the callers really wanted all nodes, including hidden.

(svn_wc__node_get_not_present_children): New function, for commit processing.

* subversion/libsvn_client/commit_util.c

(harvest_not_present_for_copy): Fetch just the not-present children. commit_relpath

is always set in copy mode, so no need to check.

* subversion/libsvn_client/merge.c


get_mergeinfo_paths): Ignore base-children when shadowed (as expected during merge

and to gain a performance bump)

* subversion/libsvn_wc/node.c

(svn_wc__node_get_children_of_working_node): Remove argument. Update caller.

(svn_wc__node_get_not_present_children): New function.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_WORKING_CHILDREN): Select only existing children.


* subversion/libsvn_wc/wc_db.c

(svn_wc__db_base_read_not_present_children): New function.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_base_read_not_present_children): New function.

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

(test_children_of_replaced_dir): Update test.

  1. … 7 more files in changeset.
Move some upgrade specific code from wc_db.c to upgrade.c. This code doesn't

depend on wc_db.c internals and wc_db.c is long enough as-is. No behaviour


* subversion/libsvn_wc/upgrade.c

(includes): Add token-map.h.

(upgrade_apply_props): Move here with docs from wc_db.h.

Include a few portions of set_actual_props.

(migrate_node_props): Update caller.

(upgrade_apply_dav_cache): Move here.

(upgrade_to_wcng): Update caller.

* subversion/libsvn_wc/wc_db.c

(set_actual_props): Use standard wcroot argument as similer apis.


insert_working_node): Update caller.

(set_actual_props): Use wcroot argument.

(svn_wc__db_op_set_props_internal): Update caller.


svn_wc__db_upgrade_apply_props): Move to upgrade.c

(svn_wc__db_upgrade_get_repos_id): Remove unused function.

* subversion/libsvn_wc/wc_db.h



svn_wc__db_upgrade_get_repos_id): Remove functions.

  1. … 2 more files in changeset.
Fold the ugly svn_wc__db_node_hidden() function into its only remaining caller.

* subversion/libsvn_wc/node.c

(filter_and_make_absolute): Use svn_wc__db_read_info directly.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_node_hidden): Remove function.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_node_hidden): Remove function.

  1. … 2 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


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): 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.
Stop setting last-rev, last-date and last-author on foreign repos copies

and merges. Fix consistency between svn_wc__db_op_copy_XXX() methods.

This fixes a bug in our entries compatibility code, as that assumes that

there is a copy if there is a last-rev.

* subversion/libsvn_wc/adm_ops.c

(svn_wc_add4): Update caller.

* subversion/libsvn_wc/update_editor.c

(svn_wc__complete_directory_add): Update caller.

* subversion/libsvn_wc/wc_db.c

(insert_working_node): Don't set pristine properties on local additions.

(svn_wc__db_op_copy_dir): Move is_moved argument last. Don't set changed*

and properties on local additions.

(svn_wc__db_op_copy_file): Don't set changed* and properties on local


(svn_wc__db_op_copy_symlink): Calulate moved_to like the other operations.

Don't set changed* and properties on local


* subversion/tests/cmdline/

(repos_to_wc): Fix test expectation.

  1. … 4 more files in changeset.
Apply the standard pre-branch whitespace cleanup via


There should be no functional changes.


* build/generator/

* build/generator/

* subversion/bindings/javahl/native/EditorProxy.h

* subversion/bindings/javahl/native/StateReporter.cpp

* subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp

* subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c

* subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c

* subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c

* subversion/bindings/swig/ruby/test/test_fs.rb

* subversion/bindings/swig/ruby/test/util.rb

* subversion/bindings/swig/ruby/test/windows_util.rb

* subversion/include/private/svn_fs_fs_private.h

* subversion/include/private/svn_packed_data.h

* subversion/include/private/svn_repos_private.h

* subversion/include/private/svn_sorts_private.h

* subversion/include/private/svn_subr_private.h

* subversion/include/private/svn_wc_private.h

* subversion/include/svn_auth.h

* subversion/include/svn_cache_config.h

* subversion/include/svn_client.h

* subversion/include/svn_cmdline.h

* subversion/include/svn_diff.h

* subversion/include/svn_fs.h

* subversion/include/svn_io.h

* subversion/include/svn_ra.h

* subversion/include/svn_repos.h

* subversion/include/svn_string.h

* subversion/libsvn_client/blame.c

* subversion/libsvn_client/commit.c

* subversion/libsvn_client/commit_util.c

* subversion/libsvn_client/copy.c

* subversion/libsvn_client/diff.c

* subversion/libsvn_client/externals.c

* subversion/libsvn_client/log.c

* subversion/libsvn_client/patch.c

* subversion/libsvn_client/ra.c

* subversion/libsvn_client/update.c

* subversion/libsvn_delta/svndiff.c

* subversion/libsvn_diff/parse-diff.c

* subversion/libsvn_fs/fs-loader.c

* subversion/libsvn_fs_base/lock.c

* subversion/libsvn_fs_fs/cached_data.c

* subversion/libsvn_fs_fs/fs_fs.c

* subversion/libsvn_fs_fs/hotcopy.c

* subversion/libsvn_fs_fs/id.c

* subversion/libsvn_fs_fs/index.c

* subversion/libsvn_fs_fs/index.h

* subversion/libsvn_fs_fs/lock.c

* subversion/libsvn_fs_fs/low_level.c

* subversion/libsvn_fs_fs/low_level.h

* subversion/libsvn_fs_fs/pack.c

* subversion/libsvn_fs_fs/recovery.c

* subversion/libsvn_fs_fs/rev_file.c

* subversion/libsvn_fs_fs/revprops.c

* subversion/libsvn_fs_fs/revprops.h

* subversion/libsvn_fs_fs/stats.c

* subversion/libsvn_fs_fs/transaction.c

* subversion/libsvn_fs_fs/tree.c

* subversion/libsvn_fs_fs/verify.c

* subversion/libsvn_fs_x/cached_data.c

* subversion/libsvn_fs_x/changes.c

* subversion/libsvn_fs_x/dag.h

* subversion/libsvn_fs_x/fs.h

* subversion/libsvn_fs_x/fs_id.c

* subversion/libsvn_fs_x/fs_x.c

* subversion/libsvn_fs_x/hotcopy.c

* subversion/libsvn_fs_x/hotcopy.h

* subversion/libsvn_fs_x/index.c

* subversion/libsvn_fs_x/index.h

* subversion/libsvn_fs_x/lock.c

* subversion/libsvn_fs_x/lock.h

* subversion/libsvn_fs_x/low_level.c

* subversion/libsvn_fs_x/low_level.h

* subversion/libsvn_fs_x/noderevs.c

* subversion/libsvn_fs_x/pack.c

* subversion/libsvn_fs_x/reps.c

* subversion/libsvn_fs_x/rev_file.c

* subversion/libsvn_fs_x/revprops.c

* subversion/libsvn_fs_x/revprops.h

* subversion/libsvn_fs_x/string_table.c

* subversion/libsvn_fs_x/string_table.h

* subversion/libsvn_fs_x/transaction.c

* subversion/libsvn_fs_x/tree.c

* subversion/libsvn_fs_x/util.c

* subversion/libsvn_fs_x/verify.c

* subversion/libsvn_ra_local/ra_plugin.c

* subversion/libsvn_ra_serf/ra_serf.h

* subversion/libsvn_ra_serf/serf.c

* subversion/libsvn_ra_serf/update.c

* subversion/libsvn_ra_serf/util.c

* subversion/libsvn_ra_svn/client.c

* subversion/libsvn_ra_svn/marshal.c

* subversion/libsvn_repos/authz_pool.c

* subversion/libsvn_repos/config_pool.c

* subversion/libsvn_repos/dump.c

* subversion/libsvn_repos/fs-wrap.c

* subversion/libsvn_repos/log.c

* subversion/libsvn_subr/bit_array.c

* subversion/libsvn_subr/cache-membuffer.c

* subversion/libsvn_subr/config.c

* subversion/libsvn_subr/dirent_uri.c

* subversion/libsvn_subr/fnv1a.c

* subversion/libsvn_subr/gpg_agent.c

* subversion/libsvn_subr/hash.c

* subversion/libsvn_subr/io.c

* subversion/libsvn_subr/object_pool.c

* subversion/libsvn_subr/packed_data.c

* subversion/libsvn_subr/prefix_string.c

* subversion/libsvn_subr/sorts.c

* subversion/libsvn_subr/sqlite.c

* subversion/libsvn_subr/subst.c

* subversion/libsvn_subr/sysinfo.c

* subversion/libsvn_subr/types.c

* subversion/libsvn_subr/utf.c

* subversion/libsvn_subr/utf8proc/utf8proc_data.c

* subversion/libsvn_subr/x509info.c

* subversion/libsvn_wc/diff.h

* subversion/libsvn_wc/props.c

* subversion/libsvn_wc/update_editor.c

* subversion/libsvn_wc/wc.h

* subversion/libsvn_wc/wc_db.c

* subversion/libsvn_wc/wc_db.h

* subversion/mod_dav_svn/lock.c

* subversion/mod_dav_svn/mod_dav_svn.c

* subversion/mod_dav_svn/status.c

* subversion/svn/auth-cmd.c

* subversion/svn/info-cmd.c

* subversion/svn/mergeinfo-cmd.c

* subversion/svn/notify.c

* subversion/svn/propget-cmd.c

* subversion/svn/svn.c

* subversion/svnadmin/svnadmin.c

* subversion/svnserve/logger.c

* subversion/svnserve/serve.c

* subversion/svnserve/server.h

* subversion/svnserve/svnserve.c

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

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

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

* subversion/tests/libsvn_fs/fs-test.c

* subversion/tests/libsvn_fs/locks-test.c

* subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-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_subr/cache-test.c

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

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

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

* subversion/tests/libsvn_subr/packed-data-test.c

* subversion/tests/libsvn_subr/priority-queue-test.c

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

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

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

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

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

* subversion/tests/svn_test_main.c

* tools/dev/benchmarks/RepoPerf/

* tools/dev/benchmarks/RepoPerf/

* tools/dev/

* tools/dev/fsfs-access-map.c

* tools/dev/

* tools/dev/x509-parser.c

* tools/diff/diff.c

* tools/dist/

* tools/dist/

* tools/hook-scripts/mailer/

* tools/server-side/svnpubsub/


Remove unneeded whitespace via script.

  1. … 184 more files in changeset.