cl-conflicts.h

Checkout Tools
  • last updated 41 mins ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Remove 'const' from all svn_client_conflict_t.

We reserve the right to do anything to conflict objects under the hood,

anywhere. This type is opaque so callers shouldn't care about constness.

* subversion/include/svn_client.h,

subversion/libsvn_client/conflicts.c

(svn_client_conflict_get_local_abspath,

svn_client_conflict_get_operation,

svn_client_conflict_get_incoming_change,

svn_client_conflict_get_local_change,

svn_client_conflict_get_repos_info,

svn_client_conflict_get_incoming_old_repos_location,

svn_client_conflict_tree_get_resolution,

svn_client_conflict_prop_get_resolution,

svn_client_conflict_text_get_resolution): Drop 'const' from conflict.

* subversion/svn/cl-conflicts.h,

subversion/svn/cl-conflicts.c

(svn_cl__get_human_readable_prop_conflict_description,

svn_cl__get_human_readable_prop_conflict_description,

append_tree_conflict_info_xml): Drop 'const' from conflict.

* subversion/svn/conflict-callbacks.c

(show_diff, show_conflicts): Drop 'const' from conflict.

  1. … 4 more files in changeset.
Replace another use of svn_client_conflict_get_kind() with a call to

svn_client_conflict_get_conflicted().

* subversion/svn/cl-conflicts.c

(map_conflict_kind_xml): Remove. Not needed anymore.

(svn_cl__append_conflict_info_xml): Use svn_client_conflict_get_conflicted().

This should fix a bug where we'd show either a text or property conflict but

not both. This function didn't treat svn_client_conflict_t as representing

multiple conflicts. Tree conflicts weren't affected.

* subversion/svn/cl-conflicts.h

(subversion/svn/cl-conflicts.h): Drop 'const' from conflict argument since

libsvn_client doesn't like it.

  1. … 1 more file in changeset.
Introduce svn_client_conflict_t and start making use of it in the resolver.

Right now, this new opaque type simply wraps the old struct. This is required

to keep the current resolver implementation working for now.

The plan is to develop new resolver functionality using the new type and

eventually phase out the old struct entirely.

* subversion/include/svn_client.h

(svn_client_conflict_t, svn_client_conflict_get,

svn_client_conflict_from_wc_description2_t): Declare.

(svn_client_conflict_get_kind,

svn_client_conflict_get_local_abspath,

svn_client_conflict_get_operation,

svn_client_conflict_get_incoming_change,

svn_client_conflict_get_local_change,

svn_client_conflict_get_repos_info,

svn_client_conflict_get_incoming_old_repos_location,

svn_client_conflict_get_incoming_new_repos_location,

svn_client_conflict_tree_get_victim_node_kind,

svn_client_conflict_prop_get_propname,

svn_client_conflict_text_get_mime_type,

svn_client_conflict_text_get_contents): Expect svn_client_conflict_t.

* subversion/libsvn_client/resolved.c

(svn_client_conflict_t, svn_client_conflict_get,

svn_client_conflict_from_wc_description2_t): Implement.

(svn_client_conflict_get_kind,

svn_client_conflict_get_local_abspath,

svn_client_conflict_get_operation,

svn_client_conflict_get_incoming_change,

svn_client_conflict_get_local_change,

svn_client_conflict_get_repos_info,

svn_client_conflict_get_incoming_old_repos_location,

svn_client_conflict_get_incoming_new_repos_location,

svn_client_conflict_tree_get_victim_node_kind,

svn_client_conflict_prop_get_propname,

svn_client_conflict_text_get_mime_type,

svn_client_conflict_text_get_contents): Use svn_client_conflict_t.

* subversion/svn/cl-conflicts.h

(svn_cl__get_human_readable_prop_conflict_description,

svn_cl__get_human_readable_tree_conflict_description,

svn_cl__append_conflict_info_xml): Expect svn_client_conflict_t.

* subversion/svn/cl-conflicts.c

(svn_cl__get_human_readable_prop_conflict_description,

svn_cl__get_human_readable_tree_conflict_description,

append_tree_conflict_info_xml,

svn_cl__append_conflict_info_xml): Expect svn_client_conflict_t.

* subversion/svn/conflict-callbacks.c

(show_diff, show_conflicts, handle_text_conflict, handle_prop_conflict,

handle_tree_conflict, conflict_func_interactive): Use svn_client_conflict_t.

(svn_cl__conflict_func_interactive): Convert svn_wc_conflict_description2_t

to svn_client_conflict_t and use that.

* subversion/svn/info-cmd.c

(print_info_xml, print_info): Convert svn_wc_conflict_description2_t to

svn_client_conflict_t and use that.

* subversion/svn/status.c

(print_status): Convert svn_wc_conflict_description2_t to

svn_client_conflict_t and use that.

  1. … 6 more files in changeset.
In preparation for my following patch that improves obstruction detection

on update-move extend the 'svn info' output with some information about

text and property conflicts that is currently only shown when there is

(also) a tree conflict.

* subversion/svn/cl-conflicts.c

(svn_cl__get_human_readable_action_description): New function.

