Log Message: |
Allow the conflict resolver to recommend resolution options and implement
support for this feature in 'svn resolve'.
Clients can now avoid interactive prompting in cases where resolution
succeeds with the recommended resolution option.
Recommendations are hard-coded in libsvn_client. Since only one possible
option should be recommended, and clients are free to ignore recommendations
made by libsvn_client, I don't see a point in making this configurable.
At present libsvn_client only recommends options for tree conflicts which
involve unambiguous moves, but this is an implementation detail.
In the future, we may want to add an override to 'svn resolve', such as a
new '--accept ask' option, for people who enjoy the conflict prompt so much
that they want to see it all the time.
* subversion/include/svn_client.h
(svn_client_conflict_get_recommended_option_id): Declare.
(svn_client_conflict_tree_resolve): Add another error code to the docstring.
Knowing these error code is now important to client implementors because a
recommended option may fail to resolve a conflict, in which case clients
should fall back to trying other options (and, usually, prompting).
* subversion/libsvn_client/conflicts.c
(svn_client_conflict_t): Add 'recommended_option_id' field.
(init_wc_move_targets): Recommend options for resolving tree conflicts
involving unambiguous moves.
(svn_client_conflict_get_recommended_option_id): New.
(svn_client_conflict_get): Initialize 'recommended_option_id' field.
* subversion/svn/conflict-callbacks.c
(client_option_t) Add 'is_recommended' flag.
(find_recommended_option): New helper function.
(find_option_by_builtin): Add a 'conflict' paramter. Set 'is_recommended'
flag for recommended options.
(build_text_conflict_options, build_prop_conflict_options,
build_tree_conflict_options): Adjust callers of find_option_by_builtin().
(handle_tree_conflict): If an option is recommended, try it before falling
back to the interactive conflict prompt.
|