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

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


�
�c@s:ddkZddkZddkZddkZddkZddkZddkZddklZl	Z	ddk
lZlZddkl
ZddklZlZlZlZdddd	d
ddd
ddg
ZdZd�Zd�Zd�Zd�Zd�Zd�Z
d�Zd�Zd�Zd�ZdS(i�N(tutiltstreamclone(tbinthex(tchangegroup(t
ErrorResponsetHTTP_OKtHTTP_NOT_FOUNDtHTTP_SERVER_ERRORtlookuptheadstbranchestbetweenRtchangegroupsubsettcapabilitiestunbundlet
stream_outt	branchmapsapplication/mercurial-0.1c	cs�y*t|i|idd��}d}Wn'tj
o}t|�}d}nXd||f}|ittdt|��|VdS(Ntkeyiis%s %s
tlength(	RR	tformt	ExceptiontstrtrespondRtHGTYPEtlen(trepotreqtrtsuccesstinsttresp((s+/sys/lib/python/mercurial/hgweb/protocol.pyR	s 
ccsGditt|i���d}|ittdt|��|VdS(Nt s
R(tjointmapRR
RRRR(RRR((s+/sys/lib/python/mercurial/hgweb/protocol.pyR
$s"ccs�|i�}g}xp|i�D]b\}}ti|�}g}|D]}|t|�qE~}	|id|di|	�f�qWdi|�}
|itt	dt
|
��|
VdS(Ns%s %sR s
R(Rt	iteritemsturllibtquoteRtappendR!RRRR(RRRR
tbranchtnodest
branchnamet_[1]tnodetbranchnodesR((s+/sys/lib/python/mercurial/hgweb/protocol.pyR)s
'$ccs�g}d|ijo'tt|iddid��}nti�}x:|i|�D])}|iditt	|��d�qYW|i
�}|itt
dt|��|VdS(NR(iR s
R(RR"Rtsplitt	cStringIOtStringIORtwriteR!RtgetvalueRRRR(RRR(Rtb((s+/sys/lib/python/mercurial/hgweb/protocol.pyR4s''c
cs�d|ijoKg}|iddid�D]}|tt|id��q/~}nti�}x:|i|�D])}|iditt	|��d�qwW|i
�}|itt
dt|��|VdS(NtpairsiR t-s
R(RR-R"RR.R/RR0R!RR1RRRR(RRR*tpR3RR2((s+/sys/lib/python/mercurial/hgweb/protocol.pyR?sD'ccs�|itt�g}d|ijo'tt|iddid��}nti�}|i	|d�}x,|i
d�}|pPn|i|�Vqn|i�VdS(NtrootsiR tservei(
RRRRR"RR-tzlibtcompressobjRtreadtcompresstflush(RRR(tztftchunk((s+/sys/lib/python/mercurial/hgweb/protocol.pyRJs'c
cs|itt�g}g}d|ijo?g}|iddid�D]}|t|�qK~}nd|ijo?g}|iddid�D]}|t|�q�~}nti�}|i||d�}x,|i	d�}	|	pPn|i
|	�Vq�|i�VdS(NtbasesiR R
R7i(RRRRR-RR8R9R
R:R;R<(
RRR@R
R*txt_[2]R=R>R?((s+/sys/lib/python/mercurial/hgweb/protocol.pyR
[s??ccs�dddg}|iidddt�o|id|ii�ntio!|idd	iti��nd
i|�}|i	t
tdt|��|VdS(NR	R
Rtservertuncompressedt	untrusteds	stream=%dsunbundle=%st,R R(
tuit
configbooltTrueR&t	changelogtversiontchangegroupmodtbundlepriorityR!RRRR(RRtcapstrsp((s+/sys/lib/python/mercurial/hgweb/protocol.pyRos
!cs�|iid�pd}|iddid����fd�}|�p|i�ttd��ntidd	�\}}t	i
|d
�}z�t|id�}x*ti
|d|�D]}|i|�q�Wy��i�}	z�|�pttd��n|id�|id
�}
|
id�o!|
id�otd��n!|
tijotd��nti|
|�}titif}ti�t_t_z�d|ti|iidd��ti|iidd��f}
y�i|d|
�}Wn2tij
o#}tiid|�d}nXWdtii �}|\t_t_X|i!tt"�d||ffSWd|	i#�XWn�tj
o}tt|��n�t$t%fj
o�}t&|dd�}|i�i'�o|t(�i'�d}nd}t&|dd�}|i)t)i*jo
t+}nt,}t|d||f��nXWd|i-�t	i.|�XdS(Nswsgi.url_schemethttpR
iR cs5tt�i��}�td�gjp
�|jS(Ntforce(R"RR
(R
(Rttheir_heads(s+/sys/lib/python/mercurial/hgweb/protocol.pytcheck_heads~ssunsynced changestprefixshg-unbundle-swb+tCONTENT_LENGTHtlimititHGtHG10sunknown bundle versionsunknown bundle compression typesremote:%s:%s:%stREMOTE_HOSTttREMOTE_USERR7s
abort: %s
s%d
%stfilenameitstrerrors
Unknown errors%s: %s(/tenvtgetRR-tdrainRRttempfiletmkstemptostfdopentintRt
filechunkiterR0tlocktseekR:t
startswitht
ValueErrorRLtbundletypesRtsyststdouttstderrR.R/R$R%taddchangegrouptAbortR1RRtreleasetOSErrortIOErrortgetattrtrootRterrnotENOENTRRtclosetunlink(RRtprotoRStfdttempnametfpRtsRgtheadertgentoldioturltretRtvalR\terrortcode((RRRs+/sys/lib/python/mercurial/hgweb/protocol.pyRysp



!"
"
ccsc|itt�y)x"ti|dt�D]}|Vq)WWn#tij
o}t|�VnXdS(NRE(RRRRRRItStreamExceptionR(RRR?R((s+/sys/lib/python/mercurial/hgweb/protocol.pyR�s
(R.R8RaRvRcRlR$t	mercurialRRtmercurial.nodeRRRRLtcommonRRRRt__all__RR	R
RRRR
RRR(((s+/sys/lib/python/mercurial/hgweb/protocol.pys<module>s$T"									
	O

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.