def identify_vcs(repo_url, guess=False, repo_aliases=REPO_ALIASES):
repo_url = unicode(repo_url)<EOL>vcs = identify_vcs_vs_alias(repo_url, guess=guess, repo_aliases=repo_aliases)<EOL>if vcs:<EOL><INDENT>return vcs<EOL><DEDENT>no_prefix = '<STR_LIT>'.join(repo_url.split("<STR_LIT>")[<NUM_LIT:1>:])<EOL>vcs = identify_vcs_vs_alias(no_prefix, guess=guess, repo_aliases=repo_aliases)<EOL>if vcs:<EOL><INDENT>return vcs<EOL><DEDENT>if guess:<EOL><INDENT>if "<STR_LIT>" in repo_url:<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT><DEDENT>raise UnknownVCS<EOL>
Determines the type of repo that `repo_url` represents.
:param repo_url: Repo URL of unknown type.
:returns: VCS type (git, hg, etc) or raises UnknownVCS exception.