Merging Branches         Branch maintenance requires a reliable procedure for merging between branches

Merging Branches

Introduction

The OGRE development approach involves maintaining many branches of the codebase, the most common purpose for which is separating new, interface-breaking or riskier development from stable maintenance branches. Branch maintenance requires a reliable procedure for merging between branches.

General Approach

  • Branches will be located in subfolders of https://svn.ogre3d.org/svnroot/ogre/branches
  • Branches for stable versions will be named after the major and minor version number, e.g. https://svn.ogre3d.org/svnroot/ogre/branches/v1-7
  • Bugfixes should be committed to the earliest stable branch being maintained and merged forward, through later branches if applicable and into the trunk
  • New features should be committed to the trunk, or to a branch which has not yet been made officially stable
  • Branch merging is automated with svnmerge

Setup

  • You'll need to install the command-line version of Subversion as well as svnmerge.
  • You'll need to permanently accept the SSL cert for the Ogre Subversion server at least once before running svnmerge, so for example do a checkout on the command line (svn co https://svn.ogre3d.org/svnroot/ogre/trunk ogre_trunk) and choose to 'Permanently Accept' the certificate.

Taking a branch

  • Create the branch from the source (usually) trunk using svn copy, using URLs and not a local copy e.g.
svn copy https://svn.ogre3d.org/svnroot/ogre/trunk https://svn.ogre3d.org/svnroot/ogre/branches/v1-7
  • In a working copy of each SVN location you want to be able to merge changes in this new branch into (ie at least trunk), initialise svnmerge:
svnmerge init https://svn.ogre3d.org/svnroot/ogre/branches/v1-7
  svn ci -F svnmerge-commit-message.txt

Merging changes

If you have committed changes to the branch and want to merge them, perform these steps in a (clean) working copy of the destination (trunk or later branch):

  • Merge the code changes
svnmerge -Shttps://svn.ogre3d.org/svnroot/ogre/branches/v1-7 merge
  • If there were any conflicts, resolve them
  • Build and test the merged code
  • Commit the merge
svn ci -F svnmerge-commit-message.txt

Why use svnmerge instead of SVN 1.5's merge?

Mostly because these procedures predate SVN 1.5, are proven, and svnmerge operates in exactly the same way as SVN 1.5's merge anyway. It's nice not to require SVN 1.5 particularly as it's fairly new.