Check if a repo_url is git or mercurial using dianostics.

Added diagnose_repo function. This will run `git ls-remote` and `hg
identify` to identify the repo type.