Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/lib/python/mercurial/httprepo.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�
�c@sddklZlZlZddklZddkZddkZddkZddk	Z	ddk
Z
ddkZddkZddk
Z
ddkZddkZddkZddkZddkZddkZd�Zdeifd��YZdefd��YZd	�ZdS(
i�(tbinthextnullid(t_Nccsuti�}y,x%ti|�D]}|i|�VqWWn+tij
otdt	d���nX|i
�VdS(Nsconnection ended unexpectedly(tzlibt
decompressobjtutilt
filechunkitert
decompressthttplibt
HTTPExceptiontIOErrortNoneRtflush(tftzdtchunk((s%/sys/lib/python/mercurial/httprepo.pyt
zgeneratorsthttprepositorycBs�eZd�Zd�Zd�Zd�Zee�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�ZRS(c	Cs�||_d|_d|_ti|�\}}}}}|p|o$titd�|p|��nt	i
|�\|_}||_|ii
td�|i�t	i||�|_dS(Nsunsupported URL component: "%s"s	using %s
(tpathRtcapsthandlerturlparseturlsplitRtAbortRturltgetauthinfot_urltuitdebugtopenert	urlopener(	tselfRRtschemetnetlocturlpathtquerytfragtauthinfo((s%/sys/lib/python/mercurial/httprepo.pyt__init__s				cCsCx<|iiD].}|i�t|d�o|i�q
q
WdS(Nt	close_all(RthandlerstclosethasattrR((R th((s%/sys/lib/python/mercurial/httprepo.pyt__del__*s


cCs|iS(N(R(R ((s%/sys/lib/python/mercurial/httprepo.pyR0scCs�|idjo{y"t|id�i��|_Wn"tij
ot�|_nX|iit	d�di
|ipdg��n|iS(Ntcapabilitiesscapabilities: %s
t tnone(RRtsettdo_readtsplitterrort	RepoErrorRRRtjoin(R ((s%/sys/lib/python/mercurial/httprepo.pytget_caps5s""cCstitd���dS(Ns!operation not supported over http(RRR(R ((s%/sys/lib/python/mercurial/httprepo.pytlockAscKsx|idd�}|idh�}|iitd�|�h|d<}|i|�dti|�}d|i|f}yP|o$|iitd�t	|��n|i
iti
|||��}Wn�tij
o5}	|	idjotitd	���n�nvtij
o?}	|iitd
�|�|ii�td|	��n)tj
otitd���nX|i�}
|
i|�o|
t	|� }
n|i|
jo'|iitd�|
�|
|_ny|id
�}Wn tj
o|id
}nXti|i�}|id�p|id�p
|id�p@|iitd�ti|��t i!td�|��n|id�o�yP|i"dd�d}
t#g}|
i"d�D]}|t$|�q��}Wn2t%j
o&t i!td�||f��nX|djo#t i!td�||
f��qtn|S(Ntdatatheadersssending %s command
tcmds?%ss%s%sssending %s bytes
i�sauthorization faileds$http error while sending %s command
s,http error, possibly caused by proxy settingsreal URL is %s
scontent-typesapplication/mercurial-s
text/plainsapplication/hg-changegroupsrequested URL: '%s'
s+'%s' does not appear to be an hg repositoryt-it.s+'%s' sent a broken Content-Type header (%s)is'%s' uses newer protocol %s(ii(&tpopRRRRtupdateturllibt	urlencodeRtlenRtopenturllib2tRequestt	HTTPErrortcodeRRR	R
t	tracebackRt
IndexErrortgeturltendswithtstatust	getheadertAttributeErrorR:Rthidepasswordt
startswithR4R5R3ttupletintt
ValueError(R R;targsR9R:tqtqstcutresptinsttresp_urltprototsafeurltversiont_[1]tntversion_info((s%/sys/lib/python/mercurial/httprepo.pytdo_cmdDsb
$%

#:
cKs2|i||�}z|i�SWd|i�XdS(N(RatreadR*(R R;RTtfp((s%/sys/lib/python/mercurial/httprepo.pyR2}scCs{|idtd��|idd|�i�}|d idd�\}}t|�ot|�Snti|��dS(Ntlookupslook up remote revisiontkeyi�R/i(	t
requirecapRRaRbR3RRRR4R5(R RetdtsuccessR9((s%/sys/lib/python/mercurial/httprepo.pyRd�s
cCsS|id�}ytt|d id��SWntitd�|��nXdS(Ntheadsi�R/sunexpected response:(R2tmapRR3R4t
ResponseErrorR(R Rg((s%/sys/lib/python/mercurial/httprepo.pyRi�s
c
Cs�|id�}y|h}xk|i�D]]}|id�}ti|d�}g}|dD]}|t|�q\~}|||<q%W|SWntitd�|��nXdS(Nt	branchmapR/iisunexpected response:(	R2t
splitlinesR3R@tunquoteRR4RkR(R RgRlt
branchparttbranchheadst
branchnameR^tx((s%/sys/lib/python/mercurial/httprepo.pyRl�s
+cCs�ditt|��}|idd|�}yGg}|i�D]%}|ttt|id���qA~}|SWnti	t
d�|��nXdS(NR/tbranchestnodessunexpected response:(R6RjRR2RmRQRR3R4RkR(R RtR_RgR^tbtbr((s%/sys/lib/python/mercurial/httprepo.pyRs�s?cCsd}g}x�dt|�|�D]�}dig}||||!D]}|ditt|��qG~�}|idd|�}yO|g}	|i�D]-}
|	|
ott|
id��pgq�~	7}Wq%t	i
td�|��q%Xq%W|S(NiiR/R<tbetweentpairssunexpected response:(txrangeRBR6RjRR2RmRR3R4RkR(R RxtbatchtrtiR^tpR_Rgt_[2]tl((s%/sys/lib/python/mercurial/httprepo.pyRw�sGO cCs@ditt|��}|idd|�}tit|��S(NR/tchangegrouptroots(R6RjRRaRtchunkbufferR(R RttkindR_R((s%/sys/lib/python/mercurial/httprepo.pyR��sc

Cs�|idtd��dig}|D]}|t|�q'~�}dig}|D]}|t|�qW~�}|idd|d|�}	tit|	��S(Ntchangegroupsubsetslook up remote changesR/tbasesRi(RfRR6RRaRR�R(
R R�RitsourceR^R_tbaselstR~theadlstR((s%/sys/lib/python/mercurial/httprepo.pyR��s
00cCs�d}|id�}y|id�}Wntj
odg}nX|o0x-|D]!}|tijo|}PqUqUWnti|d|�}ti|d�}zy�|i	dd|dhdd<d	d
i
tt|���}	|	idd�\}
}yt
|
�}Wn-tj
o!}
titd
�|	��nX|ii|�|SWnitij
oZ}
|
dtitifjo!titd�|
d��nti|
d��nXWd|i�ti|�XdS(Nttunbundlet,trbR9R:sapplication/octet-streamsContent-TypeRiR/s
is"push failed (unexpected response):ispush failed: %s(tcapableR3RNR�tbundletypestwritebundleRRthttpsendfileR2R6RjRRRRSR4RkRRtwritetsocketterrnot
ECONNRESETtEPIPERRR*tostunlink(R tcgRiR�ttypettypesRrttempnameRcRXt	resp_codetoutputtretterr((s%/sys/lib/python/mercurial/httprepo.pyR��sD
!
cCs
|id�S(Nt
stream_out(Ra(R ((s%/sys/lib/python/mercurial/httprepo.pyR��s(t__name__t
__module__R'R-RR7tpropertyR.R8RaR2RdRiRlRsRwR�R�R�R�(((s%/sys/lib/python/mercurial/httprepo.pyRs"				
		9				
						*thttpsrepositorycBseZd�ZRS(cCs:tiptitd���nti|||�dS(Ns1Python support for SSL and HTTPS is not installed(Rt	has_httpsRRRRR'(R RR((s%/sys/lib/python/mercurial/httprepo.pyR'�s
(R�R�R'(((s%/sys/lib/python/mercurial/httprepo.pyR��scCs�|otitd���nyP|id�ot||�}nt||�}|ittfg�|SWn:ti	j
o+|i
d�ti|d||�SnXdS(Ns!cannot create new http repositoryshttps:s(falling back to static-http)
sstatic-(
RRRRPR�RRwRR4R5tnotetstatichttprepotinstance(RRtcreateRY((s%/sys/lib/python/mercurial/httprepo.pyR��s
(tnodeRRRti18nRtrepoR�R�R4RRR�R@RDRRR	R�R�Rt
repositoryRR�R�(((s%/sys/lib/python/mercurial/httprepo.pys<module>	sHH		�

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.