svn merge : Tree conflict weird
Asked Answered
T

3

1

I am getting Tree conflict in SVN. It's weird!

I have standard Trunk, Branches, Tags structure, and follow multiple team model. Branch1, Branch2 are created form Trunk and active parallely

Steps followed:
1. Branch1 Work: newfile.c added and committed in Branch1
2. Merge : From Branch1 -> Trunk (successful; file added in trunk)
3. Merge : Down-merge from Trunk -> Branch2. (successful; file added in Branch2)
4. Branch2 Work: Perform regular Branch2 work and commit.
5. Merge: From Branch2 to Trunk => This step throws Tree-conflict for newfile.c

Branch2 Team is getting Tree conflict for newfile.c which they have not touched at all. Why is this happening. Any suggestions please, can this be avoided? This issue is bugging me a lot.

PS: I used TortoiseSVN client 1.6.0 and TortoiseSVN 1.6.16 - 32 Bit (both used separately)

merge error (above step-5):

>svn merge file:///E:/Treeconflict_test/svnRepo/Branches/Br2 Trunk
--- Merging r3 through r8 into 'Trunk':
   C Trunk\src\ARTransactionFeeDto2.java
U    Trunk\pom.xml
 G   Trunk
Summary of conflicts:
  Tree conflicts: 1

>svn status Trunk
 M      Trunk
      C Trunk\src\ARTransactionFeeDto2.java
      >   local obstruction, incoming add upon merge
M       Trunk\pom.xml

PFB svn repo log (above step 1-4):

>svn log -v file:///E:/Treeconflict_test/svnRepo
------------------------------------------------------------------------
r8 | rohit | 2013-03-05 16:30:35 +0530 (Tue, 05 Mar 2013) | 1 line
Changed paths:
   M /Branches/Br2/src/ARTransactionFeeDto2.java

br2 branch changes
------------------------------------------------------------------------
r7 | rohit | 2013-03-05 16:29:34 +0530 (Tue, 05 Mar 2013) | 1 line
Changed paths:
   M /Branches/Br2
   M /Branches/Br2/pom.xml
   A /Branches/Br2/src/ARTransactionFeeDto2.java (from /Trunk/src/ARTransactionF
eeDto2.java:6)

dowm-merge from Trunk to branch-Br2
------------------------------------------------------------------------
r6 | rohit | 2013-03-05 16:26:56 +0530 (Tue, 05 Mar 2013) | 1 line
Changed paths:
   M /Branches/Br2/pom.xml

br2 branch changes
------------------------------------------------------------------------
r5 | rohit | 2013-03-05 16:22:26 +0530 (Tue, 05 Mar 2013) | 1 line
Changed paths:
   M /Trunk
   M /Trunk/pom.xml
   A /Trunk/src/ARTransactionFeeDto2.java (from /Branches/Br1/src/ARTransactionFeeDto2.java:4)

up-merge from branch-Br1 to Trunk
------------------------------------------------------------------------
r4 | rohit | 2013-03-05 16:20:48 +0530 (Tue, 05 Mar 2013) | 1 line
Changed paths:
   M /Branches/Br1/pom.xml
   A /Branches/Br1/src/ARTransactionFeeDto2.java

br1 changes
------------------------------------------------------------------------
r3 | rohit | 2013-03-05 16:19:07 +0530 (Tue, 05 Mar 2013) | 1 line
Changed paths:
   A /Branches/Br2 (from /Trunk:2)

created branch br2
------------------------------------------------------------------------
r2 | rohit | 2013-03-05 16:18:57 +0530 (Tue, 05 Mar 2013) | 1 line
Changed paths:
   A /Branches/Br1 (from /Trunk:1)

created branch Br1
------------------------------------------------------------------------
r1 | rohit | 2013-03-05 16:18:13 +0530 (Tue, 05 Mar 2013) | 1 line
Changed paths:
   A /Branches
   A /Tags
   A /Trunk
   A /Trunk/pom.xml
   A /Trunk/src
   A /Trunk/src/ARTransactionFeeDelegateResponse.java
   A /Trunk/src/ARTransactionFeeDto.java
   A /Trunk/src/ResponseARTransFeeDtlsDto.java

