HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //lib64/python2.7/site-packages/hgext/largefiles/proto.pyo
�
1�3\c@@s�ddlmZddlZddlZddlmZddlmZmZm	Z	m
Z
mZddlm
Z
e	jZe	jZdZdZdZd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zejd�Zd�ZdS(i(tabsolute_importN(t_(terrorthttppeertutiltwireprototypestwireprotov1peeri(tlfutilsa
This repository uses the largefiles extension.

Please enable it in your Mercurial config file.
c	C@si|j��9}tj||�}tjtjj|��tj|d|j	j
�}z�y�x!|j�D]}|j|�qhW|j
jd�|tj|j
�kr�tdtd���n|j�tj||�WnUtk
r1}|jjtd�||jf�tjd|r*|j�nd�SXWd|j�XWdQXtjd|rb|j�nd�S(scServer command for putting a largefile into a repository's local store
    and into the user cache.t
createmodeis$largefile contents do not match hashs,largefiles: failed to put %s into store: %s
itN(tmayberedirectstdioRt	storepathRtmakedirstostpathtdirnametatomictempfiletstoreRt
getpayloadtwritet_fptseekthexsha1tIOErrorRtclosetlinktousercachetuitwarntstrerrorRtpushrestgetvaluetdiscard(trepotprototshatoutputRttmpfptpte((s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pytputlfile#s(
!c@s�tj||�}|s4tjtd�|��nt|d��tj�j��d���fd�}t	j
d|��S(s\Server command for retrieving a largefile from the repository-local
    cache or user cache.s+requested largefile %s not present in cachetrbic3@s,d�Vxtj��D]}|VqWdS(Ns%d
(Rt
filechunkiter(tchunk(tftlength(s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pyt	generatorLs	tgen(RtfindfileRtAbortRtopenR
tfstattfilenoRtstreamreslegacy(R R!R"tfilenameR-((R+R,s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pytgetlfile=s
cC@s2tj||�}|s%tjd�Stjd�S(s;Server command for checking if a largefile is present - returns '2
' if
    the largefile is missing, '0
' if it seems to be in good condition.

    The value 1 is reserved for mismatched checksum, but that is too expensive
    to be verified on every stat and must be caught be running 'hg verify'
    server side.s2
s0
(RR/Rt
bytesresponse(R R!R"R5((s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pyt	statlfileRs
cC@s&d|jfd��Y}||_dS(NtlfileswirerepositorycB@s,eZd�Zd�Zejd��ZRS(c
S@s\t|jtj�r�|jdd|d|didd6�}yY|jdd�\}}x0|jt�D]}|jjt	d	�|�qhWt
|�SWqXtk
r�|jjt	d
�|�dSXn�yS|jd|d|�\}}|dkrt
jt	d�|��nt
|�SWn:tk
r/dStk
rWt
jt	d
�|��nXdS(NR'tdataR"theaderssapplication/mercurial-0.1scontent-types
isremote: s!unexpected putlfile response: %r
R	sputlfile failed:s&putlfile failed (unexpected response):(t
issubclasst	__class__Rt_calltsplitt
splitlinestTrueRRRtintt
ValueErrort	_callpushRt
ResponseErrorR(tselfR"tfdtrestdR#tltret((s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pyR'`s,


cs@s�|jdd|�}|j�}yt|�}Wn0tk
rc|jtjtd�|��nXx"tj	|d|�D]}|VqzWt
|jtj�r�|j
d�}|r�|jtjtd�|��q�ndS(s<returns an iterable with the chunks of the file with sha shaR6R"sunexpected response:tlimitiN(t_callstreamtreadlineRBRCt_abortRRERRR)R<R=Rtread(RFR"tstreamR,R*((s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pyR6s
	cs@s\tj�}i|d6}||fVyt|j�VWnttjfk
rWdVnXdS(NR"i(RtfutureRBtvalueRCturlerrt	httperror(RFR"R+tresult((s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pyR8�s
(t__name__t
__module__R'R6Rt	batchableR8(((s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pyR9_s		(R=(RR R9((s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pyt
wirereposetup^sCcC@s |||�}|jd�|S(s$announce largefile server capabilityslargefiles=serve(tappend(torigR R!tcaps((s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pyt
_capabilities�s
cC@s)tj|�rtjt�S|||�S(sTWrap server command - largefile capable clients will know to call
    lheads instead(RtislfilesrepoRtooberrortLARGEFILES_REQUIRED_MSG(R\R R!((s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pytheads�s
cK@sl|dkr$|jd�r$d}n|dkr\|jd�r\|djdd�|d<nt|||�S(NRbt
largefilestlheadstbatchtcmdssheads slheads (tcapabletreplacetssholdcallstream(RFtcmdtargs((s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pytsshrepocallstream�s
	s(^|;)heads\bcK@sl|dkr$|jd�r$d}n|dkr\|jd�r\tjd|d�|d<nt|||�S(NRbRcRdReRf(Rgtheadsretsubthttpoldcallstream(RFRjRk((s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pythttprepocallstream�s
	(t
__future__RR
tretmercurial.i18nRt	mercurialRRRRRR	RRTturlreqRatNoneRiRoR'R6R8RZR^RbRltcompileRmRp(((s</usr/lib64/python2.7/site-packages/hgext/largefiles/proto.pyt<module>s&(						G