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: //proc/thread-self/root/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyo
�
1�3\c@@s�ddlmZddlZddlZddlmZddlmZmZm	Z	m
Z
mZmZddl
mZd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zejd��Zddd�Zd�Zd�Zd�ZdS(i(tabsolute_importN(t_(terrort
extensionsthgtutiltwireprotov1peertwireprotov1serveri(tcontextcC@s4|jdd�}|s0tjtd���n|S(s)get the mainbranch, and enforce it is settfastannotatet
mainbranchsFfastannotate.mainbranch is required for both the client and the server(tconfigRtAbortR(tuitmaster((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyt
_getmasterscC@s |||�}|jd�|S(Ntgetannotate(tappend(torigtrepotprototresult((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyt
_capabilities#s
c
C@s�d}|jjddt�}tj||��U}|r�t|j�}zzy&|j|�sp|j||�nWnMtk
r�|j	�y|j||�Wq�tk
r�|j	�q�XnXWd|j
�Xn|j|kr�x�|j|j
gD]�}tjj|�sq�nd}	t|d��}
|
j�}	WdQXt|jjd�}||}|d|t|	�|	f7}q�WnWdQX|S(NtR	tserverbuildondemandtrbt/s%s%d%s(R
t
configbooltTrueRtannotatecontextRt
isuptodatetannotatet	Exceptiontrebuildtclosetlastnodet
revmappathtlinelogpathtostpathtexiststopentreadtlentvfstbase(
RRR'R#Rt
buildondemandtactxRtptcontenttft
vfsbaselentrelpath((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyt_getannotate(s8	



*cC@s-dtjkrdStjdd�t�dS(NRs
path lastnode(RtcommandstwireprotocommandR5(((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyt_registerwireprotocommandRscC@st�tjtdt�dS(NR(R8RtwrapfunctionRR(R
((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyt
serveruisetupXscC@s�i}d}t|�d}d}d}}x�||kr�||}|dkr�|dkr�t||dt|��||<|t|�7}d}d}}q�|dkr�d}q�n2|dkr�||7}n|dkr�||7}n|d7}q/W|S(NiiRs(R+tbuffertint(tpayloadRtitltstatetvfspathtsizetch((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyt_parseresponse^s*

 


c@s,d|jf�fd��Y}||_dS(Ntfastannotatepeerc@s#eZejd�fd��ZRS(c3@sm|jd�s*�jtd��dVn?i|d6|p=dd6}tj�}||fVt|j�VdS(NRs*remote peer cannot provide annotate cache
R'RR#(NN(tcapabletwarnRtNoneRtfutureRDtvalue(tselfR'R#targsR2(R
(sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyRxsN(t__name__t
__module__Rt	batchableRHR((R
(sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyREws(t	__class__(R
tpeerRE((R
sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyt	peersetupvscc@sW|j}|j|jddd��}tj|i|�}z	|VWd|j�XdS(NR	t
remotepathtdefault(R
t
expandpathRRRQR"(RR
RSRQ((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pytannotatepeer�s		c

C@s�|s
dS|dkrAt|��}t||||�SWdQXn|dkrVi}n|j}g}|j��W}|jdt|��x>|D]6}|j|jdi|d6|j	|�d6��q�Wx�|D]�}|j
�}	d�|	j�D�}	x�t|	�D]�}
|
j
d�s.d|
d	krE|jd
|
�qn|	|
}|jrx|jdt|�|
f�n|jjtjj|
��|j|
d��}|j|�WdQXqWq�WWdQXdS(
s1download annotate cache from the server for pathsNs"fastannotate: requesting %d files
RR'R#cS@s(i|]\}}|tj|��qS((Rtpconvert(t.0R0tv((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pys
<dictcomp>�s	s
fastannotate/s/../Rs(fastannotate: ignored malicious path %s
s%fastannotate: writing %d bytes to %s
twb(RHRVtclientfetchR
tcommandexecutortdebugR+RtcallcommandtgetRt	iteritemstsortedt
startswitht	debugflagR,tmakedirsR&R'tdirnametwrite(
RtpathstlastnodemapRQR
tresultstbatcherR0RtrR'R1R2((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyR[�s<		
%

		cC@s�|jjddd�}|dkr(|Sg}x^|D]V}y/t|j|��|kri|j|�nWq5tk
r�|j|�q5Xq5W|S(s�return a subset of paths whose history is long and need to fetch linelog
    from the server. works with remotefilelog and non-remotefilelog repos.
    R	tclientfetchthresholdi
i(R
t	configintR+tfileRR (RRgt	thresholdRR'((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyt_filterfetchpaths�s

cC@s&d|jfd��Y}||_dS(NtfastannotaterepocB@seZdd�ZRS(c		S@s�t|j�}g}i}y�xdt||�D]S}tj||��9}|j|dt�s{|j|�|j||<nWdQXq.W|r�t	||||�nWn't
k
r�}|jjd|�nXdS(Ntstricts"fastannotate: prefetch failed: %r
(RR
RpRRRtFalseRR#R[R R](	RKRgRQRtneedupdatepathsRhR'R/tex((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pytprefetchfastannotate�s
N(RMRNRHRv(((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyRq�s(RP(R
RRq((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pytlocalreposetup�scC@sIt�|j�r#t||�nttjkrEtjjt�ndS(N(R8tlocalRwRRRtwirepeersetupfuncsR(R
R((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pytclientreposetup�s
(t
__future__Rt
contextlibR&tmercurial.i18nRt	mercurialRRRRRRRRRRR5R8R:RDRRtcontextmanagerRVRHR[RpRwRz(((sA/usr/lib64/python2.7/site-packages/hgext/fastannotate/protocol.pyt<module>s".	
		*				
'