Backported automatic svn revision handling from 3.0