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/largefiles/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

�]Lb>�@s�ddlmZddlZddlmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZddlmZejZejZdZe	�	�Zd	d
�Zdd�Zd
d�Zdd�Ze�ed�dd��Zdd�ZdS)�)�absolute_importN)�_)�open)�error�	exthelper�httppeer�util�wireprototypes�wireprotov1peer�wireprotov1server�)�lfutilsa
This repository uses the largefiles extension.

Please enable it in your Mercurial config file.
cCsT|����}t�||�}t�tj�|��tj||j	j
d�}zkz-|��D]}|�|�q#|j
�d�|t�|j
�kr@tdtd���|��t�||�Wn7ty�}z+|j�td�||jf�t�d|ri|��nd�WYd}~W|��Wd�Sd}~wwW|��n|��wWd�n1s�wYt�d|r�|���Sd�S)zcServer command for putting a largefile into a repository's local store
    and into the user cache.)�
createmoders$largefile contents do not match hashs,largefiles: failed to put %s into store: %s
r�N)�mayberedirectstdior
�	storepathr�makedirs�os�path�dirname�atomictempfile�storer�
getpayload�write�_fp�seek�hexsha1�IOErrorr�close�linktousercache�ui�warn�strerrorr	�pushres�getvalue�discard)�repo�proto�sha�outputr�tmpfp�p�e�r-�8/usr/lib/python3/dist-packages/hgext/largefiles/proto.py�putlfile$s:
�����
�
�r/csZt�||�}|st�td�|��t|d��t�����d���fdd�}t	j
|�d�S)z\Server command for retrieving a largefile from the repository-local
    cache or user cache.s+requested largefile %s not present in cachesrb�c3s&�d�Vt���D]}|VqdS)Ns%d
)r�
filechunkiter)�chunk��f�lengthr-r.�	generatorRs
�
�zgetlfile.<locals>.generator)�gen)r
�findfiler�Abortrrr�fstat�filenor	�streamreslegacy)r&r'r(�filenamer6r-r3r.�getlfileBs
�
r>cCs$t�||�}|s
t�d�St�d�S)a;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
)r
r8r	�
bytesresponse)r&r'r(r=r-r-r.�	statlfileZs

r@cs&|j�G�fdd�d|j�}||_dS)NcsDeZdZ�fdd�Zejdd��Zdd�Zdd�Zejd	d
��Z	dS)z+wirereposetup.<locals>.lfileswirerepositorycs6��}|�d�r|j�G�fdd�d|j�}||_|S)Ns
largefilescseZdZ�fdd�ZdS)zWwirereposetup.<locals>.lfileswirerepository.commandexecutor.<locals>.lfscommandexecutorcs|dkrd}�||�S)Nsheadsslheadsr-)�self�command�args��orig_callcommandr-r.�callcommandqs
zcwirereposetup.<locals>.lfileswirerepository.commandexecutor.<locals>.lfscommandexecutor.callcommandN)�__name__�
__module__�__qualname__rFr-rDr-r.�lfscommandexecutorpsrJ)�capablerF�	__class__)rA�executorrJ��orig_commandexecutorrDr.�commandexecutorks
z;wirereposetup.<locals>.lfileswirerepository.commandexecutorcSs|j�|�S)N)�heads�	batchable)rAr-r-r.�lheadsysz2wirereposetup.<locals>.lfileswirerepository.lheadscSs�t|jtj�rE|jd||ddid�}z|�dd�\}}|�d�D]}|j�td�|�q t	|�WSt
yD|j�td	�|�YdSwz|jd||d
�\}}|dkr\t�
td�|��t	|�WStyjYdSt
yxt�
td
�|��w)Nsputlfilezcontent-typezapplication/mercurial-0.1)�datar(�headers�
rTsremote: s!unexpected putlfile response: %r
�r(rsputlfile failed:s&putlfile failed (unexpected response):)�
issubclassrLr�_call�split�
splitlinesr r!r�int�
ValueError�	_callpushr�
ResponseErrorr)rAr(�fd�res�dr)�l�retr-r-r.r/}s<�
��
��z4wirereposetup.<locals>.lfileswirerepository.putlfilec	ss��|jd|d�}|��}zt|�}Wnty&|�t�td�|��Ynwtj	||d�D]}|Vq.t
|jtj�rO|�
d�}|rQ|�t�td�|��dSdSdS)z<returns an iterable with the chunks of the file with sha shasgetlfilerWsunexpected response:)�limitrN)�_callstream�readliner\r]�_abortrr_rrr1rXrLr�read)rAr(�streamr5r2r-r-r.r>�s(���
��z4wirereposetup.<locals>.lfileswirerepository.getlfilecSsdd�}d|i}||fS)Nc	Ss&zt|�WSttjfyYdSw)N�)r\r]�urlerr�	httperror)rbr-r-r.�decode�s

�zEwirereposetup.<locals>.lfileswirerepository.statlfile.<locals>.decodesshar-)rAr(rn�resultr-r-r.r@�s
z5wirereposetup.<locals>.lfileswirerepository.statlfileN)
rGrHrIrPr
rRrSr/r>r@r-rNr-r.�lfileswirerepositoryjs
%rp)rPrL)r r&rpr-rNr.�
wirereposetupgs
^rqs
_capabilitiescCs|||�}|�d�|S)z$announce largefile server capabilityslargefiles=serve)�append)�origr&r'�capsr-r-r.�
_capabilities�s

rucCst�|�r
t�t�S|||�S)zTWrap server command - largefile capable clients will know to call
    lheads instead)r
�islfilesrepor	�ooberror�LARGEFILES_REQUIRED_MSG)rsr&r'r-r-r.rQ�s


rQ)�
__future__rr�mercurial.i18nr�mercurial.pycompatr�	mercurialrrrrr	r
r�r
rl�urlreqrx�ehr/r>r@rq�wrapfunctionrurQr-r-r-r.�<module>s$$
�
e


https://t.me/RX1948 - 2025