You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ben Collins-Sussman <su...@collab.net> on 2004/12/07 19:42:14 UTC

'svn merge' vs. diff/patch

I was talking with Paolo (one of the main Mono developers) in IRC 
today.  He sees this curious behavior, when trying to port a small 
change from trunk to a branch:

# check out a branch wc
svn co svn://svn.myrealbox.com/source/branches/mono-1-0/mono/mono/mini

# examine the patch on trunk (this shows a tiny addition to 'ChangeLog')
svn diff -r37302:37303 
svn://svn.myrealbox.com/source/trunk/mono/mono/mini

# now apply the same patch to the wc:
svn merge -r37302:37303 
svn://svn.myrealbox.com/source/trunk/mono/mono/mini


... the merge results in a huge conflict within 'ChangeLog', rather 
than just a tiny 3-line addition as 'svn diff' predicted.

What's going on here?  Is it the fact that 'svn diff' is doing a 
two-way diff, but 'svn merge' is doing a three-way diff?  Could that 
cause this?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: 'svn merge' vs. diff/patch

Posted by Philip Martin <ph...@codematters.co.uk>.
Paolo Molaro <lu...@ximian.com> writes:

>> > # check out a branch wc
>> > svn co svn://svn.myrealbox.com/source/branches/mono-1-0/mono/mono/mini
>> > 
>> > # examine the patch on trunk (this shows a tiny addition to 'ChangeLog')
>> > svn diff -r37302:37303
>> > svn://svn.myrealbox.com/source/trunk/mono/mono/mini
> [...]
>> > # now apply the same patch to the wc:
>> > svn merge -r37302:37303
>> > svn://svn.myrealbox.com/source/trunk/mono/mono/mini
>> > 
>> > ... the merge results in a huge conflict within 'ChangeLog', rather
>> > than just a tiny 3-line addition as 'svn diff' predicted.
>
> The state of the repository has changed, since the patch has been committed
> to the branch (using diff & patch). If you do the initial checkout
> at a revision where the patch was not in the branch you'll get the same
> huge conflict. Try, as the first step:
> 	svn co -r 37330 svn://svn.myrealbox.com/source/branches/mono-1-0/mono/mono/mini
> and then do the same merge. This gets the wc in mostly the same state as 
> when the issue was noticed.

> Note the 60 line conflict instead of the 4 lines one.

Using "--diff3-cmd diff3" to use GNU diff3 intead of Subversion's
built-in diff, or using

$ svn cat -r37330 svn://svn.myrealbox.com/source/branches/mono-1-0/mono/mono/mini/ChangeLog > mine
$ svn cat -r37302 svn://svn.myrealbox.com/source/trunk/mono/mono/mini/ChangeLog  > older
$ svn cat -r37303 svn://svn.myrealbox.com/source/trunk/mono/mono/mini/ChangeLog  > yours
$ diff3 -Em mine older yours > merged.gnu
$ subversion/tests/libsvn_diff/diff3-test mine older yours > merged.svn

I get a similar conflicts.  I'm not sure why diff3 performs so poorly,
but we don't seem to be any worse than the GNU tools.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: 'svn merge' vs. diff/patch

Posted by Paolo Molaro <lu...@ximian.com>.
On 12/07/04 kfogel@collab.net wrote:
> Ben Collins-Sussman <su...@collab.net> writes:
> > # check out a branch wc
> > svn co svn://svn.myrealbox.com/source/branches/mono-1-0/mono/mono/mini
> > 
> > # examine the patch on trunk (this shows a tiny addition to 'ChangeLog')
> > svn diff -r37302:37303
> > svn://svn.myrealbox.com/source/trunk/mono/mono/mini
[...]
> > # now apply the same patch to the wc:
> > svn merge -r37302:37303
> > svn://svn.myrealbox.com/source/trunk/mono/mono/mini
> > 
> > ... the merge results in a huge conflict within 'ChangeLog', rather
> > than just a tiny 3-line addition as 'svn diff' predicted.
> 
> With SVN trunk r12206, I don't get a huge conflict.  I get this at the
> top of ChangeLog:
> 
>    <<<<<<< .working
>    =======
>    
>    Tue Dec 7 10:06:39 CET 2004 Paolo Molaro <lu...@ximian.com>
>    
>            * exceptions-ppc.c: avoid calling ppc_patch in exception \
>              trampolines.
>    
>    2004-12-01  Neale Ferguson <Ne...@SoftwareAG-usa.com>
>    >>>>>>> .merge-right.r37303

The state of the repository has changed, since the patch has been committed
to the branch (using diff & patch). If you do the initial checkout
at a revision where the patch was not in the branch you'll get the same
huge conflict. Try, as the first step:
	svn co -r 37330 svn://svn.myrealbox.com/source/branches/mono-1-0/mono/mono/mini
and then do the same merge. This gets the wc in mostly the same state as 
when the issue was noticed.
The start of the Changelog file should look like:

== cut cut ==
<<<<<<< .working
=======

