Viewing File: /usr/lib/python3.6/site-packages/pip/vcs/__pycache__/mercurial.cpython-36.opt-1.pyc

3

aj
@sddlmZddlZddlZddlZddlmZmZddlm	Z	m
Z
ddlmZddl
mZejeZGddde
Ze	jedS)	)absolute_importN)display_pathrmtree)vcsVersionControl)path_to_url)configparserc@sdeZdZdZdZdZdZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ddZddZdS)	Mercurialhgz.hgclonehg+httphg+httpshg+sshhg+static-httpcCs>tjdd}|j|z|jd|gd|dWdt|XdS)z?Export the Hg repository at the url to the destination locationz-exportzpip-archiveF)show_stdoutcwdN)tempfileZmkdtempunpackrun_commandr)selflocationZtemp_dirr/usr/lib/python3.6/mercurial.pyexports
zMercurial.exportcCstjj||jd}tj}y<|j||jdd|t|d}|j	|WdQRXWn6t
tjfk
r}ztj
d||WYdd}~XnX|jddg||ddS)	NZhgrcpathsdefaultwz/Could not switch Mercurial repository to %s: %supdatez-q)r)ospathjoindirnamerZSafeConfigParserreadsetopenwriteOSErrorZNoSectionErrorloggerZwarningr)rdesturlrev_optionsZrepo_configconfigZconfig_fileexcrrrswitch s
zMercurial.switchcCs,|jddg|d|jddg||ddS)NZpullz-q)rr)r)rr)r+rrrr/szMercurial.updatecCsz|j\}}|r |g}d|}ng}d}|j||||rvtjd||t||jddd||g|jddg||ddS)	Nz (to revision %s)zCloning hg %s%s to %srz
--noupdatez-qr)r)Zget_url_revZcheck_destinationr(inforr)rr)r*Zrevr+Zrev_displayrrrobtain3s

zMercurial.obtaincCs2|jddgd|dj}|j|r*t|}|jS)NZ
showconfigz
paths.defaultF)rr)rstripZ_is_local_repositoryr)rrr*rrrget_urlEs
zMercurial.get_urlcCs|jddgd|dj}|S)Nparentsz--template={rev}F)rr)rr2)rrZcurrent_revisionrrrget_revisionMszMercurial.get_revisioncCs|jddgd|dj}|S)Nr4z--template={node}F)rr)rr2)rrcurrent_rev_hashrrrget_revision_hashSszMercurial.get_revision_hashcCsT|j|}|jjds d|}|jjddd}|s<dS|j|}d|||fS)Nzhg:zhg+-rz%s@%s#egg=%s)r3lower
startswithZegg_namesplitr7)rZdistrZrepoZegg_project_namer6rrrget_src_requirementYs

zMercurial.get_src_requirementcCsdS)z&Always assume the versions don't matchFr)rr)r+rrr
check_versioncszMercurial.check_versionN)r
rr
rr)__name__
__module____qualname__namer"Z	repo_nameZschemesrr.rr1r3r5r7r=r>rrrrr	s

r	)Z
__future__rZloggingrrZ	pip.utilsrrZpip.vcsrrZpip.downloadrZpip._vendor.six.movesrZ	getLoggerr?r(r	registerrrrr<module>s
W
Back to Directory File Manager