initial commit Trunk
------------------------------------------------------------------------
Tails answered 5/3, 2013 at 10:32 Comment(6)
Tree-conflict in SVN possible if file in merged tree renamed and edited in different part at the same time only, AFAIKGilliangilliard
... and you normally get a detailed explanation :-?Thrombosis
@ÁlvaroG.Vicario - no, I didn't get for Tree Conflicts anywayGilliangilliard
Well, your commands differ from description - my tests in this case unrelated to problem: your added ARTransactionFeeDto2.java was edited in r8 in B2 before merge-back to trunkGilliangilliard
@LazyBadger - Commands are same as per the description. Yes, file was edited in r8, but reults are same even if i don't edit. Results are the same. Am I doing any mistake, I am getting tree conflicts everytime.Tails
Sorry, no "Branch2 Team is getting Tree conflict for newfile.c which they have not touched at all" - but they touched it. See difference between your log and my first test, where added file was not edited and my add-on 2, there I confirmed bug (at least I see it as bug) even in 1.7Gilliangilliard
G
2

It's impossible in this workflow, even for 1.6. You have to show all commands and output

According to log, you are victim of "XFAIL conflict from merge of add over versioned file", mentioned in 2009-version of "Tree Conflict" design document. Most important part is

Fixed expectations in r35341

And I can't say, how this revision can be translated to TortoiseSVN build with bugfix. I'll test your workflow on my latest 1.6 (TortoiseSVN 1.6.16, Build 21511 - 32 Bit , 2011/06/01 19:00:35).

My log for used TortoiseSVN 1.7.11, Build 23600 - 32 Bit (all merges - GUI-based, local repository)

>svn log -v file:///Z:/Repo/
------------------------------------------------------------------------
r10 | Badger | 2013-03-05 17:32:32 +0600 (Вт, 05 мар 2013) | 2 lines
Changed paths:
   M /trunk
   M /trunk/Base.txt
   M /trunk/C1.txt
   M /trunk/C2.txt

Merge from branches/b2:

------------------------------------------------------------------------
r9 | Badger | 2013-03-05 17:27:42 +0600 (Вт, 05 мар 2013) | 1 line
Changed paths:
   M /branches/b2/Base.txt
   M /branches/b2/C1.txt
   M /branches/b2/C2.txt

Anfanglichen Deutsch Korperregion
------------------------------------------------------------------------
r8 | Badger | 2013-03-05 17:19:28 +0600 (Вт, 05 мар 2013) | 2 lines
Changed paths:
   M /branches/b2
   M /branches/b2/Base.txt
   M /branches/b2/C1.txt
   M /branches/b2/C2.txt
   A /branches/b2/Reference.txt (from /trunk/Reference.txt:7)

Merge from trunk

------------------------------------------------------------------------
r7 | Badger | 2013-03-05 17:15:29 +0600 (Вт, 05 мар 2013) | 1 line
Changed paths:
   M /trunk
   M /trunk/Base.txt
   A /trunk/Reference.txt (from /branches/b1/Reference.txt:6)

Merge B1 branch changes
------------------------------------------------------------------------
r6 | Badger | 2013-03-05 17:12:26 +0600 (Вт, 05 мар 2013) | 1 line
Changed paths:
   M /branches/b1/Base.txt
   A /branches/b1/Reference.txt

Structure reflected
------------------------------------------------------------------------
r5 | Badger | 2013-03-05 17:09:46 +0600 (Вт, 05 мар 2013) | 1 line
Changed paths:
   M /trunk/C1.txt
   M /trunk/C2.txt

Edition 1
------------------------------------------------------------------------
r4 | Badger | 2013-03-05 17:06:38 +0600 (Вт, 05 мар 2013) | 1 line
Changed paths:
   A /branches/b2 (from /trunk:3)

