ž 7’Re)c@sddlZddlZddlmZddlmZddlmZmZm Z ddl m Z ddl m Z mZejdƒZejdƒZejd ƒZejd ƒZejd ƒZejd ƒZGd d„deƒZdd„Ze jeƒdS(iN(uurlparse(uLink(urmtreeu display_pathucall_subprocess(ulogger(uvcsuVersionControlu url="([^"]+)"ucommitted-rev="(\d+)"u URL: (.+)uRevision: (.+)u\s*revision="(\d+)"u(.*)csé|EeZdZdZdZdZd&ZdZd Zd d „Z d d „Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Z‡fdd†Zdd„Zdd„Zd d!„Zd"d#„Zd'd$d%„Z‡S((u Subversionusvnu.svnucheckoutusvn+sshusvn+httpu svn+httpsusvn+svnusvn-checkout.txtug# This was an svn checkout; to make it a checkout again run: svn checkout --force -r %(rev)s %(url)s . cCs|jdƒj|jƒ s,td|ƒ‚t|jd|gdd didd6ƒ}tj|ƒ}|s˜t j dt |ƒƒt j d |ƒdS|jd ƒjƒ}tj|ƒ}|sôt j d t |ƒƒt j d |ƒ|d fS||jd ƒfS(u/Returns (url, revision), where both are stringsu/uBad directory: %suinfou show_stdoutu extra_environuCuLANGu'Cannot determine URL of svn checkout %su!Output that cannot be parsed: %siu,Cannot determine revision of svn checkout %sFN(NN(urstripuendswithudirnameuAssertionErrorucall_subprocessucmduFalseu _svn_url_reusearchuloggeruwarnu display_pathuinfouNoneugroupustripu_svn_revision_re(uselfulocationuoutputumatchuurl((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuget_infos,( uSubversion.get_infocCs¡xš|jƒD]Œ}|jƒ s |jƒjdƒr;q ntjd|ƒ}|sWdS|jdƒ}||jƒd…jƒjddƒd}||fSWdS(Nu#u ^-r\s*([^ ])?ii(NN(NN( u splitlinesustripu startswithureusearchuNoneugroupuendusplit(uselfucontentulineumatchurevurest((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuparse_vcs_bundle_file,s", u Subversion.parse_vcs_bundle_filec Cs±|jƒ\}}t||ƒ}tjd||fƒtjd7_zStjj|ƒrit|ƒnt |j dg|||gd|j ddƒWdtjd8_XdS(u@Export the svn repository at the url to the destination locationu!Exporting svn repository %s to %siuexportu filter_stdoutu show_stdoutNF( u get_url_revuget_rev_optionsuloggerunotifyuindentuosupathuexistsurmtreeucall_subprocessucmdu_filteruFalse(uselfulocationuurlurevu rev_options((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuexport8s uSubversion.exportcCs%t|jdg|||gƒdS(Nuswitch(ucall_subprocessucmd(uselfudestuurlu rev_options((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuswitchIsuSubversion.switchcCs"t|jdg||gƒdS(Nuupdate(ucall_subprocessucmd(uselfudestu rev_options((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuupdateMsuSubversion.updatecCs|jƒ\}}t||ƒ}|r4d|}nd}|j||||ƒr™tjd||t|ƒfƒt|jddg|||gƒndS(Nu (to revision %s)uuChecking out %s%s to %sucheckoutu-q(u get_url_revuget_rev_optionsucheck_destinationuloggerunotifyu display_pathucall_subprocessucmd(uselfudestuurlurevu rev_optionsu rev_display((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuobtainQs  uSubversion.obtaincCsx‰|D]}t|ƒj}|s(qnd|kr_dj|jdƒdd…ƒjƒ}n|}||jkr|jddƒdSqWdS(Nu-iu#iiÿÿÿÿ(uLinku egg_fragmentujoinusplitulowerukeyuNone(uselfudistudependency_linksuurlu egg_fragmentukey((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyu get_location^s  +uSubversion.get_locationc Csÿd}xòtj|ƒD]á\}}}|j|krJg|dd…§s u/Subversion._get_svn_url_rev..u­s uinfou--xmlu show_stdoutcSs%g|]}t|jdƒƒ‘qS(i(uintugroup(u.0um((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyu ³s F(upip.exceptionsuInstallationErroruopenuosupathujoinudirnameureaducloseu startswithulistumapustru splitlinesusplitu_svn_xml_url_reusearchu ValueErrorugroupu _svn_rev_reufinditerucall_subprocessucmduFalseu_svn_info_xml_url_reu_svn_info_xml_rev_reuNoneumax( uselfulocationuInstallationErrorufudatauurlurevsumatchuxmlurev((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyu_get_svn_url_revs2!  -! &!  uSubversion._get_svn_url_revcCs„t|jdd|gddƒ}g}xV|jƒD]H}|jƒ}t|dƒ}|djdƒ}|j||fƒq4W|S( Nulsu-vu show_stdoutiiu/Fiÿÿÿÿ(ucall_subprocessucmduFalseu splitlinesusplituintustripuappend(uselfu svn_tag_urlustdouturesultsulineupartsurevutag((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyu get_tag_revs¾s uSubversion.get_tag_revscCsZd}d}xG|D]?\}}||kr|dksC||kr|}|}qqW|S(N(uNone(uselfurevutag_revsubest_match_revubest_tagutagutag_rev((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyufind_tag_matchÉs  uSubversion.find_tag_matchc CsŒ|j|ƒ}|dkrdS|jdƒ}|jƒjddƒd}|j|ƒ}|ddkr€d||df}nû|ddkr°d |jƒ|d|f}nË|dd krZd |jƒ|f}|r{dj|dd…ƒd} |j| ƒ} |j|| ƒ} | rWtj d| ƒd| | f}d|| f}qWq{n!tj d|ƒd ||f}d|||fS(Nu/u-iiiutagsutagu%s-%subranchesubranchu %s-%s-r%sutrunku %s-dev_r%su/tagsu2trunk checkout %s seems to be equivalent to tag %su%s/%su?svn URL does not fit normal structure (tags/branches/trunk): %susvn+%s@%s#egg=%siþÿÿÿ(utagsutagiÿÿÿÿiþÿÿÿ(ubranchesubranchiÿÿÿÿiÿÿÿÿiÿÿÿÿ( uget_urluNoneusplituegg_nameu get_revisionujoinu get_tag_revsufind_tag_matchuloggerunotifyuwarn( uselfudistulocationu find_tagsurepoupartsuegg_project_nameurevu full_egg_nameutag_urlutag_revsumatch((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuget_src_requirementÕs.  uSubversion.get_src_requirement(usvnusvn+sshusvn+httpu svn+httpsusvn+svnF(u__name__u __module__u __qualname__unameudirnameu repo_nameuschemesu bundle_fileuguideuget_infouparse_vcs_bundle_fileuexportuswitchuupdateuobtainu get_locationu get_revisionu get_url_revuget_urlu_get_svn_url_revu get_tag_revsufind_tag_matchuFalseuget_src_requirement(u __locals__((u __class__u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyu Subversions(        ! u SubversioncCsñ|rd|g}ng}tj|ƒ}t|dƒrO|j|j}}nl|d}d|kr¯|jdƒd}d|krŸ|jddƒ\}}q»|d}}n d \}}|rÔ|d|g7}n|rí|d|g7}n|S( Nu-ruusernameiu@iu:u --usernameu --password(NN(uurlparseuurlsplituhasattruusernameupasswordusplituNone(uurlurevu rev_optionsuruusernameupasswordunetlocuauth((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuget_rev_optionsõs$    uget_rev_options(uosureupip.backwardcompatuurlparseu pip.indexuLinkupip.utilurmtreeu display_pathucall_subprocessupip.loguloggerupip.vcsuvcsuVersionControlucompileu_svn_xml_url_reu _svn_rev_reu _svn_url_reu_svn_revision_reu_svn_info_xml_rev_reu_svn_info_xml_url_reu Subversionuget_rev_optionsuregister(((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyus  ä