tags:

views:

366

answers:

4

Is there any way to perform a merge with subversion 1.6 which would preserve the branch's history?

trunk:  r1 --> r2 --------------> r5
branch:          \--> r3 --> r4 /

such as that when I merge at r4 the history will contain r3 and r4? At the moment subversion will record one merge commit with the diff between r4 and r2.

+1  A: 

Merge each branch revision individually. You might end up in merging hell though like everyone using subversion branching extensively. Your history will be huge too.

This process can be automated to some extent provided there are no conflicts with clever scripting.

CtlAltDel
+2  A: 

No, you need to keep branches r3 and r4 around if you want the history of their commits.

Cameron
+4  A: 

What does it mean to preserve branch's history? If you want svn log and svn blame to see through merges, use option --use-merge-history or -g.

Laurynas Biveinis
+1, that's how I'd interpret it. That flag is only available as part of the enhanced merge support in svn 1.5 or greater. Not sure if the server side must also be >=1.5 ...
jmanning2k
Just got around to testing it, thanks! Works in Subclipse and Subversive as well, which is quite nice.
Robert Munteanu
+1  A: 

I believe the history will be maintained, even if you delete the branch. If you are using TortoiseSVN when viewing history, there is a checkbox labeled "Include merged revisions". If you check that you will see log entries for r3 and r4 when they were on the branch.

glenc