Your IP : 3.145.61.142


Current Path : /opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__pycache__/subversion.cpython-33.pyc

�
7�Re�)c@sddlZddlZddlmZddlmZddlmZmZm	Z	ddl
mZddl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<url>(.*)</url>cs�|EeZdZdZdZdZd&ZdZd	Zd
d�Z	dd
�Z
dd�Zdd�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
dt|��t	jd	|�|d
fS||jd
�fS(u/Returns (url, revision), where both are stringsu/uBad directory: %suinfoushow_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|jdd�Wdtjd8_XdS(u@Export the svn repository at the url to the destination locationu!Exporting svn repository %s to %siuexportu
filter_stdoutushow_stdoutNF(
uget_url_revuget_rev_optionsuloggerunotifyuindentuosupathuexistsurmtreeucall_subprocessucmdu_filteruFalse(uselfulocationuurlurevurev_options((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuexport8s
uSubversion.exportcCs%t|jdg|||g�dS(Nuswitch(ucall_subprocessucmd(uselfudestuurlurev_options((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuswitchIsuSubversion.switchcCs"t|jdg||g�dS(Nuupdate(ucall_subprocessucmd(uselfudesturev_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(uget_url_revuget_rev_optionsucheck_destinationuloggerunotifyudisplay_pathucall_subprocessucmd(uselfudestuurlurevurev_optionsurev_display((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuobtainQs
	uSubversion.obtaincCs�x�|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�<qn|j|j�tjj||jd�}tjj|�s�qn|j|�\}}||kr�|d}	n-|s�|j|	�r�g|dd�<qnt	||�}qW|S(uR
        Return the maximum revision for all files under a given location
        iNuentriesu/(
uosuwalkudirnameuremoveupathujoinuexistsu_get_svn_url_revu
startswithumax(
uselfulocationurevisionubaseudirsufilesu
entries_fnudirurlulocalrevubase_url((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuget_revisionls"
uSubversion.get_revisioncsAtt|�j�\}}|jd�r7d|}n||fS(Nussh://usvn+(usuperu
Subversionuget_url_revu
startswith(uselfuurlurev(u	__class__(u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuget_url_rev�s
uSubversion.get_url_revcCsx|}x^tjjtjj|d��sf|}tjj|�}||kr	tjd|�dSq	W|j|�dS(Nusetup.pyuGCould not find setup.py for directory %s (tried all parent directories)i(	uosupathuexistsujoinudirnameuloggeruwarnuNoneu_get_svn_url_rev(uselfulocationu
orig_locationu
last_location((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyuget_url�s$	uSubversion.get_urlc

Cs�ddlm}ttjj||jd��}|j�}|j�|j	d�st|j	d�st|j	d�r�t
ttj
|jd���}|dd=|dd}d	d
�|D�dg}n�|j	d�r7tj|�}|std|��n|jd
�}dd
�tj|�D�dg}n{yYt|jdd|gdd�}tj|�jd
�}dd
�tj|�D�}Wn|k
r�dg}}YnX|r�t|�}	nd}	||	fS(Ni(uInstallationErroruentriesu8u9u10u

icSs<g|]2}t|�dkr|drt|d��qS(i	(ulenuint(u.0ud((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyu
<listcomp>�s	u/Subversion._get_svn_url_rev.<locals>.<listcomp>u<?xmluBadly formatted data: %ricSs%g|]}t|jd���qS(i(uintugroup(u.0um((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyu
<listcomp>�s	uinfou--xmlushow_stdoutcSs%g|]}t|jd���qS(i(uintugroup(u.0um((u+/tmp/pip-zej_zi-build/pip/vcs/subversion.pyu
<listcomp>�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_rev�s2!
-!&! 
uSubversion._get_svn_url_revcCs�t|jdd|gdd�}g}xV|j�D]H}|j�}t|d�}|djd�}|j||f�q4W|S(	Nulsu-vushow_stdoutiiu/Fi����(ucall_subprocessucmduFalseu
splitlinesusplituintustripuappend(uselfusvn_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_nameuschemesubundle_fileuguideuget_infouparse_vcs_bundle_fileuexportuswitchuupdateuobtainuget_locationuget_revisionuget_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(uurlurevurev_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.pyu<module>s�

?>