Hi Paul.  Not sure about this...

> URL: http://svn.apache.org/viewvc?rev=1438683&view=rev

> Log:
> Fix issue #4306 'multiple editor drive file merges record wrong mergeinfo
> during conflicts'.
> 
> * subversion/libsvn_client/merge.c
>   (do_file_merge): If we can only perform a partial merge because a conflict
>    broke the merge, then only record mergeinfo for that partial merge.  That
>    was subsequent merges can finish the job.
> 
> * subversion/tests/cmdline/merge_tests.py
>   (conflict_aborted_mergeinfo_described_partial_merge): Remove XFail
>    decorator and tweak failure status comment.
> 
> Modified:
>     subversion/trunk/subversion/libsvn_client/merge.c
>     subversion/trunk/subversion/tests/cmdline/merge_tests.py
> 
> Modified: subversion/trunk/subversion/libsvn_client/merge.c
> URL: 
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1438683&r1=1438682&r2=1438683&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/merge.c (original)
> +++ subversion/trunk/subversion/libsvn_client/merge.c Fri Jan 25 20:19:15 2013
> @@ -6923,7 +6923,10 @@ do_file_merge(svn_mergeinfo_catalog_t re
>          &filtered_rangelist,
>          mergeinfo_path,
>          merge_target->implicit_mergeinfo,
> -        &range, iterpool));
> +        /* Only record partial mergeinfo if only a partial merge was
> +           performed before a conflict was encountered. */
> +        conflicted_range ? conflicted_range : &range,
> +        iterpool));

Shouldn't that be "the range starting at 'range.start' and ending at 
'conflicted_range.end'?

It looks to me like it will only record mergeinfo for the sub-range that raised 
the conflict, and not for the earlier sub-ranges that completed successfully.

I'm currently writing an extended test that will cover when a conflict is 
raised in:

{ first sub-range of first specified range;
  last  sub-range of first specified range;
  first sub-range of last  specified range;
  last  sub-range of last  specified range }
x
{ single-file merge;
  dir merge }

That should be able to confirm my suspicion about the above code.

I'm doing this because I'm working on refactoring so that the three main merge 
subroutines called from do_merge() (that is the cases: single-file, 
dir-with-mergeinfo, dir-no-mergeinfo), each return info about where they 
stopped if they stopped because of a conflict, instead of throwing an error 
containing that info in human-readable form.

Then I will be able to put the merge in a "do { merge; resolve any conflicts } 
while (merge is not complete)" loop at the 'svn' level.  And thereby fix 
interactive conflict resolution which currently aborts at this point even if 
you resolved the conflicts.

- Julian


> 
>        /* Only record mergeinfo if there is something other than
>           self-referential mergeinfo, but don't record mergeinfo if
> 
> Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
> URL: 
> http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=1438683&r1=1438682&r2=1438683&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
> +++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Fri Jan 25 
> 20:19:15 
> 2013
> @@ -18176,8 +18176,7 @@ def merge_properties_on_adds(sbox):
> 
> @SkipUnless(server_has_mergeinfo)
> @Issue(4306)
> -@XFail()
> -# Test for issue #4306 'multiple editor drive merges record wrong
> +# Test for issue #4306 'multiple editor drive file merges record wrong
> # mergeinfo during conflicts'
> def conflict_aborted_mergeinfo_described_partial_merge(sbox):
>    "conflicted split merge can be repeated"
> @@ -18218,8 +18217,8 @@ def conflict_aborted_mergeinfo_described
>    svntest.actions.run_and_verify_svn(None, None, '.*', 'merge', 
> '^/iota',
>                                       iota_copy_path, '--accept', 
> 'postpone')
> 
> -  # Currently this test fails because the merge fails after merging
> -  # only r2 (as it should) but mergeinfo for r5-6 is recorded, preventing
> +  # Previously this test failed because the merge failed after merging
> +  # only r2 (as it should) but mergeinfo for r5-6 was recorded, preventing
>    # subsequent repeat merges from applying the operative r5.
>    svntest.actions.run_and_verify_svn(
>      "Incorrect mergeinfo set during conflict aborted merge",
>

Reply via email to