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__/remotestore.cpython-310.pyc
o

�]Lb{�@svdZddlmZddlmZddlmZmZmZddl	m
Z
mZddlm
Z
mZmZejZejZGdd	�d	e
j
�Zd
S)z4remote largefile store; the base class for wirestore�)�absolute_import)�_)�error�pycompat�util)�
stringutil�urlutil�)�	basestore�lfutil�
localstorecsheZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
�ZS)�remotestorez)a largefile store accessed over a networkcs@tt|��|||�d|_|durt�|j|j|j�|_dSdS)N)�superr
�__init__�_lstorer�ui�repo)�selfrr�url��	__class__��>/usr/lib/python3/dist-packages/hgext/largefiles/remotestore.pyr$s
�zremotestore.__init__cCsN|�||�rt�td�|t�|j�f��|j�td�|t�|j�f�dS)Ns0remotestore: could not put %s to remote store %ss'remotestore: put %s to remote store %s
)	�sendfiler�Abortrr�hidepasswordrr�debug)r�source�hashrrr�put*s����zremotestore.putcCsdd�t�|�|��D�S)NcSsi|]	\}}||dk�qS)rr)�.0�h�srrr�
<dictcomp>6s��z&remotestore.exists.<locals>.<dictcomp>)r�	iteritems�_stat�r�hashesrrr�exists5s
��zremotestore.existsc
Cs�|j�d||f�z!t�|j|��}|�||�Wd�WS1s$wYWdStyE}zt�td�|t	�
|�f��d}~ww)Nsremotestore: sendfile(%s, %s)
s'remotestore: could not open file %s: %s)rrr�httpsendfile�_put�IOErrorrrrr�forcebytestr)r�filenamer�fd�errrr=s
(�����zremotestore.sendfilecCs�z|�|�}WnJtjy }zt�|||jt�|���d}~wtjy:}zt	�
dt�|j�|j
f��d}~wtyQ}zt�|||jt�|���d}~wwt�||�S)Ns%s: %s)�_get�urlerr�	httperrorr
�
StoreErrorrrr,�urlerrorrrrr�reasonr+r�copyandhash)r�tmpfiler-r�chunksr/rrr�_getfileHs&�������zremotestore._getfilecs"|j�|���fdd�|D�}|S)Ncsg|]}�|r|�qSrr)r r��existslocallymaprr�
<listcomp>asz7remotestore._hashesavailablelocally.<locals>.<listcomp>)rr()rr'�localhashesrr:r�_hashesavailablelocally_sz#remotestore._hashesavailablelocallycs�d}dd�|D�}|�|��|��fdd�|D��}|D]M\}}}|�vr7|||f}	|j�||	g�}
|
r6d}q||}|ri|dkrP|j�td�||f�d}q|dkrc|j�td	�||f�d}qtd
|��q|S)NFcSsg|]\}}}|�qSrr)r �csetr-�expectedhashrrrr<fs
�z,remotestore._verifyfiles.<locals>.<listcomp>csg|]}|�vr|�qSrr)r r@�r=rrr<ks
�Tr	s"changeset %s: %s: contents differ
�schangeset %s: %s missing
s6verify failed: unexpected response from statlfile (%r))r>r%r�_verifyfilesr�warnr�RuntimeError)r�contents�filestocheck�failed�expectedhashes�statsr?r-r@�filetocheck�verifyresult�statrrArrCdsP�

��
��������zremotestore._verifyfilescC�td��)z1Put file with the given hash in the remote store.�abstract method��NotImplementedError)rrr.rrrr*��zremotestore._putcCrN)z/Get a iterator for content with the given hash.rOrP)rrrrrr0�rRzremotestore._getcCrN)z�Get information about availability of files specified by
        hashes in the remote store. Return dictionary mapping hashes
        to return code where 0 means that file is available, other
        values if not.rOrPr&rrrr%�szremotestore._stat)�__name__�
__module__�__qualname__�__doc__rrr(rr9r>rCr*r0r%�
__classcell__rrrrr
!s+r
N)rV�
__future__r�mercurial.i18nr�	mercurialrrr�mercurial.utilsrr�r
rrr1�urlreqr
rrrr�<module>s

https://t.me/RX1948 - 2025