You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Matthew Pounsett <ma...@conundrum.com> on 2013/02/07 15:19:47 UTC

Unexpected conflicts merging updates from trunk to a branch

I've been running into unexpected tree conflicts when updating branches from the trunk, after reintegrating to the trunk where and file adds or removes were involved in the reintegrate.  I expect I'm doing something wrong here, but I haven't been able to figure out what.  Can someone point me in the right direction?   Here's a simple example that demonstrates my issue.

In this case my server is 1.7.5 and my client is the MacOS client 1.6.17.

~/Development/svn-test > svn update
At revision 30.

~/Development/svn-test > cd branches/

~/Development/svn-test/branches > svn cp ^/trunk mybranch
Checked out revision 30.
A         mybranch

~/Development/svn-test/branches > svn commit -m "created mybranch"
Adding         branches/mybranch

Committed revision 31.

~/Development/svn-test/branches > cd mybranch/

~/Development/svn-test/branches/mybranch > touch foo

~/Development/svn-test/branches/mybranch > svn add foo
A         foo

~/Development/svn-test/branches/mybranch > svn commit -m "added file foo"
Adding         mybranch/foo
Transmitting file data .
Committed revision 32.

# Not necessary.. just being paranoid for demonstration purposes.
~/Development/svn-test/branches/mybranch > svn merge ^/trunk

~/Development/svn-test/branches/mybranch > cd ../../trunk/

~/Development/svn-test/trunk > svn merge --reintegrate ^/branches/mybranch
--- Merging differences between repository URLs into '.':
A    foo

# Again, probably not necessary.
~/Development/svn-test/trunk > svn update
At revision 32.

~/Development/svn-test/trunk > svn commit -m "reintegrated mybranch"
Sending        trunk
Adding         trunk/foo

Committed revision 33.

~/Development/svn-test/trunk > cd ../branches/mybranch/

~/Development/svn-test/branches/mybranch > svn update
At revision 33.

# With this merge I expect to pick up any changes that are the results of
# any reintegration from other branches, but not changes I reintegrated from 
# this branch already.
~/Development/svn-test/branches/mybranch > svn merge ^/trunk
--- Merging r33 into '.':
   C foo
Summary of conflicts:
  Tree conflicts: 1

~/Development/svn-test/branches/mybranch > svn status
 M      .
      C foo
      >   local add, incoming add upon merge


Re: Unexpected conflicts merging updates from trunk to a branch

Posted by Matthew Pounsett <ma...@conundrum.com>.
On 2013/02/07, at 10:09, Stefan Sperling wrote:

> On Thu, Feb 07, 2013 at 09:19:47AM -0500, Matthew Pounsett wrote:
>> 
>> I've been running into unexpected tree conflicts when updating branches from the trunk, after reintegrating to the trunk where and file adds or removes were involved in the reintegrate.  I expect I'm doing something wrong here, but I haven't been able to figure out what.  Can someone point me in the right direction?   Here's a simple example that demonstrates my issue.
> 
> You cannot keep using the as-is branch after it has been reintegrated.

Ah, of course.  Thanks very much for the references.. I'll go have another re-read.

> 
> Please review the entire "Reintegrating a Branch" section again:
> http://svnbook.red-bean.com/en/1.7/svn.branchmerge.basicmerging.html#svn.branchemerge.basicmerging.reintegrate
> and also see the "Keeping a Reintegrated Branch Alive", which discusses
> the problem in detail:
> http://svnbook.red-bean.com/en/1.7/svn.branchmerge.advanced.html#svn.branchmerge.advanced.reintegratetwice
> 
> This will be much easier in 1.8, see:
> http://subversion.apache.org/docs/release-notes/1.8.html#auto-merge
> 


Re: Unexpected conflicts merging updates from trunk to a branch

Posted by Stefan Sperling <st...@elego.de>.
On Thu, Feb 07, 2013 at 09:19:47AM -0500, Matthew Pounsett wrote:
> 
> I've been running into unexpected tree conflicts when updating branches from the trunk, after reintegrating to the trunk where and file adds or removes were involved in the reintegrate.  I expect I'm doing something wrong here, but I haven't been able to figure out what.  Can someone point me in the right direction?   Here's a simple example that demonstrates my issue.

You cannot keep using the as-is branch after it has been reintegrated.

Please review the entire "Reintegrating a Branch" section again:
http://svnbook.red-bean.com/en/1.7/svn.branchmerge.basicmerging.html#svn.branchemerge.basicmerging.reintegrate
and also see the "Keeping a Reintegrated Branch Alive", which discusses
the problem in detail:
http://svnbook.red-bean.com/en/1.7/svn.branchmerge.advanced.html#svn.branchmerge.advanced.reintegratetwice

This will be much easier in 1.8, see:
http://subversion.apache.org/docs/release-notes/1.8.html#auto-merge