A fix for a tree conflict problem reported by Mark Phippard.
If update/switch caused a tree conflict by trying to delete a modified item, the working copy became unusable. The user couldn't svn add/cp/rm/up/ci at all. And svn resolved didn't help, because it restored the original state that triggered the tree conflict.
This commit changes the update editor so that an incoming delete action will delete a tree conflict victim (and items inside it), instead of skipping the deletion.
Such a victim, or the modified items inside it, can be reinstated via svn add/cp. Or the user can accept the incoming change ("theirs full") via "rm" or "rm -rf".
* subversion/libsvn_wc/update_editor.c (do_entry_deletion): Don't bail out after recording a tree conflict. Include tree-conflict status in deletion notification.
* subversion/tests/cmdline/update_tests.py (update_delete_modified_files, update_deleted_missing_dir, another_hudson_problem, tree_conflicts_on_update_1_2, tree_conflicts_on_update_2_1, tree_conflicts_on_update_2_2, tree_conflicts_on_update_3): Expect update to delete tree conflict victims and items inside them.
* subversion/tests/cmdline/switch_tests.py (failed_anchor_is_target, tree_conflicts_on_switch_1_2, tree_conflicts_on_switch_2_1, tree_conflicts_on_switch_2_2, tree_conflicts_on_switch_3): Expect update to delete tree conflict victims and items inside them.
* subversion/tests/cmdline/commit_tests.py (tree_conflicts_resolved): Expect update to delete tree conflict victims and items inside them.
* subversion/tests/cmdline/revert_tests.py (revert_tree_conflicts_in_updated_files): Expect update to delete tree conflict victims and items inside them.
* subversion/tests/cmdline/stat_tests.py (status_with_tree_conflicts): Expect update to delete tree conflict victims and items inside them.
Update/switch output is improved: tree conflict notifications now appear in their own column.
Merge uses a different set of callbacks, which we haven't touched yet, but calls the same notify() function. To be fixed separately.
The detection of existing tree conflicts and the skipping of all updates while inside a conflicted tree are only partly done. Also, several callbacks include more-or-less duplicate error handling for obstructions and missing/absent items, which ought to be handled by check_tree_conflict().
* subversion/svn/notify.c (notify): Print 'C' in the new fourth column for a tree conflict victim. Don't print 'C' in the first column for the victim's parent. Adjust summary code to count tree conflicts directly.
* subversion/include/svn_wc.h (svn_wc_notify_t): Rename is_tree_conflict_victim to tree_conflicted. Remove tree_conflict_action and tree_conflict_reason fields. (svn_wc_conflicted_p2): New args: adm_access instead of entry; path instead of parent path. Rewrite comment.
* subversion/libsvn_wc/util.c (svn_wc_create_notify): Track changes to svn_wc_notify_t.
* subversion/libsvn_wc/questions.c (svn_wc_conflicted_p2): Allow any result pointer to be NULL. Use parent's adm_access instead of requiring an entry for the target item. Expect path arg to include target's name. (svn_wc_conflicted_p): Rewrite using snippets of its successor.
* subversion/libsvn_wc/update_editor.c (check_tree_conflict): Avoid a false tree conflict when checking out a file external. (do_entry_deletion, add_directory, close_directory, add_file, close_file): If check_tree_conflict() says we're in a freshly discovered tree conflict, skip any updates to the victim. Include tree conflict status in user notifications. (open_directory, open_file): Store tree conflict status in baton for user notification later. (dir_baton, file_baton): Add boolean field tree_conflicted. (make_dir_baton, make_file_baton): Initialize the new field. (tree_has_local_mods): Note in comment that the target path does not have to exist.
* subversion/libsvn_client/commit_util.c (harvest_committables): Track changes to svn_wc_conflicted_p2.
* subversion/libsvn_client/externals.c (switch_file_external): Track changes to svn_wc_conflicted_p2. Also, we no longer have to resolve a bogus tree conflict on the new external's parent dir!
* subversion/libsvn_wc/adm_ops.c (resolve_conflict_on_entry): Track changes to svn_wc_conflicted_p2.
* subversion/libsvn_wc/status.c (assemble_status): Track changes to svn_wc_conflicted_p2.
* subversion/tests/cmdline/update_tests.py (update_delete_modified_files, prop_update_on_scheduled_delete, another_hudson_problem, tree_conflicts_on_update_1_1, tree_conflicts_on_update_1_2, tree_conflicts_on_update_2_1, tree_conflicts_on_update_2_2, tree_conflicts_on_update_3): Fix up to track current behavior.
* subversion/tests/cmdline/switch_tests.py (forced_switch_failures): Add expected status, disk, and output in place of an expected error message. Currently for subtest 3 only. (switch_with_obstructing_local_adds): Add a couple of tree conflicts to the expected status. (tree_conflicts_on_switch_1_1, tree_conflicts_on_switch_1_2, tree_conflicts_on_switch_2_1, tree_conflicts_on_switch_2_2, tree_conflicts_on_switch_3): Fix up to reflect the current state of the tree conflict detection code. (test_list): Remove XFail() from the tests mentioned above.
* subversion/tests/cmdline/svntest/tree.py (build_tree_from_checkout): Parse new tree conflict column.
* subversion/tests/cmdline/svntest/actions.py (run_and_verify_unquiet_status): Now works as advertised. (deep_trees_empty_dirs): New State object.
* subversion/tests/cmdline/merge_tests.py (del_differing_file): Allow tree conflicts to be counted as text conflicts in the output summary. Will be fixed properly ASAP!
* subversion/tests/cmdline/tree_conflict_tests.py (ensure_tree_conflict): Do the commit-failure-check and status-check on a victim directly, not its parent dir.