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

Reply via email to