You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Thomas Weise <th...@efrontier.com> on 2008/08/26 18:51:51 UTC

SVN 1.5.1 merge issue with new files

SVN 1.5.1 does not handle a merge scenario (reports a conflict) where a
new file is added to trunk, then merged to a branch, then modified in
the branch and then merged back to trunk.   

The merge back to trunk fails with a conflict when using svn merge with
no additional options.  

With the-reintegrate option the correct merge/update occurs instead.

Please find the console log below. My expectation was that merge should
handle this case w/o additional options. It looks like a bug. Even if
there was no common ancestor or merge info, the change itself is not a
conflict, just comparing the two files should be sufficient to merge.

Thanks,
Thomas

svn copy http://hiva.pao.efrontier.com/svn/sandbox/trunk
http://hiva.pao.efrontier.com/svn/sandbox/branches/branch1

svn co http://hiva.pao.efrontier.com/svn/sandbox/trunk .

tweise@hiva:~/svn/hiva/sandbox> echo xxx > file1.txt
tweise@hiva:~/svn/hiva/sandbox> svn add file1.txt
A         file1.txt
tweise@hiva:~/svn/hiva/sandbox> svn commit -m "adding file1 to main"
Adding         file1.txt
Transmitting file data .
Committed revision 4.

tweise@hiva:~/svn/hiva/sandbox> svn switch
http://hiva.pao.efrontier.com/svn/sandbox/branches/branch1
D    file1.txt
Updated to revision 4.

tweise@hiva:~/svn/hiva/sandbox> svn merge
http://hiva.pao.efrontier.com/svn/sandbox/trunk
--- Merging r3 through r4 into '.':
A    file1.txt

tweise@hiva:~/svn/hiva/sandbox> svn commit -m "merge from trunk"
Sending        .
Adding         file1.txt

Committed revision 5.

tweise@hiva:~/svn/hiva/sandbox> vi file1.txt
tweise@hiva:~/svn/hiva/sandbox> svn commit -m "changing file1 in
branch1"
Sending        file1.txt
Transmitting file data .
Committed revision 6.


tweise@hiva:~/svn/hiva/sandbox> svn switch
http://hiva.pao.efrontier.com/svn/sandbox/trunk
U    file1.txt
 U   .


tweise@hiva:~/svn/hiva/sandbox> svn merge
http://hiva.pao.efrontier.com/svn/sandbox/branches/branch1
Conflict discovered in 'file1.txt'.
Select: (p) postpone, (df) diff-full, (e) edit,
        (h) help for more options: df
--- .svn/tmp/tempfile.tmp       Tue Aug 26 11:32:18 2008
+++ .svn/tmp/tempfile.3.tmp     Tue Aug 26 11:32:18 2008
@@ -0,0 +1,9 @@
+<<<<<<< .working
+xxx
+=======
+xxx
+yyy
+zzz
+
+
+>>>>>>> .merge-right.r6
Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved,
        (h) help for more options:


 svn revert . -R
 svn cleanup 
 svn up



tweise@hiva:~/svn/hiva/sandbox> svn merge --reintegrate
http://hiva.pao.efrontier.com/svn/sandbox/branches/branch1
--- Merging differences between repository URLs into '.':
U    file1.txt
 U   .
tweise@hiva:~/svn/hiva/sandbox> svn diff file1.txt
Index: file1.txt
===================================================================
--- file1.txt   (revision 6)
+++ file1.txt   (working copy)
@@ -1 +1,5 @@
 xxx
+yyy
+zzz
+
+

 

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


Re: SVN 1.5.1 merge issue with new files

Posted by Mark Phippard <ma...@gmail.com>.
On Tue, Aug 26, 2008 at 2:51 PM, Thomas Weise
<th...@efrontier.com> wrote:
> SVN 1.5.1 does not handle a merge scenario (reports a conflict) where a
> new file is added to trunk, then merged to a branch, then modified in
> the branch and then merged back to trunk.
>
> The merge back to trunk fails with a conflict when using svn merge with
> no additional options.
>
> With the-reintegrate option the correct merge/update occurs instead.
>
> Please find the console log below. My expectation was that merge should
> handle this case w/o additional options. It looks like a bug. Even if
> there was no common ancestor or merge info, the change itself is not a
> conflict, just comparing the two files should be sufficient to merge.

The scenario you outline is the exact case where you are supposed to
use --reintegrate.  Specifically, you can expect that you need to use
--reintegrate anytime you want to merge a branch back to the place
from which is was originally created.  To be completely precise
though, you only really need to use --reintegrate in this scenario IF
you also performed at least one merge to the branch from the source
location.  You did this in your example in r5.  Once you have done
that merge you have created a "reflective" or "cyclic" merge scenario
and you must use --reintegrate when merging the branch back to the
source.


-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

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