Checkout Tools
  • last updated 5 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Split the new libsvn_client conflict resolver code off into a file of its own,

leaving the legacy wc wrapper code in the old resolved.c file.

This draws a clear line between the two conflict resolver implementations,

at least inside libsvn_client (they're still somewhat mixed in libsvn_wc).

The legacy resolver was largely implemented inside libsvn_wc, with a very

thin wrapper at the client layer.

The new resolver still relies on libsvn_wc for working copy manipulation

but takes charge of all other aspects of conflict resolution.

* subversion/libsvn_client/conflicts.c: New, copied from resolved.c with the

legacy conflict code removed.

* subversion/libsvn_client/resolved.c: Keep just the legacy code here.

  1. … 1 more file in changeset.
* subversion/libsvn_client/resolved.c

(resolve_update_moved_away_node): Sleep for timestamps after updating moved

away nodes, since doing so might modify files.

* subversion/libsvn_client/resolved.c

(resolve_accept_current_wc_state): It should not be necessary to sleep for

timestamps here.

* subversion/libsvn_client/resolved.c

(resolve_tree_conflict): Rename to ...

(resolve_accept_current_wc_state): ... this.

(svn_client_conflict_tree_get_resolution_options): Track rename.

Add a resolver function which implements the 'postpone' option.

Applies to all conflicts.

* subversion/libsvn_client/resolved.c

(resolve_postpone): New.

(text_conflict_options, binary_conflict_options, prop_conflict_options,

svn_client_conflict_tree_get_resolution_options): Use resolve_postpone().

* subversion/libsvn_client/resolved.c

(resolve_tree_conflict): Make this function mark any tree conflict resolved.

In other words, it now always accepts the current working copy state.

* subversion/libsvn_client/resolved.c

(svn_client_conflict_tree_get_resolution_options): The new resolver function

resolve_update_break_moved_away() applies to 'local delete/replaced'

conflicts as well.

Continue breaking up the massive resolve_tree_conflict() function into

smaller per-resolution option handlers.

This repairs stat_test 45 (broken since r1731832).

* subversion/libsvn_client/resolved.c

(resolve_update_raise_moved_away): New helper function.

(svn_client_conflict_tree_get_resolution_options): Use new helper.

Follow-up to r1731832:

* subversion/libsvn_client/resolved.c

(svn_client_conflict_tree_get_resolution_options): When resolving 'local

moved-away vs incoming edit upon update' conflicts to the current working

copy state, we must break the move, so use resolve_update_break_moved_away

resolution handler in this case.

Continue breaking up the massive resolve_tree_conflict() function into smaller

per-resolution option handlers.

* subversion/libsvn_client/resolved.c

(resolve_update_moved_away_node): New helper function.

(svn_client_conflict_tree_get_resolution_options): Assign new helper to the

appropriate option.

Start breaking up the massive resolve_tree_conflict() function into smaller

per-resolution option handlers.

* subversion/libsvn_client/resolved.c

(resolve_update_break_moved_away): New helper function.

(svn_client_conflict_tree_get_resolution_options): Assign new helper to the

appropriate option.

Add a unique conflict option ID for accepting the current state of the

working copy when resolving a tree conflict. Previously, this resolution

was mapped to 'merged text'.

* subversion/include/svn_client.h

(svn_client_conflict_option_accept_current_wc_state): New option ID.

* subversion/libsvn_client/resolved.c

(resolve_tree_conflict, svn_client_conflict_tree_get_resolution_options): Use

the new option ID.

(svn_client_conflict_tree_resolve_by_id): Provide a backwards compat hack

just in case an API user needs it.

  1. … 1 more file in changeset.
* subversion/libsvn_client/resolved.c

(resolve_tree_conflict): Stop calling svn_wc__resolve_conflicts() to resolve

otherwise unhandled tree conflicts. Use svn_wc__del_tree_conflict() instead.

With this change, all tree conflicts are resolved independently of the legacy

conflict resolver implementation. Text and property conflicts still use it

but for now there is no reason to change that.

* subversion/libsvn_client/resolved.c

(resolve_tree_conflict): Error out if no resolution strategy matched and

the chosen resolution is something other than accepting the current

working copy state.

Really perform updates of moved-away nodes with the new conflict resolver.

* subversion/libsvn_client/resolved.c

(resolve_tree_conflict): Check for the right option_id. The resolver already

uses svn_client_conflict_option_update_move_destination internally, instead

of svn_client_conflict_option_working_text_where_conflicted.

With this change, updates of moved-away nodes take the new code path.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_tree_update_moved_away_node): We must mark the conflict

