Subversion: howto find all revisions that are not merged to trunk

branchmergesvn

Branching sources for release cycle is one of common source management scenarios. Merging as soon as possible is a good practice. Thus we have a human factor: branch is closed, but someone forgot to merge something back to trunk.

Q: Is there a "one click" way to get all revision numbers that were not merged from branch X to trunk?

(Note: I do not need these revision numbers to find what to merge, I need them to create automated validation, that would remind people to make sure they did not forget to merge something to trunk. Merging itself is not an issue.)

It seems like svn mergeinfo command fails to help here. Passing branch and trunk roots will fail if merge was performed not on root level (and it is a common scenario).

Scripts, tools any kind of svn hooks as a solution are welcome.

P.S.

Latest version of SVN. No need to argue how common or good this scenario is 😉

Best Answer

You can do this super easily if you're using a relatively newish version of Subversion (1.5 or higher, I think) with the mergeinfo sub-command.

svn mergeinfo --show-revs eligible svn://repo/branches/your-branch-name svn://repo/trunk

This will show you all the revisions that are eligible to be merged to the trunk from the branch "your-branch-name".

Source: http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.mergeinfo.html