Hi,

We have been doing regular two way merges from trunk to branch and vice-versa using svn 1.5. In 1.6 this results in tree conflicts. Is there any guidance on how to deal with this scenario? All I can find is the svn book, which only talks about tree conflicts wrt to working copies. I have a script attached demonstrating the general problem. It simply adds/deletes files on trunk, merges to mybranch, then merges back to trunk. In my possibly naive view, there really isn't a tree conflict at all as there have been no changes on the branch (other than what was merged from trunk!!). Perhaps we are not merging correctly? Although using --reintegrate when merging back to trunk removes the tree conflict problem, this can't be right option as we want to keep the branch going in order to make further releases.

The "Common Branching Patterns" section http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.branchmerge.commonpatterns does not mention two way merging. We have always worked by having a stable release branch containing bug fixes, which get merged to trunk. However, bug fixes can also be cherry picked from trunk and merged to the release branch. It would be much appreciated if there was some advice on how to use svn with this branching pattern.

Thanks
William
+ svnadmin=svnadmin
+ svn=svn
+ test_root=/home/fultonwi
+ repo=/home/fultonwi/svnrepos/two_way_merge
+ working_copy=/home/fultonwi/svn/two_way_merge
+ svn --version
svn, version 1.6.6 (r40053)
   compiled Nov 17 2009, 15:58:43

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - handles 'http' scheme
  - handles 'https' scheme

+ svnadmin --version
svnadmin, version 1.6.6 (r40053)
   compiled Nov 17 2009, 15:58:43

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository back-end (FS) modules are available:

* fs_fs : Module for working with a plain file (FSFS) repository.

+ mkdir -p /home/fultonwi/svnrepos/two_way_merge
+ rm -rf /home/fultonwi/svnrepos/two_way_merge
+ svnadmin create /home/fultonwi/svnrepos/two_way_merge
+ svn mkdir -m 'create trunk' file:///home/fultonwi/svnrepos/two_way_merge/trunk

Committed revision 1.
+ svn mkdir -m 'create branches' 
file:///home/fultonwi/svnrepos/two_way_merge/branches

Committed revision 2.
+ rm -rf /home/fultonwi/svn/two_way_merge
+ mkdir -p /home/fultonwi/svn/two_way_merge
+ svn checkout file:///home/fultonwi/svnrepos/two_way_merge/trunk 
/home/fultonwi/svn/two_way_merge/trunk
Checked out revision 2.
+ echo 'contents of file1.txt'
+ echo 'contents of file2.txt'
+ svn add /home/fultonwi/svn/two_way_merge/trunk/file1.txt
A         /home/fultonwi/svn/two_way_merge/trunk/file1.txt
+ svn add /home/fultonwi/svn/two_way_merge/trunk/file2.txt
A         /home/fultonwi/svn/two_way_merge/trunk/file2.txt
+ svn commit -m 'Add file1.txt and file2.txt' 
/home/fultonwi/svn/two_way_merge/trunk
Adding         svn/two_way_merge/trunk/file1.txt
Adding         svn/two_way_merge/trunk/file2.txt
Transmitting file data ..
Committed revision 3.
+ svn copy -m 'create mybranch' 
file:///home/fultonwi/svnrepos/two_way_merge/trunk 
file:///home/fultonwi/svnrepos/two_way_merge/branches/mybranch

Committed revision 4.
+ svn rm /home/fultonwi/svn/two_way_merge/trunk/file2.txt
D         /home/fultonwi/svn/two_way_merge/trunk/file2.txt
+ svn commit -m 'remove file2.txt from trunk' 
/home/fultonwi/svn/two_way_merge/trunk/file2.txt
Deleting       svn/two_way_merge/trunk/file2.txt

