Add setup_repo() to init.sh

This replaces calls to setup_git and setup_hg and figures out which one
it should call out of the two