This new implementation is based on the conflict walk we implemented in the 'svn' command line client. The command line client now relies on the client library to walk conflicts in the working copy.
This avoids forcing other clients to reimplement the status walk logic which is rather complex since it needs to handle new tree conflicts which may appear when another tree conflict gets resolved. It should make the transtion to the new conflict API easier for third party clients since the new resolver can now be invoked in a similar way to the old libsvn_wc conflict handler.
Suggested by: ivan (during the October 2016 hackathon in Berlin)
* subversion/libsvn_client/conflicts.c (conflict_status_walker_baton, tree_conflict_collector, handle_tree_conflict_resolution_failure, conflict_status_walker, svn_client_conflict_walk): New implementation of a conflict status walker. Based on, and very similar to, code from svn/resolve-cmd.c.
* subversion/svn/cl.h, subversion/svn/conflict-callbacks.c (svn_cl__resolve_conflict): Remove now unused output paramer 'resolved', and redundant parameter config (ctx->config can be used instead).
* subversion/svn/resolve-cmd.c (conflict_status_walker_baton): Replace with... (conflict_walker_baton): ... this, which contains only a subset of the fields. (tree_conflict_collector, handle_tree_conflict_resolution_failure, conflict_status_walker, walk_conflicts): Remove. (conflict_walker): A callback for the new conflict walker. (svn_cl__walk_conflicts): Use the new conflict walker provided by the libsvn_client library instead of the previous inline implementation.
Remove two hacks from the conflict resolver API that were added to allow handling --accept=mine-conflict | working for tree conflicts and --accept=working for binary text conflicts.
This patch makes the command-line client fully responsible for choosing the appropriate conflict option id, and keeps the various new APIs such as svn_client_conflict_text_resolve_by_id() simple and doing just what they were told to do.
* subversion/libsvn_client/conflicts.c (svn_client_conflict_text_resolve_by_id, svn_client_conflict_tree_resolve_by_id): Remove hacks from these functions.
* subversion/svn/conflict-callbacks.c (resolve_conflict_by_accept_option): Inline parts of this function that handle svn_cl__accept_edit and svn_cl__accept_launch ... (svn_cl__resolve_conflict): ...here. Accept svn_cl__accept_t by value, drop the option id argument. Pick the appropriate option id based on the passed-in svn_cl__accept_t argument. Prompt the user if there is no option or if the option did not apply.
* subversion/svn/resolve-cmd.c (svn_cl__resolve): Handle unsupported --accept [--non-interactive] cases in this function. (svn_cl__walk_conflicts): Remove the is_resolve_cmd argument. Don't map the --accept option to option id here, as we will do it in the svn_cl__resolve_conflict() function. Adjust calls to walk_conflicts() and svn_cl__resolve_conflict(). (walk_conflicts): Remove option_id argument, accept svn_cl__accept_t by value. (conflict_status_walker): Adjust call to svn_cl__resolve_conflict(). (conflict_status_walker_baton): Remove option_id field, store accept_which field by value.
* subversion/svn/merge-cmd.c (svn_cl__merge): Adjust call to svn_cl__walk_conflicts().
* subversion/svn/switch-cmd.c (svn_cl__switch): Adjust call to svn_cl__walk_conflicts().
* subversion/svn/update-cmd.c (svn_cl__update): Adjust call to svn_cl__walk_conflicts().