Committed revision 5.
+ echo 'another line in file1.txt'
+ svn commit -m 'add another line to file1.txt' 
/home/fultonwi/svn/two_way_merge/trunk/file1.txt
Sending        svn/two_way_merge/trunk/file1.txt
Transmitting file data .
Committed revision 6.
+ echo 'contents of file3.txt'
+ svn add /home/fultonwi/svn/two_way_merge/trunk/file3.txt
A         /home/fultonwi/svn/two_way_merge/trunk/file3.txt
+ svn commit -m 'Add file3.txt' /home/fultonwi/svn/two_way_merge/trunk
Adding         svn/two_way_merge/trunk/file3.txt
Transmitting file data .
Committed revision 7.
+ svn checkout file:///home/fultonwi/svnrepos/two_way_merge/branches/mybranch 
/home/fultonwi/svn/two_way_merge/branches/mybranch
A    /home/fultonwi/svn/two_way_merge/branches/mybranch/file2.txt
A    /home/fultonwi/svn/two_way_merge/branches/mybranch/file1.txt
Checked out revision 7.
+ svn merge file:///home/fultonwi/svnrepos/two_way_merge/trunk 
/home/fultonwi/svn/two_way_merge/branches/mybranch
--- Merging r4 through r7 into 
'/home/fultonwi/svn/two_way_merge/branches/mybranch':
A    /home/fultonwi/svn/two_way_merge/branches/mybranch/file3.txt
U    /home/fultonwi/svn/two_way_merge/branches/mybranch/file1.txt
D    /home/fultonwi/svn/two_way_merge/branches/mybranch/file2.txt
+ svn commit -m 'merge trunk to mybranch' 
/home/fultonwi/svn/two_way_merge/branches/mybranch
Sending        svn/two_way_merge/branches/mybranch
Sending        svn/two_way_merge/branches/mybranch/file1.txt
Deleting       svn/two_way_merge/branches/mybranch/file2.txt
Adding         svn/two_way_merge/branches/mybranch/file3.txt
Transmitting file data .
Committed revision 8.
+ svn log --stop-on-copy --verbose 
file:///home/fultonwi/svnrepos/two_way_merge/branches/mybranch
------------------------------------------------------------------------
r8 | fultonwi | 2009-12-18 09:49:49 +0000 (Fri, 18 Dec 2009) | 1 line
Changed paths:
   M /branches/mybranch
   M /branches/mybranch/file1.txt
   D /branches/mybranch/file2.txt
   A /branches/mybranch/file3.txt (from /trunk/file3.txt:7)

merge trunk to mybranch
------------------------------------------------------------------------
r4 | fultonwi | 2009-12-18 09:49:44 +0000 (Fri, 18 Dec 2009) | 1 line
Changed paths:
   A /branches/mybranch (from /trunk:3)

create mybranch
------------------------------------------------------------------------
+ svn update /home/fultonwi/svn/two_way_merge/trunk
At revision 8.
+ svn merge file:///home/fultonwi/svnrepos/two_way_merge/branches/mybranch 
/home/fultonwi/svn/two_way_merge/trunk
--- Merging r4 through r8 into '/home/fultonwi/svn/two_way_merge/trunk':
   C /home/fultonwi/svn/two_way_merge/trunk/file3.txt
   C /home/fultonwi/svn/two_way_merge/trunk/file2.txt
Summary of conflicts:
  Tree conflicts: 2
+ svn info /home/fultonwi/svn/two_way_merge/trunk/file2.txt
Path: /home/fultonwi/svn/two_way_merge/trunk/file2.txt
Name: file2.txt
Node Kind: none
Tree conflict: local delete, incoming delete upon merge
  Source  left: (file) 
file:///home/fultonwi/svnrepos/two_way_merge/trunk/file2....@3
  Source right: (file) 
file:///home/fultonwi/svnrepos/two_way_merge/branches/mybranch/file2....@8

+ svn info /home/fultonwi/svn/two_way_merge/trunk/file3.txt
Path: /home/fultonwi/svn/two_way_merge/trunk/file3.txt
Name: file3.txt
URL: file:///home/fultonwi/svnrepos/two_way_merge/trunk/file3.txt
Repository Root: file:///home/fultonwi/svnrepos/two_way_merge
Repository UUID: 2d85baaf-695b-4046-adf0-a327d04775e6
Revision: 8
Node Kind: file
Schedule: normal
Last Changed Author: fultonwi
Last Changed Rev: 7
Last Changed Date: 2009-12-18 09:49:46 +0000 (Fri, 18 Dec 2009)
Text Last Updated: 2009-12-18 09:49:46 +0000 (Fri, 18 Dec 2009)
Checksum: 11a6d83f30e526ce94b4d4dace7231a8
Tree conflict: local add, incoming add upon merge
  Source  left: (file) 
file:///home/fultonwi/svnrepos/two_way_merge/trunk/file3....@3
  Source right: (file) 
file:///home/fultonwi/svnrepos/two_way_merge/branches/mybranch/file3....@8

Attachment: two_way_merge_test.sh
Description: Bourne shell script

Reply via email to