* subversion/svn/cl-conflicts.h

(svn_cl__get_human_readable_action_description): New function.

* subversion/svn/info-cmd.c

(print_info): Make sure the left and right version are logically

grouped by adding an header if there is a conflict but no tree

conflict.

* subversion/tests/cmdline/prop_tests.py

(dir_prop_conflict_details): Update expected result.

  1. … 3 more files in changeset.
Undo the introduction of svn_wc_conflict_description3_t.

Instead of revving svn_wc_conflict_description2_t ("desc2"), we can extend the

struct with new fields or a pointer to private data to be accessed via functions,

and keep the existing fields as they are now.

This approach avoids an unwieldy cascade of changes to callbacks and other API

elements which already use desc2. This commit does not add new fields or private

data for desc2 -- that is future work.

Discussed with philip, julianfoad, rhuijben, and breser.

* subversion/include/private/svn_wc_private.h

(svn_wc__get_tree_conflict, svn_wc__add_tree_conflict): Switch back to desc2.

(svn_wc__cd3_to_cd2, svn_wc__cd3_array_to_cd2_array ): Remove declaration.

* subversion/include/svn_wc.h

(svn_wc_conflict_description_private_t): New typedef.

(svn_wc_conflict_description3_t): Remove.

(svn_wc_conflict_description2_t): Enhance documentation based on improvements

made for desc3. Extend this structure with a pointer to private data.

(svn_wc_conflict_description_create_text3,

svn_wc_conflict_description_create_prop3,

svn_wc_conflict_description_create_tree3,

svn_wc__conflict_description3_dup,

svn_wc_conflict_resolver_func3_t): Un-declare.

(svn_wc_conflict_description_create_text2,

svn_wc_conflict_description_create_prop2,

svn_wc_conflict_description_create_tree2,

svn_wc_conflict_resolver_func2_t): Un-deprecate.

(svn_wc_info_t): Remove 'conflicts2' field.

* subversion/libsvn_client/merge.c

(merge_dir_baton_t): Document that 'new_tree_conflicts' array now has

desc2 elements again.

(record_tree_conflict, merge_file_opened, merge_dir_opened): Use desc2.

* subversion/libsvn_wc/conflicts.c

(local_change_map): Rename back to reason_map for consistency.

(incoming_change_map): Rename back to action_map for consistency.

(svn_wc__conflict_skel_add_tree_conflict,

svn_wc__conflict_read_prop_conflict,

svn_wc__conflict_read_tree_conflict): Rename local_change and

incoming_change parameters back to reason and action for consistency.

(generate_propconflict, resolve_text_conflict, read_text_conflict_desc,

svn_wc__conflict_invoke_resolver, read_prop_conflict_descs,

svn_wc__read_conflicts, conflict_status_walker): Use desc2.

(eval_text_conflict_func_result): Rename 'merged_abspath' parameter back to

'merged_file' for consistency. Use desc2.

* subversion/libsvn_wc/deprecated.c

(svn_wc__status2_from_3): Use desc2.

(svn_wc_conflict_description_create_text2,

svn_wc_conflict_description_create_prop2,

svn_wc_conflict_description_create_tree2): Moved back to libsvn_wc/util.c.

* subversion/libsvn_wc/entries.c

(read_one_entry, write_entry): Use desc2.

* subversion/libsvn_wc/info.c

(svn_wc_info_dup, build_info_for_node, svn_wc__get_info): Use desc2 and drop

support for removed 'conflicts2' member of svn_wc_info_t.

* subversion/libsvn_wc/tree_conflicts.c

(svn_wc__deserialize_conflict, svn_wc__serialize_conflict,

svn_wc__add_tree_conflict, svn_wc__get_tree_conflict): Use desc2.

* subversion/libsvn_wc/tree_conflicts.h

(svn_wc__serialize_conflict,

svn_wc__deserialize_conflict): Tweak declarations for desc2.

* subversion/libsvn_wc/upgrade.c

(read_tree_conflicts, migrate_single_tree_conflict_data,

svn_wc__upgrade_conflict_skel_from_raw): Use desc2.

* subversion/libsvn_wc/util.c

(svn_wc_conflict_description_create_text3,

svn_wc_conflict_description_create_prop3,

svn_wc_conflict_description_create_tree3,

svn_wc__conflict_description3_dup,

svn_wc__cd3_array_to_cd2_array, svn_wc__cd3_to_cd2): Remove.

(svn_wc_conflict_description_create_text2,

svn_wc_conflict_description_create_prop2,

svn_wc_conflict_description_create_tree2): Move back here

from libsvn_wc/deprecated.c

* subversion/libsvn_wc/wc.h

(svn_wc__read_conflicts): Change mention in docstring back to desc2.

* subversion/svn/cl-conflicts.c

(svn_cl__get_human_readable_prop_conflict_description,

svn_cl__get_human_readable_tree_conflict_description,

append_tree_conflict_info_xml, svn_cl__append_conflict_info_xml): Use desc2.

* subversion/svn/cl-conflicts.h

