January 04, 2007

Subversion merging

Subversion does not make the task of merging multiple branches easy. Just discovered svnmerge.py.

The tutorial and downloads links are here. There are three use cases: development branch, release branch, and merging
branches back to trunk. You can do any combination of them at the same time.

Merge information is stored as standard svn properties!

(I am standing in a clean trunk checkout)

[email protected]:/space/sources/trunk/myproject> svnmerge.py avail

(if I am tracking more than 1 branch, I need to specify it, here it assumed I
asked for 1.0-Branch)

You can block certain revisions to be shown as available ( for example stuff that I
don’t want to integrate from 1.0-Branch into trunk) and you can also query
the integrated revisions.

Finally, you can merge:

svnmerge.py merge –bidirectional

it does not commit for you, of course.

You can see how they are stored as svn properties:

[email protected]:/space/sources/trunk/myproject> svn pg svnmerge-integrated