gen-mr: improve script to work with svn & hg too