Tue Dec 7 10:06:39 CET 2004 Paolo Molaro <lu...@ximian.com>

	* exceptions-ppc.c: avoid calling ppc_patch in exception trampolines.

2004-12-01  Neale Ferguson <Ne...@SoftwareAG-usa.com>

	* inssel-s390.brgi, mini-ops.h, mini-s390.c : Add stubs for support of tls offset
	support.

2004-12-06  Zoltan Varga  <va...@freemail.hu>

	* mini-sparc.c: Zero out localled-ed memory.

	* iltests.il: Add tests for zeroing out localloc-ed memory.

2004-12-04  Martin Baulig  <ma...@ximian.com>

	* mini.c (mono_method_to_ir): In CEE_CALLVIRT, use the new
	mono_method_get_signature_full().	

2004-12-03  Massimiliano Mantione  <ma...@ximian.com>

	* mini.c: Added removal of critical edges (prerequisite for SSAPRE),
	and some utility functions (always for SSAPRE), integrated SSAPRE.
	* mini.h: Likewise.
	* driver.c: Added ssapre option.
	* ssa.c: Small fix on OP_ARG handling.
	* ssapre.c, ssapre.h: Added files containing SSAPRE implementation.
	* Makefile.am: Likewise.

2004-12-02  Zoltan Varga  <va...@freemail.hu>

	* tramp-x86.c (mono_arch_create_jit_trampoline): Remove code which is
	now in the xp code.

	* mini.c (mini_init): Register mono_thread_force_interruption_checkpoint
	icall.

2004-12-01  Neale Ferguson <Ne...@SoftwareAG-usa.com>

	* inssel-s390.brg : Add OP_OUTARG_VT (OP_REFANYTYPE (reg)) rule.
	
	* cpu-s390.md : Increase instruction length of oparglist.

	* mini-s390.c : Implement vararg and TYPEDEBYREF support.

2004-11-30  Martin Baulig  <ma...@ximian.com>

	* mini.c (mono_method_to_ir): In CEE_CALLVIRT, added support for
	virtual generic methods.  We call a special helper_compile_generic_method()
	icall to retrieve the method from the vtable, inflate and compile
	it and then do a CEE_CALLI.  Thanks a lot to Paolo for this idea.

	* jit-icalls.c (helper_compile_generic_method): New JIT icall.

2004-11-30  Zoltan Varga  <va...@freemail.hu>

	* mini-sparc.c: Fix up vararg corner cases. Fixes #70019.

>>>>>>> .merge-right.r37303
2004-11-29  Zoltan Varga  <va...@freemail.hu>
== cut cut ==

Note the 60 line conflict instead of the 4 lines one.

> Can you say exactly what you saw, that caused you to describe a "huge
> conflict"?

See above. The merge included a lot of stuff that was not in the
merged revision.

lupus

-- 
-----------------------------------------------------------------
lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: 'svn merge' vs. diff/patch

Posted by kf...@collab.net.
Ben Collins-Sussman <su...@collab.net> writes:
> # check out a branch wc
> svn co svn://svn.myrealbox.com/source/branches/mono-1-0/mono/mono/mini
> 
> # examine the patch on trunk (this shows a tiny addition to 'ChangeLog')
> svn diff -r37302:37303
> svn://svn.myrealbox.com/source/trunk/mono/mono/mini

Note that in addition to the small change to ChangeLog, there are also
minor changes to other files in this diff.  (That doesn't matter for
this recipe, I'm just warning people.)

> # now apply the same patch to the wc:
> svn merge -r37302:37303
> svn://svn.myrealbox.com/source/trunk/mono/mono/mini
> 
> ... the merge results in a huge conflict within 'ChangeLog', rather
> than just a tiny 3-line addition as 'svn diff' predicted.

With SVN trunk r12206, I don't get a huge conflict.  I get this at the
top of ChangeLog:

   <<<<<<< .working
   =======
   
   Tue Dec 7 10:06:39 CET 2004 Paolo Molaro <lu...@ximian.com>
   
           * exceptions-ppc.c: avoid calling ppc_patch in exception \
             trampolines.
   
   2004-12-01  Neale Ferguson <Ne...@SoftwareAG-usa.com>
   >>>>>>> .merge-right.r37303
   
   Tue Dec 7 11:44:39 CET 2004 Paolo Molaro <lu...@ximian.com>
   
           * mini-ppc.c, objectc.cs: handle large structs passed by value
           (fixes bug #69972).

Note that I indented the whole quote by three spaces for offset
clarity, then backslashed one line to avoid ugly wrapping.  Otherwise,
it's exactly as it appears in my working copy.  The rest of the
ChangeLog continues from that point just as it is in the working copy,
with no more conflict markers.

The above looks quite plausible, given the diff and the target data.

> What's going on here?  Is it the fact that 'svn diff' is doing a
> two-way diff, but 'svn merge' is doing a three-way diff?  Could that
> cause this?

Can you say exactly what you saw, that caused you to describe a "huge
conflict"?

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org