Subversion uses metadata called “mergeinfo” to track where merges came from, and which branches have merged into which other branches. It’s this information which makes commands like
svn merge --depth infinity .
work like magic. (It’s also this information that can make those commands slow on large codebases!)
At some point I intend to write up my findings on exactly what mergeinfo is, and what you need to know about it if you are a repository owner. (This information exists already, but seems to be quite scattered around the web a bit.)
In the meantime here’s a quick tip that, if it applies to you, might make things go a bit faster on svn merges.
Run the following
svn pg svn:mergeinfo -R > mergeinfo.txt
from the root of a working copy of your “trunk”. Look at the resulting file. Merge information looks a bit like this.
. - /branches/dev_project:23-44
This records merges onto the trunk (“.”) from various dev projects. You’ll see merge info recorded on multiple folders and files in your repository.
I found that certain operations using subversion 1.6 could introduce “empty” mergeinfo. That is, a file or folder may have the “svn:mergeinfo” property set with no value. This is pointless, and in extremes may slow down your merges quite a lot.
Here’s a handy script which will remove any empty mergeinfo. (The script doesn’t commit, so check the changes it has made and commit if you’re happy.)
Provided without any warranty. :)