ó `8(Zc@@sķddlmZddlZddlZddlZddlmZmZddlm Z m Z ddl m Z ddl mZejeƒZde fd„ƒYZe jeƒdS( i(tabsolute_importN(t display_pathtrmtree(tvcstVersionControl(t path_to_url(t configparsert MercurialcB@sqeZdZdZdZdZd„Zd„Zd „Zd „Z d „Z d „Z d „Z d„Z d„ZRS(thgs.hgtcloneshg+httpshg+httpsshg+sshshg+static-httpcC@sTtjddƒ}|j|ƒz#|jd|gdtd|ƒWdt|ƒXdS(s?Export the Hg repository at the url to the destination locations-exportspip-tarchivet show_stdouttcwdN(ttempfiletmkdtemptunpackt run_commandtFalseR(tselftlocationttemp_dir((s./tmp/pip-build-0nEYGB/pip/pip/vcs/mercurial.pytexports  cC@sÃtjj||jdƒ}tjƒ}yI|j|ƒ|jdd|ƒt|dƒ}|j |ƒWdQXWn/t tj fk rĄ}t j d||ƒnX|jddg|d|ƒdS( Nthgrctpathstdefaulttws/Could not switch Mercurial repository to %s: %stupdates-qR (tostpathtjointdirnameRtSafeConfigParsertreadtsettopentwritetOSErrortNoSectionErrortloggertwarningR(Rtdestturlt rev_optionst repo_configtconfigt config_filetexc((s./tmp/pip-build-0nEYGB/pip/pip/vcs/mercurial.pytswitch s  cC@s:|jddgd|ƒ|jddg|d|ƒdS(Ntpulls-qR R(R(RR(R*((s./tmp/pip-build-0nEYGB/pip/pip/vcs/mercurial.pyR/scC@sŪ|jƒ\}}|r.|g}d|}n g}d}|j||||ƒrŠtjd||t|ƒƒ|jddd||gƒ|jddg|d|ƒndS( Ns (to revision %s)tsCloning hg %s%s to %sR s --noupdates-qRR (t get_url_revtcheck_destinationR&tinfoRR(RR(R)trevR*t rev_display((s./tmp/pip-build-0nEYGB/pip/pip/vcs/mercurial.pytobtain3s   cC@sO|jddgdtd|ƒjƒ}|j|ƒrEt|ƒ}n|jƒS(Nt showconfigs paths.defaultR R (RRtstript_is_local_repositoryR(RRR)((s./tmp/pip-build-0nEYGB/pip/pip/vcs/mercurial.pytget_urlEs  cC@s+|jddgdtd|ƒjƒ}|S(Ntparentss--template={rev}R R (RRR9(RRtcurrent_revision((s./tmp/pip-build-0nEYGB/pip/pip/vcs/mercurial.pyt get_revisionMs cC@s+|jddgdtd|ƒjƒ}|S(NR<s--template={node}R R (RRR9(RRtcurrent_rev_hash((s./tmp/pip-build-0nEYGB/pip/pip/vcs/mercurial.pytget_revision_hashSs cC@sw|j|ƒ}|jƒjdƒs1d|}n|jƒjddƒd}|sWdS|j|ƒ}d|||fS(Nshg:shg+t-iis %s@%s#egg=%s(R;tlowert startswithtegg_nametsplittNoneR@(RtdistRtrepotegg_project_nameR?((s./tmp/pip-build-0nEYGB/pip/pip/vcs/mercurial.pytget_src_requirementYs cC@stS(s&Always assume the versions don't match(R(RR(R*((s./tmp/pip-build-0nEYGB/pip/pip/vcs/mercurial.pyt check_versioncs(shgshg+httpshg+httpsshg+sshshg+static-http(t__name__t __module__tnameRt repo_nametschemesRR/RR7R;R>R@RJRK(((s./tmp/pip-build-0nEYGB/pip/pip/vcs/mercurial.pyRs       (t __future__RtloggingRR t pip.utilsRRtpip.vcsRRt pip.downloadRtpip._vendor.six.movesRt getLoggerRLR&Rtregister(((s./tmp/pip-build-0nEYGB/pip/pip/vcs/mercurial.pyts   W