resolved manually because svn_wc__db_update_moved_away_conflict_victim()

does not mark the conflict resolved for us.

  1. … 1 more file in changeset.
Revert r1731226. The extra check added in that revision is not necessary

because the called function already performs the same check.

Follow-up to r1731231:

* subversion/libsvn_client/resolved.c

(resolve_tree_conflict): Fix condition which checks if a local move vs

incoming edit conflict is resolved to the current working copy state.

* subversion/libsvn_client/resolved.c

(resolve_tree_conflict): If a local move vs incoming edit conflict is

resolved to the current working copy state, then break the move.

Matches old conflict resolver behaviour.

[ Reverted in r1731237. ]

* subversion/libsvn_client/resolved.c

(resolve_tree_conflict): Only break moves if incoming change is 'replace'

rather than 'delete'. Matches the behaviour of old resolver more closely.

Provide another private libsvn_wc API function for resolving a tree conflict.

This function resolves a 'local moved-away vs. incoming edit' conflict

upon update/switch. Use this new API from libsvn_client's new conflict

resolver instead of calling the generic svn_wc__resolve_conflicts()

function for this conflict.

* subversion/include/private/svn_wc_private.h

(svn_wc__conflict_tree_update_moved_away_node): Declare and document.

* subversion/libsvn_client/resolved.c

(resolve_tree_conflict): Call svn_wc__conflict_tree_update_moved_away_node()

if appropriate for the tree conflict and its resolution option.

Break single if-statement into several if-else-if for readability.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_tree_update_moved_away_node): Implement, based on existing

code from resolve_tree_conflict_on_node().

  1. … 2 more files in changeset.
* subversion/libsvn_client/resolved.c

(resolve_tree_conflict): Initialize 'incoming_change' variable.

Introduce svn_wc__conflict_tree_update_raise_moved_away(), a private

libsvn_wc API function for use by libsvn_client's conflict resolver.

This API may raise an error if other tree conflicts need to be resolved before

the tree conflict specified by the caller. Make the new conflict resolver

handle this case. (This behaviour is now exposed to the public API rather than

hidden in libsvn_wc as was the case with the legacy conflict resolver.)

* subversion/include/private/svn_wc_private.h

(svn_wc__conflict_tree_update_raise_moved_away): Declare.

* subversion/include/svn_client.h

(svn_client_conflict_tree_resolve): Document new error behavior in case a

conflict cannot be resolved yet.

* subversion/libsvn_client/resolved.c

(conflict_option_resolve_func_t): Document new error behavior in case a

conflict cannot be resolved yet.

(resolve_tree_conflict): Use svn_wc__conflict_tree_update_raise_moved_away()

if applicable.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_tree_update_raise_moved_away): Implement.

* subversion/svn/resolve-cmd.c

(handle_tree_conflict_resolution_failure): New helper function. Copied from

legacy libsvn_wc conflict resolver code.

(conflict_status_walker): Handle tree conflicts which cannot be resolved

right away by retrying them later after resolving other conflicts first.

  1. … 4 more files in changeset.
Return SVN_ERR_CLIENT_CONFLICT_OPTION_NOT_APPLICABLE where applicable, instead

of returning the very generic SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE error code.

* subversion/include/svn_client.h

(svn_client_conflict_tree_resolve_by_id,

svn_client_conflict_prop_resolve_by_id,

svn_client_conflict_text_resolve_by_id): Document error case.

