Your IP : 3.12.71.166


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__/mercurial.cpython-33.pyc

�
7�Re�c@s�ddlZddlZddlZddlZddlmZddlmZmZddlm	Z	ddl
mZmZddl
mZddlmZGdd	�d	e�Zeje�dS(
iN(ucall_subprocess(udisplay_pathurmtree(ulogger(uvcsuVersionControl(upath_to_url(uConfigParsercBs�|EeZdZdZdZdZd!ZdZd	Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd S("u	Mercurialuhgu.hgucloneuhg+httpuhg+httpsuhg+sshuhg+static-httpuhg-clone.txtug# This was a Mercurial repo; to make it a repo again run:
hg init
hg pull %(url)s
hg update -r %(rev)s
cCs�d}}x�|j�D]�}|j�s|j�jd�rEqntjd|�}|ru|jd�j�}ntjd|�}|r�|jd�j�}n|r|r||fSqWdS(Nu#uhg\s*pull\s*(.*)\s*iu^hg\s*update\s*-r\s*(.*)\s*(NN(uNoneu
splitlinesustripu
startswithureusearchugroup(uselfucontentuurlurevulineu	url_matchu	rev_match((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyuparse_vcs_bundle_files
"uMercurial.parse_vcs_bundle_filecCs`tjdd�}|j|�z/t|jd|gd|jddd|�Wdt|�XdS(	u?Export the Hg repository at the url to the destination locationu-exportupip-uarchiveu
filter_stdoutushow_stdoutucwdNF(utempfileumkdtempuunpackucall_subprocessucmdu_filteruFalseurmtree(uselfulocationutemp_dir((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyuexport%s
uMercurial.exportcCs�tjj||jd�}tj�}yJ|j|�|jdd|�t|d�}|j	|�|j
�WnBttjfk
r�t
j�d}tjd||f�Yn!Xt|jddg|d	|�dS(
Nuhgrcupathsudefaultuwiu/Could not switch Mercurial repository to %s: %suupdateu-qucwd(uosupathujoinudirnameuConfigParseruSafeConfigParserureadusetuopenuwriteucloseuOSErroruNoSectionErrorusysuexc_infouloggeruwarnucall_subprocessucmd(uselfudestuurlurev_optionsurepo_configuconfiguconfig_fileue((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyuswitch0s

uMercurial.switchcCs@t|jddgd|�t|jddg|d|�dS(Nupullu-qucwduupdate(ucall_subprocessucmd(uselfudesturev_options((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyuupdateAsuMercurial.updatecCs�|j�\}}|r.|g}d|}ng}d}|j||||�r�tjd||t|�f�t|jddd||g�t|jddg|d|�ndS(	Nu (to revision %s)uuCloning hg %s%s to %sucloneu
--noupdateu-quupdateucwd(uget_url_revucheck_destinationuloggerunotifyudisplay_pathucall_subprocessucmd(uselfudestuurlurevurev_optionsurev_display((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyuobtainFs	
	uMercurial.obtaincCsRt|jddgddd|�j�}|j|�rHt|�}n|j�S(Nu
showconfigu
paths.defaultushow_stdoutucwdF(ucall_subprocessucmduFalseustripu_is_local_repositoryupath_to_url(uselfulocationuurl((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyuget_urlTsuMercurial.get_urlcCs�t|jdgddd|�}g}x{|j�D]m}tjd|�}|r4|jd�}|jd�}d|kr�|j|j�|j�f�q�q4q4Wt	|�S(	Nutagsushow_stdoutucwdu([\w\d\.-]+)\s*([\d]+):.*$iiutipF(
ucall_subprocessucmduFalseu
splitlinesureusearchugroupuappendustripudict(uselfulocationutagsutag_revsulineu
tags_matchutagurev((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyuget_tag_revs\s)uMercurial.get_tag_revscCs�t|jdgddd|�}g}x{|j�D]m}tjd|�}|r4|jd�}|jd�}d|kr�|j|j�|j�f�q�q4q4Wt	|�S(	Nubranchesushow_stdoutucwdu([\w\d\.-]+)\s*([\d]+):.*$iiudefaultF(
ucall_subprocessucmduFalseu
splitlinesureusearchugroupuappendustripudict(uselfulocationubranchesubranch_revsulineubranches_matchubranchurev((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyuget_branch_revsis)uMercurial.get_branch_revscCs.t|jddgddd|�j�}|S(Nuparentsu--template={rev}ushow_stdoutucwdF(ucall_subprocessucmduFalseustrip(uselfulocationucurrent_revision((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyuget_revisionvsuMercurial.get_revisioncCs.t|jddgddd|�j�}|S(Nuparentsu--template={node}ushow_stdoutucwdF(ucall_subprocessucmduFalseustrip(uselfulocationucurrent_rev_hash((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyuget_revision_hash|suMercurial.get_revision_hashcCs�|j|�}|j�jd�s1d|}n|j�jdd�d}|sWdS|j|�}|j|�}|j|�}|j	|�}	||kr�d|||f}
n-||	kr�d||	|f}
n
d|}
d|||
fS(	Nuhg:uhg+u-iiu%s-%su%s-devu%s@%s#egg=%s(
uget_urluloweru
startswithuegg_nameusplituNoneuget_revisionuget_revision_hashuget_tag_revsuget_branch_revs(uselfudistulocationu	find_tagsurepouegg_project_nameucurrent_revucurrent_rev_hashutag_revsubranch_revsu
full_egg_name((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyuget_src_requirement�s 

uMercurial.get_src_requirementN(uhguhg+httpuhg+httpsuhg+sshuhg+static-http(u__name__u
__module__u__qualname__unameudirnameu	repo_nameuschemesubundle_fileuguideuparse_vcs_bundle_fileuexportuswitchuupdateuobtainuget_urluget_tag_revsuget_branch_revsuget_revisionuget_revision_hashuget_src_requirement(u
__locals__((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyu	Mercurial
s"

u	Mercurial(uosutempfileureusysupip.utilucall_subprocessudisplay_pathurmtreeupip.loguloggerupip.vcsuvcsuVersionControlupip.downloadupath_to_urlupip.backwardcompatuConfigParseru	Mercurialuregister(((u*/tmp/pip-zej_zi-build/pip/vcs/mercurial.pyu<module>s�

?>