The code is as easy as:
But we should have a UI for it. Probably something that works after you install the tool would be best. And make sure the tool goes into 'analyzing' state or something like that, so users know that it's working on it.
Git and hg can be initialized the same way, but that's not really necessary since they're distributed SCMs and you can push the repo yourself.
(classic SVN import happens from the shell: http://sourceforge.net/apps/trac/sourceforge/wiki/SVN%20adminrepo)