Branching for task2
------------------------------------------------------------------------
r3 | Badger | 2013-03-05 17:05:49 +0600 (Вт, 05 мар 2013) | 1 line
Changed paths:
   A /branches/b1 (from /trunk:2)

Branching for task1
------------------------------------------------------------------------
r2 | Badger | 2013-03-05 17:03:21 +0600 (Вт, 05 мар 2013) | 1 line
Changed paths:
   A /trunk/Base.txt
   A /trunk/C1.txt
   A /trunk/C2.txt

Basic set
------------------------------------------------------------------------
r1 | Badger | 2013-03-05 16:59:36 +0600 (Вт, 05 мар 2013) | 1 line
Changed paths:
   A /branches
   A /tags
   A /trunk

Imported folder structure
------------------------------------------------------------------------

Comments:

I tried to repeat your actions as accurately as possible

  • r2-r4 - prepared test-area: trunk and two branches
  • r5 - changed trunk in order to have diverged history
  • r6 - added new file in branch b1 (Reference.txt)
  • r7 - merged branch b1 to trunk (Reference.txt appeared in trunk)
  • r8 - merged trunk to branch b2 (Reference.txt appeared in b2)
  • r9 - changed files in b2, Reference.txt untouched
  • r10 - merge b2 to trunk without any error

Add-on

Tested with 1.6.16, got described result, even if I have pre-merged edited in branch file into trunk before merge trees

Add-on 2

Goddam!!! It doesn't work in latest 1.7 also. It drive me nuts

Gilliangilliard answered 5/3, 2013 at 11:54 Comment(1)
Hi Badger, I have updated question will all repo activities performed. I have not tried with v1.7. Because I need to work on v1.6 as per my organization's current version.Tails
R
1

The error message may look cryptic but basically explains the issue:

local obstruction, incoming add upon merge

You are porting r3 to r8 from BR2 into trunk. The problem is that in r7 you add ARTransactionFeeDto2.java:

r7 | rohit | 2013-03-05 16:29:34 +0530 (Tue, 05 Mar 2013) | 1 line
Changed paths:
   A /Branches/Br2/src/ARTransactionFeeDto2.java (from /Trunk/src/ARTransactionF
eeDto2.java:6)

... but such change cannot be ported to trunk because the file is already there:

r5 | rohit | 2013-03-05 16:22:26 +0530 (Tue, 05 Mar 2013) | 1 line
Changed paths:
   A /Trunk/src/ARTransactionFeeDto2.java (from /Branches/Br1/src/ARTransactionFeeDto2.java:4)

Subversion offers very sophisticated ways to avoid it but I suggest you just use TortoiseSVN to do the merge and, when prompted about conflict in r7, you choose to keep local file (which is identical to incoming file anyway).

Ronnieronny answered 6/3, 2013 at 8:23 Comment(1)
My aim is to get all changes from Trunk to Br2. Then merge all of my Br2 changes back to Trunk. @Álvaro - in r7, the file was added from Trunk to Br2; in r8, it is modified in Br2; Br2 is merged back to Trunk and shows tree-conflict. Here, when I keep local copy in trunk, all Br2 changes are lost.Tails
C
0

I attempted to follow these steps (as closely as I could without the actual list of commands available) with SVN 1.7 and it seemed to work as expected for me.

I think that it may not be working for you because of the '--reintegrate' option that you need to use when merging a branch back into trunk. Are you sure that you used this option every time you merged from either branch back to trunk?

If you did use that option, then please disregard this answer.

Chalmer answered 27/3, 2013 at 14:21 Comment(2)
No i have not used --reintegrate option because, in my case, the branch will be used for further development and merges will kepp happening from trunk->branch and branch->trunk.Tails
Please, re-test - it's rather easy to make incorrect workflow: I had it, and later I can't avoid "tree conflict" in latest TSVNGilliangilliard

© 2022 - 2024 — McMap. All rights reserved.