@classmethod<EOL><INDENT>def get_url_and_revision_from_pip_url(cls, pip_url):<DEDENT>
error_message = (<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL>assert '<STR_LIT:+>' in pip_url, error_message % pip_url<EOL>url = pip_url.split('<STR_LIT:+>', <NUM_LIT:1>)[<NUM_LIT:1>]<EOL>scheme, netloc, path, query, frag = urlparse.urlsplit(url)<EOL>rev = None<EOL>if '<STR_LIT:@>' in path:<EOL><INDENT>path, rev = path.rsplit('<STR_LIT:@>', <NUM_LIT:1>)<EOL><DEDENT>url = urlparse.urlunsplit((scheme, netloc, path, query, '<STR_LIT>'))<EOL>return url, rev<EOL>
Return repo URL and revision by parsing :attr:`~.url`.