What is the best way to merge a function branch into a trunk in Subversion?

We use function branches in Subversion for our development, which is a very convenient way to save code in version control, which is not yet ready for the main line. However, whenever I am going to combine a revision of a function branch into a trunk, it is a pain. Now I go through the following steps:

  • Mark the original revision of the original version in the new directory
  • Make the difference between my current development and source function catalogs with a tool like Beyond Compare
  • Browse the current version of the main line in the new directory
  • Merge new / changed files into the current directory of the main directory.
  • Make the difference using my IDE to make sure all files are correctly extracted / added in subversion.
  • Compile and test
  • Fix

It seems to me that in this process there are many opportunities for mistakes, and it makes me nervous every time I go up the stairs. Of course, everything is checked in Subversion on my function branch, so the error is restored at any stage.

I believe Subversion 1.5 has a way to merge a branch into a trunk, but we still use Subversion 1.4. What do other people use to simplify the steps of merging the feature branch in Subversion into their trunk development? Do you use different tools? Do you use the merge function in Subversion 1.5?

+6
svn
source share
4 answers

I am using the new --reintegrate Subversion 1.5 feature at the moment, and I think it is awesome. This is much simpler and much less error prone than the manual method. However, the drawback is that the new merge functions require both the repository and the client to be at level 1.5, and the changes in the repository exception 1.5 should not be used for any clients other than 1.5 ... therefore, to get the merge function, it is basically an all-or-nothing scenario.

As for your initial questions, you just need to very carefully monitor which changes in the main branch you merged into your working branch during development. However, even with the -reintegrate 1.5 function, it is still important to ensure that the reintegrated working copy of the main branch looks correct and compiles before committing. It just makes life easier (especially for function duration branches), because you do not need to keep strict logs regarding what you changed, and when you integrated changes from other branches into your function branch.

The release notes documentation for subversion.tigris.org is very well written, and I would recommend a brief look at it to see all the changes between 1.4 and 1.5 and a good description of the new merge features.

+6
source share

Steps 1, 2, 4, and 5 are all built into disruptive activities, the svn merge command does this. On your working copy of type mainline 'svn merge -r startrev: lastref svn: // repository / branchurl'. Startref and lastref will indicate the revision window that should be merged with the main line. 'svn: // repository / branchurl' should be the URL of your branch.

Subversion 1.5 provides better support for this feature. You no longer need to specify the revisions that you want to merge, since subversion now saves merge information and simply merges the entire revision that has not yet been merged.

Read more about this in the Subversion-book .

+3
source share

If this is your branch that you want to merge back into the main branch (i.e. you are not an integrator that does this for other developers), here is what you need to do:

  • Record the version in which you last merged the main line into your branch (to synchronize it). Let me call him "LASTSYNC"
  • check the mainline branch in a new directory (e.g. MergeFeatureBranchToTrunk), create it
  • in this thread, use svn merge "LASTSYNC":HEAD svn://path/to/FeatureBranch .
  • resolve conflicts (if any)
  • compilation
  • test
  • check your changes with the diff tool to make sure everything looks good.
  • translate to main page
+2
source share

Take a look at svnmerge ; does he track "what I combined, what I chose so as not to merge"? part of the job for you, and relies on the svn "merge" team to do the heavy lifting.

0
source share

All Articles