* subversion/libsvn_client/resolved.c

(svn_client_conflict_tree_resolve_by_id,

svn_client_conflict_prop_resolve_by_id,

svn_client_conflict_text_resolve_by_id): Return better error code.

  1. … 1 more file in changeset.
Provide a new private libsvn_wc API function for resolving a tree conflict.

This function resolves a 'local delete/replace vs. incoming <any>' conflict

upon update/switch to the current (i.e. post-update) working copy state.

Use this new API from libsvn_client's new conflict resolver instead of

calling the generic svn_wc__resolve_conflicts() function for this conflict.

This is the first special-case tree conflict resolver function in libsvn_wc.

Hopefully, many more will follow.

* subversion/include/private/svn_wc_private.h

(svn_wc__conflict_tree_update_break_moved_away): Declare and document.

* subversion/libsvn_client/resolved.c

(resolve_tree_conflict): Call svn_wc__conflict_tree_update_break_moved_away()

if appropriate for the tree conflict and its resolution option.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_tree_update_break_moved_away): Implement, based on existing

code from resolve_tree_conflict_on_node().

  1. … 2 more files in changeset.
Provide new private libsvn_wc APIs for resolving text and property conflicts.

Use these new APIs from libsvn_client's new conflict resolver instead of

calling the generic svn_wc__resolve_conflicts() function.

This avoids going on a status walk for just one path at depth empty.

The new functions added here provide sufficient functionality for the new

conflict resolver: Marking a text/prop conflict resolved based on a choice

made by the user, and sending a notification to the client.

For now, tree conflicts are still resolved with svn_wc__resolve_conflicts().

The plan is to add several new libsvn_wc APIs for resolving tree conflicts.

These APIs will not be driven by a simple conflict choice argument. Rather,

each API will implement a very specific resolution strategy for a particular

kind of tree conflict.

Eventually, libsvn_client will stop using svn_wc__resolve_conflicts() for

anything but backwards compatibility.

* subversion/include/private/svn_wc_private.h

(svn_wc__conflict_text_mark_resolved,

svn_wc__conflict_prop_mark_resolved): Declare.

* subversion/libsvn_client/resolved.c

(resolve_text_conflict): Call svn_wc__conflict_text_mark_resolved().

(resolve_prop_conflict): Call svn_wc__conflict_prop_mark_resolved().

(resolve_tree_conflict): Inline the body of resolve_conflict() here.

(resolve_conflict): Remove.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_text_mark_resolved,

svn_wc__conflict_prop_mark_resolved): Implement.

  1. … 2 more files in changeset.
* subversion/libsvn_client/resolved.c

(svn_client_conflict_text_get_resolution_options,

(svn_client_conflict_prop_get_resolution_options): Forgot to localize

descriptions while copying conflict options from static arrays.

Found by: rhuijben

* subversion/libsvn_client/resolved.c

(svn_client_conflict_prop_get_resolution_options): Ensure that options

returned from here live in writable memory so that option->type_data

can be written to. Should fix access violation on Windows.

Found by: svn-windows-local buildbot

* subversion/libsvn_client/resolved.c

(prop_conflict_option): Fix the callback for 'base' property conflict option.

* subversion/libsvn_client/resolved.c

(prop_conflicts): Allow 'base', 'mine-conflict', and 'theirs-conflict'

for property conflicts because libsvn_wc supports this.

At present, libsvn_wc treats 'mine-conflict' and 'theirs-conflict'

just like 'mine-full' and 'theirs-full'. For backwards compat we should

keep accepting them, and perhaps we'll decide to make 'mine-conflict'

and 'theirs-conflict' do something different in the future.

* subversion/libsvn_client/resolved.c

(svn_client_conflict_tree_resolve_by_id): Add a hack that makes the

'--accept mine-conflict' option work for 2 specific tree conflicts.

In Subversion 1.9 these conflicts could be resolved to 'mine-conflict'

and we should keep allowing this for backwards compatibility, even if

the conflict prompt doesn't offer this option anymore.