def identify_repo(repo_url):
 repo_url_values = repo_url.split(u'+')
 if (len(repo_url_values) == 2):
  repo_type = repo_url_values[0]
  if (repo_type in [u'git', u'hg']):
   return (repo_type, repo_url_values[1])
  else:
   raise UnknownRepoType
 elif (u'git' in repo_url):
  return (u'git', repo_url)
 elif (u'bitbucket' in repo_url):
  return (u'hg', repo_url)
 else:
  raise UnknownRepoType

def identify_repo ( repo_url ) : repo_url_values = repo_url . split ( u'+' ) if ( len ( repo_url_values ) == 2 ) : repo_type = repo_url_values [ 0 ] if ( repo_type in [ u'git' , u'hg' ] ) : return ( repo_type , repo_url_values [ 1 ] ) else : raise UnknownRepoType elif ( u'git' in repo_url ) : return ( u'git' , repo_url ) elif ( u'bitbucket' in repo_url ) : return ( u'hg' , repo_url ) else : raise UnknownRepoType
determine if repo_url should be treated as a url to a git or hg repo .