ó 9ÕÒTc@@s/ddlmZddlZddlZddlZddlmZddlm Z ddl m Z m Z m Z ddlmZddlmZmZejdƒZejd ƒZejd ƒZejd ƒZejd ƒZejd ƒZejeƒZdefd„ƒYZd„ZejeƒdS(i(tabsolute_importN(tparse(tLink(trmtreet display_pathtcall_subprocess(t indent_log(tvcstVersionControls url="([^"]+)"scommitted-rev="(\d+)"s URL: (.+)sRevision: (.+)s\s*revision="(\d+)"s(.*)t SubversioncB@s˜eZdZdZdZdZd„Zd„Zd „Zd „Z d „Z d „Z d „Z d„Z d„Zd„Zd„Zd„Zed„ZRS(tsvns.svntcheckoutssvn+sshssvn+https svn+httpsssvn+svncC@s|jdƒj|jƒ s,td|ƒ‚t|jd|gdtdidd6ƒ}tj|ƒ}|s–t j dt |ƒƒt j d |ƒd S|jd ƒjƒ}tj|ƒ}|sðt j d t |ƒƒt j d |ƒ|d fS||jd ƒfS(s/Returns (url, revision), where both are stringst/sBad directory: %stinfot 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(trstriptendswithtdirnametAssertionErrorRtcmdtFalset _svn_url_retsearchtloggertwarningRtdebugtNonetgrouptstript_svn_revision_re(tselftlocationtoutputtmatchturl((s8/usr/lib/python2.7/vendor-packages/pip/vcs/subversion.pytget_infos,    c C@s—|jƒ\}}t||ƒ}tjd||ƒtƒTtjj|ƒr]t|ƒnt |j dg|||gd|j dt ƒWdQXdS(s@Export the svn repository at the url to the destination locations!Exporting svn repository %s to %stexportt filter_stdoutRN( t get_url_revtget_rev_optionsRR RtostpathtexistsRRRt_filterR(R!R"R%trevt rev_options((s8/usr/lib/python2.7/vendor-packages/pip/vcs/subversion.pyR';s  cC@s%t|jdg|||gƒdS(Ntswitch(RR(R!tdestR%R0((s8/usr/lib/python2.7/vendor-packages/pip/vcs/subversion.pyR1IscC@s"t|jdg||gƒdS(Ntupdate(RR(R!R2R0((s8/usr/lib/python2.7/vendor-packages/pip/vcs/subversion.pyR3MscC@s™|jƒ\}}t||ƒ}|r4d|}nd}|j||||ƒr•tjd||t|ƒƒt|jddg|||gƒndS(Ns (to revision %s)tsChecking out %s%s to %sR s-q(R)R*tcheck_destinationRR RRR(R!R2R%R/R0t rev_display((s8/usr/lib/python2.7/vendor-packages/pip/vcs/subversion.pytobtainQs  cC@sŠxƒ|D]{}t|ƒj}|s(qnd|krYdj|jdƒd ƒjƒ}n|}||jkr|jddƒdSqWdS(Nt-iÿÿÿÿt#ii(Rt egg_fragmenttjointsplittlowertkeyR(R!tdisttdependency_linksR%R:R>((s8/usr/lib/python2.7/vendor-packages/pip/vcs/subversion.pyt get_locationbs  %c C@sí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 itentriesR ( R+twalkRtremoveR,R;R-t_get_svn_url_revt startswithtmax( R!R"trevisiontbasetdirstfilest entries_fntdirurltlocalrevtbase_url((s8/usr/lib/python2.7/vendor-packages/pip/vcs/subversion.pyt get_revisionps"  cC@sAtt|ƒjƒ\}}|jdƒr7d|}n||fS(Nsssh://ssvn+(tsuperR R)RF(R!R%R/((s8/usr/lib/python2.7/vendor-packages/pip/vcs/subversion.pyR)‹s cC@sw|}x]tjjtjj|dƒƒse|}tjj|ƒ}||kr tjd|ƒdSq W|j|ƒdS(Nssetup.pysGCould not find setup.py for directory %s (tried all parent directories)i( R+R,R-R;RRRRRE(R!R"t orig_locationt last_location((s8/usr/lib/python2.7/vendor-packages/pip/vcs/subversion.pytget_url’s$ c C@s+ddlm}ttjj||jdƒƒ}|jƒ}WdQX|jdƒss|jdƒss|jdƒröt t t j |j dƒƒƒ}|dd=|dd}g|D]2}t|ƒd kr´|d r´t|d ƒ^q´dg}n|jd ƒrwtj|ƒ}|s-td |ƒ‚n|jd ƒ}gtj|ƒD]} t| jd ƒƒ^qLdg}nynt|jd d|gdtƒ} tj| ƒjd ƒ}gtj| ƒD]} t| jd ƒƒ^qÃ}Wn|k rdg}}nX|rt|ƒ} nd} || fS(Ni(tInstallationErrorRBt8t9t10s ii ss$   ò