ó œ0{Yc@sddlZddlZddlmZddlmZddlmZmZm Z ddl m Z ddl m Z mZejdƒZejdƒZejd ƒZejd ƒZejd ƒZejd ƒZd efd„ƒYZd„Ze jeƒdS(iÿÿÿÿN(turlparse(tLink(trmtreet display_pathtcall_subprocess(tlogger(tvcstVersionControls url="([^"]+)"scommitted-rev="(\d+)"s URL: (.+)sRevision: (.+)s\s*revision="(\d+)"s(.*)t SubversioncBs­eZdZdZdZdZdZdZd „Zd „Z d „Z d „Z d „Z d„Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zed„ZRS(tsvns.svntcheckoutssvn+sshssvn+https svn+httpsssvn+svnssvn-checkout.txtsg# This was an svn checkout; to make it a checkout again run: svn checkout --force -r %(rev)s %(url)s . cCsÛt|jd|gdtdidd6ƒ}tj|ƒ}|sltjdt|ƒƒtjd|ƒd S|j dƒj ƒ}t j|ƒ}|sÈtjd t|ƒƒtjd|ƒ|d fS||j dƒfS( s/Returns (url, revision), where both are stringstinfot show_stdoutt extra_environtCtLANGs'Cannot determine URL of svn checkout %ss!Output that cannot be parsed: %sis,Cannot determine revision of svn checkout %sN(NN( RtcmdtFalset _svn_url_retsearchRtwarnRR tNonetgrouptstript_svn_revision_re(tselftlocationtoutputtmatchturl((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pytget_infos( cCs›x”|jƒD]†}|jƒ s |jƒjdƒr;q ntjd|ƒ}|sWdS|jdƒ}||jƒjƒjddƒd}||fSWdS(Nt#s ^-r\s*([^ ])?ii(NN(NN( t splitlinesRt startswithtreRRRtendtsplit(RtcontenttlineRtrevtrest((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pytparse_vcs_bundle_file,s"& cCs±|jƒ\}}t||ƒ}tjd||fƒtjd7_zStjj|ƒrit|ƒnt |j dg|||gd|j dt ƒWdtjd8_XdS(s@Export the svn repository at the url to the destination locations!Exporting svn repository %s to %sitexportt filter_stdoutR N( t get_url_revtget_rev_optionsRtnotifytindenttostpathtexistsRRRt_filterR(RRRR't rev_options((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pyR*8s cCs%t|jdg|||gƒdS(Ntswitch(RR(RtdestRR4((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pyR5IscCs"t|jdg||gƒdS(Ntupdate(RR(RR6R4((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pyR7MscCs|jƒ\}}t||ƒ}|r4d|}nd}|j||||ƒr™tjd||t|ƒfƒt|jddg|||gƒndS(Ns (to revision %s)tsChecking out %s%s to %sR s-q(R,R-tcheck_destinationRR.RRR(RR6RR'R4t rev_display((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pytobtainQs  cCsŠxƒ|D]{}t|ƒj}|s(qnd|krYdj|jdƒd ƒjƒ}n|}||jkr|jddƒdSqWdS(Nt-iÿÿÿÿRii(Rt egg_fragmenttjoinR$tlowertkeyR(Rtdisttdependency_linksRR=R@((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pyt get_location^s  %c Csíd}xàtj|ƒD]Ï\}}}|j|krAg|(qn|j|jƒtjj||jdƒ}tjj|ƒs„qn|j|ƒ\}}||kr²|d} n$| sÉ|j| ƒ rÖg|(qnt ||ƒ}qW|S(sR Return the maximum revision for all files under a given location itentriest/( R0twalktdirnametremoveR1R>R2t_get_svn_url_revR!tmax( RRtrevisiontbasetdirstfilest entries_fntdirurltlocalrevtbase_url((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pyt get_revisionls"  cCsAtt|ƒjƒ\}}|jdƒr7d|}n||fS(Nsssh://ssvn+(tsuperRR,R!(RRR'((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pyR,‡s cCsx|}x^tjjtjj|dƒƒsf|}tjj|ƒ}||kr tjd|ƒdSq W|j|ƒdS(Nssetup.pysGCould not find setup.py for directory %s (tried all parent directories)i( R0R1R2R>RGRRRRI(RRt orig_locationt last_location((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pytget_urlŽs$  c Cs,ddlm}ttjj||jdƒƒ}|jƒ}|jƒ|j dƒst|j dƒst|j dƒr÷t t t j |jdƒƒƒ}|dd=|dd }g|D]2}t|ƒd krµ|d rµt|d ƒ^qµdg}n|j d ƒrxtj|ƒ}|s.td |ƒ‚n|jd ƒ}gtj|ƒD]} t| jd ƒƒ^qMdg}nynt|jdd|gdtƒ} tj| ƒjd ƒ}gtj| ƒD]} t| jd ƒƒ^qÄ}Wn|k rdg}}nX|rt|ƒ} nd} || fS(Niÿÿÿÿ(tInstallationErrorRDt8t9t10s iii sRGtreadtcloseR!tlisttmaptstrR R$tlentintt_svn_xml_url_reRt ValueErrorRt _svn_rev_retfinditerRRRt_svn_info_xml_url_ret_svn_info_xml_rev_reRRJ( RRRXtftdataRtdtrevsRtmtxmlR'((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pyRIs2!  -! I;!5 cCs„t|jdd|gdtƒ}g}xV|jƒD]H}|jƒ}t|dƒ}|djdƒ}|j||fƒq4W|S(Ntlss-vR iiÿÿÿÿRE(RRRR R$RdRtappend(Rt svn_tag_urltstdouttresultsR&tpartsR'ttag((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pyt get_tag_revs¾s cCsZd}d}xG|D]?\}}||kr|dksC||kr|}|}qqW|S(N(R(RR'ttag_revstbest_match_revtbest_tagRwttag_rev((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pytfind_tag_matchÉs  c Cs†|j|ƒ}|dkrdS|jdƒ}|jƒjddƒd}|j|ƒ}|ddkr€d||d f}nõ|ddkr°d |jƒ|d |f}nÅ|d d krTd|jƒ|f}|rudj|d ƒd} |j| ƒ} |j|| ƒ} | rQtj d| ƒd| | f}d|| f}qQqun!tj d|ƒd||f}d|||fS(NRER<iiiþÿÿÿttagsRws%s-%siÿÿÿÿtbranchestbranchs %s-%s-r%sttrunks %s-dev_r%ss/tagss2trunk checkout %s seems to be equivalent to tag %ss%s/%ss?svn URL does not fit normal structure (tags/branches/trunk): %sssvn+%s@%s#egg=%s(R~stag(Rsbranch( RWRR$tegg_nameRSR>RxR}RR.R( RRARt find_tagstrepoRvtegg_project_nameR't full_egg_namettag_urlRyR((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pytget_src_requirementÕs.  (R ssvn+sshssvn+https svn+httpsssvn+svn(t__name__t __module__tnameRGt repo_nametschemest bundle_filetguideRR)R*R5R7R;RCRSR,RWRIRxR}RRˆ(((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pyRs(         ! cCsñ|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( Ns-rtusernameit@it:s --usernames --password(NN(RturlsplitthasattrRtpasswordR$R(RR'R4trRR•tnetloctauth((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pyR-õs$    (R0R"tpip.backwardcompatRt pip.indexRtpip.utilRRRtpip.logRtpip.vcsRRtcompileReRgRRRjRiRR-tregister(((sC/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/subversion.pyts  ä