(svn_cl__get_human_readable_prop_conflict_description,

svn_cl__get_human_readable_tree_conflict_description,

svn_cl__append_conflict_info_xml): Change declarations for desc2.

* subversion/svn/cl.h

(svn_cl__conflict_func_interactive): Change declaration back to desc2.

* subversion/svn/conflict-callbacks.c

(show_diff, show_conflicts, merge_prop_conflict, show_prop_conflict,

edit_prop_conflict, handle_text_conflict, handle_prop_conflict,

handle_tree_conflict, handle_obstructed_add,

conflict_func_interactive): Use desc2. In handle_prop_conflict, restore

workaround for wrongly filled in fields in desc2 for now.

* subversion/svn/info-cmd.c

(print_info_xml, print_info): Use desc2.

* subversion/svn/status.c

(print_status): Use desc2.

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

(compare_version, compare_file_content, compare_prop_conflict,

tree_conflict_create, test_deserialize_tree_conflict,

test_read_write_tree_conflicts, test_serialize_tree_conflict): Use desc2.

* tools/dev/svnraisetreeconflict/svnraisetreeconflict.c

(raise_tree_conflict): Use desc2.

  1. … 19 more files in changeset.
Use svn_wc_conflict_description3_t throughout the 'svn' command line client.

* subversion/svn/cl-conflicts.c

(svn_cl__get_human_readable_prop_conflict_description,

svn_cl__get_human_readable_tree_conflict_description,

append_tree_conflict_info_xml, svn_cl__append_conflict_info_xml): Use

svn_wc_conflict_description3_t instead of svn_wc_conflict_description2_t.

* subversion/svn/cl-conflicts.h

(svn_cl__get_human_readable_prop_conflict_description,

svn_cl__get_human_readable_tree_conflict_description,

svn_cl__append_conflict_info_xml): Update declarations to use

svn_wc_conflict_description3_t.

* subversion/svn/cl.h

(svn_cl__conflict_func_interactive): Update declaration to use

svn_wc_conflict_description3_t.

* subversion/svn/conflict-callbacks.c

(show_diff, show_conflicts, merge_prop_conflict, show_prop_conflict,

edit_prop_conflict, handle_tree_conflict, handle_prop_conflict,

handle_tree_conflict, handle_obstructed_add, conflict_func_interactive):

Use svn_wc_conflict_description3_t instead of svn_wc_conflict_description2_t.

In handle_prop_conflict() we can drop a workaround that was necessary with

the old conflict descriptor.

* subversion/svn/info-cmd.c

(print_info_xml, print_info): Use svn_wc_conflict_description3_t instead of

svn_wc_conflict_description2_t.

* subversion/svn/status.c

(print_status): Update caller.

  1. … 5 more files in changeset.
Improve the interactive resolution of property conflicts. Similar to

resolving a text conflict, show initially a single line such as

local delete, incoming edit upon merge

and allow the user to display a 3-way diff with a 'dc - display conflict'

option. Previously, for each property that is in conflict, we displayed the

entire contents of the property conflict reject file, which includes all of

the property conflicts on the node, and which is not very readable.

* subversion/svn/cl-conflicts.h,

subversion/svn/cl-conflicts.c

(svn_cl__get_human_readable_prop_conflict_description): New function.

* subversion/svn/conflict-callbacks.c

(show_prop_conflict): New function.

(prop_conflict_options): Add a 'dc - display conflict' option.

(handle_prop_conflict): Work around a historical mix-up in the provided

'theirs' and 'merged' and 'conflict-reject file' paths. Display a

summary of the conflict instead of printing the '.prej' file. Show a

3-way diff when the 'dc' option is selected.

  1. … 2 more files in changeset.
Following up on r1432454, make 'svn info' print more of the conflict

information that is now available, instead of still just printing

what we originally stored for conflicts in svn_wc_entry_t.

info.rnc needs updating after this patch. I expected to copy and paste

the missing pieces (src-left, etc.) from the tree conflicts, but these

aren't defined yet, while introduced in 1.6.

* subversion/svn/cl-conflicts.c

Renamed from tree-conflicts.c

(map_conflict_kind_xml): New map.

(svn_cl__append_tree_conflict_info_xml): Rename to...

(append_tree_conflict_info_xml): ... this and make static.

(svn_cl__append_conflict_info_xml): New function that handles all conflict

kinds.

* subversion/svn/cl-conflicts.h

Renamed from tree-conflicts.h

(svn_cl__append_tree_conflict_info_xml): Rename to...

(svn_cl__append_conflict_info_xml): ... this. Update docstring.

* subversion/svn/conflict-callbacks.c

(includes): Updated for rename.

* subversion/svn/info-cmd.c

(includes): Follow rename.

(print_info_xml): Delegate all conflict work to

svn_cl__append_conflict_info_xml.

(print_info): Print left and right version for the first conflict, instead

of just for tree conflicts.

* subversion/svn/status.c

(includes): Updated for rename.

* subversion/svn/tree-conflicts.c

Renamed to cl-conflicts.c

* subversion/svn/tree-conflicts.h

Renamed to cl-conflicts.h

  1. … 6 more files in changeset.