[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Help merging tree conflict

From: Johannes Zeppenfeld <zeppenfe_at_tum.de>
Date: Wed, 14 Apr 2010 13:17:19 +0200

Hello,

I just encountered my first tree conflict, caused by copying a file into two different branches, then making changes to that file in both branches. Is there some way to merge the changes made to the file in each branch without losing the history of either branch's changes?

The easiest way I can think of to summarize what I am trying to do is a list of commands. This is simplified somewhat, but note that not only is a file copied - a directory is created in both branches as well to house that file.

# Checkins after each command are not shown.

# Create the branches.
svn copy trunk branches/branch1
svn copy trunk branches/branch2

# An external source directory includes source files that are used by the
# code in the repository. If customized versions of the source files in
# the library directory are required, the source files are copied to the
# repository.
# This avoids changes within the library directory tree.
svn mkdir branches/branch1/dir
cp /libsrc/dir/file.x branches/branch1/dir/file.x
# Make minor changes to the file.
touch branches/branch1/dir/file.x
# Make some other changes.

# Do the same in branch2.
svn mkdir branches/branch2/dir
cp /libsrc/file.x branches/branch1/dir
# Make other minor changes to the file.
touch branches/branch2/dir/file.x
# Make some other changes.

# ... this is where I am now ...

# Attempt to merge changes from branch1 into branch2
???

What I would like to achieve with the merge is that the directory is "combined", and the changes to the file in both branches are merged _with history_. The closest I've managed to come is to resolve the tree conflict by keeping the branch2 version of the directory and file, then using an external diff tool to transfer the changes from branch1 to branch2. Unfortunately this loses the history of changes made in branch1.

Is there some way to merge this with history intact?
Thanks!
Johannes
Received on 2010-04-14 13:24:11 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.