[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Suppress conflict resolver in dry-run merge

From: Jonathan Guy <jonathan.guy_at_ikoder.com>
Date: Thu, 1 Nov 2018 10:32:56 +0000

Ok I looked into this a bit more and I see what's going on now.
The post merge conflict resolver runs because the merge operation reported conflicts (via the conflict stats).
This calls
        svn_client_conflict_walk
which calls
        svn_wc_walk_status
which reports no conflict at that path because the wc was never changed because it was a dry run. So the whole operation gets dropped here.

I’m still convinced the whole thing is a pointless exercise.
A dry-run merge will not produce any actual conflicts on-disk so the resolver will never do anything.
I guess there could be other reasons I don’t know of to run the resolver so we’ll just leave it as is.

Thanks again for your time.

Regards
Jonathan

> On 31 Oct 2018, at 12:35, Stefan Sperling <stsp_at_elego.de> wrote:
>
> On Wed, Oct 31, 2018 at 09:46:23AM +0000, Jonathan Guy wrote:
>> Hi Stephan
>> Thanks for the reply.
>> I did see code section you refer to however the svn_client__resolve_conflicts will only be called if you have ctx->conflict_func2.
>> That function (AFAIK) is only installed if an “accept” option is supplied as the code below
>>
>>
>> /* Install a legacy conflict handler if the --accept option was given.
>> * Else, svn_client_merge5() may abort the merge in an undesirable way.
>> * See the docstring at conflict_func_merge_cmd() for details */
>> if (opt_state->accept_which != svn_cl__accept_unspecified)
>> {
>> struct conflict_func_merge_cmd_baton *b = apr_pcalloc(pool, sizeof(*b));
>>
>> b->accept_which = opt_state->accept_which;
>> SVN_ERR(svn_dirent_get_absolute(&b->path_prefix, "", pool));
>> b->conflict_stats = conflict_stats;
>>
>> ctx->conflict_func2 = conflict_func_merge_cmd;
>> ctx->conflict_baton2 = b;
>> }
>>
>>
>> The resolver that runs post run_merge is however run regardless if there is an accept argument or not.
>> If no accept option is given the user is ultimately prompted to resolve the conflict (dry-run or no dry-run).
>>
>>
>> /* If we are in interactive mode and either the user gave no --accept
>> * option or the option did not apply, then prompt. */
>> if (option_id == svn_client_conflict_option_unspecified)
>> {
>> svn_boolean_t resolved = FALSE;
>> svn_boolean_t postponed = FALSE;
>> svn_boolean_t printed_description = FALSE;
>> svn_error_t *err;
>>
>> *quit = FALSE;
>>
>> while (!resolved && !postponed && !*quit)
>> {
>> err = resolve_conflict_interactively(&resolved, &postponed,
>>
>>
>> Sorry I’m no trying to be argumentative I just need to clear on this one aspect.
>> Thanks for any help.
>
> Can you provide an example? I cannot reproduce the problem like this:
>
> $ svn merge ^/trunk
> --- Merging r2 through r5 into '.':
> C alpha
> A alpha2
> --- Recording mergeinfo for merge of r2 through r5 into '.':
> U .
> Summary of conflicts:
> Tree conflicts: 1
> Searching tree conflict details for 'alpha' in repository:
> Checking r4... done
> Tree conflict on 'alpha':
> File merged from
> '^/trunk/alpha_at_1'
> to
> '^/trunk/alpha_at_5'
> was moved to '^/trunk/alpha2' by stsp in r4.
> A file which differs from the corresponding file on the merge source branch was found in the working copy.
> Applying recommended resolution 'Move and merge':
> C alpha2
> Tree conflict at 'alpha' marked as resolved.
> Merge conflict discovered in file 'alpha2'.
> Select: (p) Postpone, (df) Show diff, (e) Edit file, (m) Merge,
> (s) Show all options: q
> Summary of conflicts:
> Text conflicts: 1 remaining (and 0 already resolved)
> Tree conflicts: 0 remaining (and 1 already resolved)
> $ sv revert
> $ pwd
> /tmp/svn-sandbox/branch
> $ svn revert -R .
> Reverted '.'
> Reverted 'alpha'
> Reverted 'alpha2'
> $ svn merge ^/trunk --dry-run
> --- Merging r2 through r5 into '.':
> C alpha
> A alpha2
> Summary of conflicts:
> Tree conflicts: 1
> $
>
>
Received on 2018-11-01 11:33:26 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.