We frequently use Subversion for version control, and use /trunk to commit all code in active development and merge code to a stable branch that represents what is currently on a production server.

Sometimes commits need to be done right away, so you merge them right away; others can wait until you do a push.  After developing a while with regular commits to trunk, you can have a state where several commits in trunk may already be in the stable branch while others aren’t.  When you’re ready to push a group of commits to stable or do a full release of everything from trunk to stable, it’s helpful to know which commits haven’t been merged to your stable branch yet.

Here’s a bash script that will show you the details of everything in trunk that hasn’t been merged to stable:

#!/bin/bash
for i in `svn mergeinfo --show-revs eligible svn://server/project/trunk svn://server/project/branches/stable | cut -c 2-`
do
svn log -c $i svn://server/project/trunk
done | less

The magic here is the “svn merginfo –show-revs eligible”.  Very useful.