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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

�]Lb�3�@s�ddlmZddlZddlmZmZddlmZddlm	Z	m
Z
mZddlm
Z
mZmZGdd	�d	e�ZGd
d�de
j�ZGdd
�d
e
j
�ZGdd�de�ZGdd�de�ZdS)�)�absolute_importN)�hex�sha1nodeconstants)�getattr)�mdiff�pycompat�revlog�)�	basestore�	constants�shallowutilc@s$eZdZdZdZdZdZdZdZdS)�
ChainIndiciesz>A static class for easy reference to the delta chain indicies.rr	���N)	�__name__�
__module__�__qualname__�__doc__�NAME�NODE�BASENAME�BASENODE�DATA�rr�B/usr/lib/python3/dist-packages/hgext/remotefilelog/contentstore.pyr
sr
cs�eZdZ�fdd�Zdd�Zejjdd��Zdd�Z	ejjd	d
��Z
dd�Zejjd
d��Zdd�Z
dd�Zdd�Zddd�Z�ZS)�unioncontentstorecs:tt|�j|i|��||_|�d�|_|�dd�|_dS)N�
writestore�allowincompleteF)�superr�__init__�stores�getrr��self�args�kwargs��	__class__rrr )szunioncontentstore.__init__cCsj|�||�}|dtjtjkrt|t|�f��|��tj}|}|r3|��tj}t	�
||g�}|s#|S)aFetches the full text revision contents of the given name+node pair.
        If the full text doesn't exist, throws a KeyError.

        Under the hood, this uses getdeltachain() across all the stores to build
        up a full chain to produce the full text.
        ���)�
getdeltachainr
rr�nullid�KeyErrorr�poprr�patches)r$�name�node�chain�fulltext�text�deltarrrr"4s�zunioncontentstore.getc	C�@|jD]}z	|�||�WStyYqwt|t|�f��)z;Return the single delta entry for the given name/node pair.)r!�getdeltar,r�r$r/r0�storerrrr6Ls
�zunioncontentstore.getdeltacCs�|�||�}|dtjtjkr?|d\}}}}}z
|�||�}|�|�Wnty4|js1�Y|Sw|dtjtjks|S)a
Returns the deltachain for the given name/node pair.

        Returns an ordered list of:

          [(name, node, deltabasename, deltabasenode, deltacontent),...]

        where the chain is terminated by a full text entry with a nullid
        deltabasenode.
        r))�_getpartialchainr
rrr+�extendr,r)r$r/r0r1�x�
deltabasename�
deltabasenode�	morechainrrrr*Ws
��zunioncontentstore.getdeltachainc	Cr5)z)Returns the metadata dict for given node.)r!�getmetar,rr7rrrr?os
�zunioncontentstore.getmetacCsdd�|jD�}tj|�S)NcSsg|]}|���qSr)�
getmetrics)�.0�srrr�
<listcomp>zsz0unioncontentstore.getmetrics.<locals>.<listcomp>)r!r�sumdicts)r$�metricsrrrr@ys
zunioncontentstore.getmetricsc	Cr5)z�Returns a partial delta chain for the given name/node pair.

        A partial chain is a chain that may not be terminated in a full-text.
        )r!r*r,rr7rrrr9}s
�z"unioncontentstore._getpartialchaincC�td���Ns5cannot add content only to remotefilelog contentstore��RuntimeError�r$r/r0�datarrr�add���zunioncontentstore.addcCs"|}|jD]	}|r|�|�}q|S�N)r!�
getmissing)r$�keys�missingr8rrrrO�s

�zunioncontentstore.getmissingcCs"|jr
|j�|||�dStd��)Nsno writable store configured)r�addremotefilelognoderIrJrrrrR�sz&unioncontentstore.addremotefilelognodeNcCs|jD]}|�||�qdSrN)r!�
markledger)r$�ledger�optionsr8rrrrS�s
�zunioncontentstore.markledgerrN)rrrr r"r
�baseunionstore�	retriabler6r*r?r@r9rLrOrRrS�
__classcell__rrr'rr(s


	

rcsTeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
�ZS)�remotefilelogcontentstorecs$tt|�j|i|��t��|_dSrN)rrYr �	threading�local�_threaddatar#r'rrr �sz"remotefilelogcontentstore.__init__cCs�|�||�}t�|�\}}}||||�}t�|�}||\}	}
}}d}
|r+t|	�}
|�|||�|tj@r;d}
}t�|||
�}|SrN)	�_getdatar�parsesizeflags�ancestormapr�_updatemetacacher�REVIDX_EXTSTORED�createrevlogtext)r$r/r0rK�offset�size�flags�contentr_�p1�p2�linknode�copyfrom�copyrev�revisionrrrr"�s

zremotefilelogcontentstore.getcCs"|�||�}||tj|�||�fSrN)r"rr+r?�r$r/r0rlrrrr6�s
�z"remotefilelogcontentstore.getdeltacC�|�||�}||dtj|fgSrN�r"rr+rmrrrr*��z'remotefilelogcontentstore.getdeltachaincCsN|��||jjdkr!|�||�}t�|�\}}}|�|||�|jjdS�Nrr	)�_sanitizemetacacher\�	metacacher]rr^r`)r$r/r0rKrcrdrerrrr?�sz!remotefilelogcontentstore.getmetacCrFrGrHrJrrrrL�rMzremotefilelogcontentstore.addcCs&t|jdd�}|durd|j_dSdS)Nrs)NN)rr\rs)r$rsrrrrr�s�z,remotefilelogcontentstore._sanitizemetacachecCs<|��||jjdkrdStj|tj|i}||f|j_dS)Nr)rrr\rsr�METAKEYFLAG�METAKEYSIZE)r$r0rdre�metarrrr`�s
z*remotefilelogcontentstore._updatemetacache)rrrr r"r6r*r?rLrrr`rXrrr'rrY�srYc@sNeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	ddd�Z
dS)�remotecontentstorecCs||_||_dSrN)�_fileservice�_shared)r$�ui�fileservice�sharedrrrr �s
zremotecontentstore.__init__cC�*|jj|t|�fgddd�|j�||�S�NT)�force�	fetchdata)rx�prefetchrryr"�r$r/r0rrrr"���zremotecontentstore.getcCs$|�||�}||tj|j�||�fSrN)r"rr+ryr?rmrrrr6�s�zremotecontentstore.getdeltacCrnrNrormrrrr*�rpz remotecontentstore.getdeltachaincCr}r~)rxr�rryr?r�rrrr?r�zremotecontentstore.getmetacCrF)Nscannot add to a remote storerHrJrrrrL
�zremotecontentstore.addcCs|SrNr)r$rPrrrrO�zremotecontentstore.getmissingNcC�dSrNr)r$rTrUrrrrSr�zremotecontentstore.markledgerrN)rrrr r"r6r*r?rLrOrSrrrrrw�s	rwc@sxeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zddd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
ddd�Zdd�ZdS)�manifestrevlogstorecCs4|j|_|j|_t�|_tj|jdd�|_d|_dS)Ns
00changelog.i��radixr)	r8�_store�svfs�_svfs�dict�_revlogsr�_cl�_repackstartlinkrev)r$�reporrrr s

zmanifestrevlogstore.__init__cCs|�|��|�SrN)�_revlog�rawdatar�rrrr"szmanifestrevlogstore.getcCs$|�||�}|||jj|�||�fSrN)r"r�r+r?rmrrrr6"szmanifestrevlogstore.getdeltacCs |�||�}||d|jj|fgSrN)r"r�r+rmrrrr*&sz!manifestrevlogstore.getdeltachaincCs0|�|�}|�|�}tj|�|�tj|�|�iSrN)r��revrrtreru�rawsize)r$r/r0�rlr�rrrr?*s


�zmanifestrevlogstore.getmetaNcCs�|durt�}||vr
gS|�|�}i}|h}|j|�|�gdd�D]J}|�|�}|�|�|�|�\}	}
|	|jjkrD|	|vrD|�	|	�|
|jjkrS|
|vrS|�	|
�|j�|�
|��}|	|
|df||�|�<|sl|Sq"|S)NT)�	inclusive�)�setr��	ancestorsr�r0�discard�parentsr�r+rL�linkrev)r$r/r0�knownr�r�rQ�ancrev�ancnodergrhrirrr�getancestors2s,




�z manifestrevlogstore.getancestorscCsD|j}|�|�}|�|�}|�|�|��}|d|d|�|�dfSrq)r�r�r�r�r�r0)r$r/r0�clr�r�r�rrr�getnodeinfoKs


zmanifestrevlogstore.getnodeinfocGrF)Nscannot add to a revlog storerH)r$r%rrrrLRr�zmanifestrevlogstore.addcCsF|j�|�}|dur!d}|dkrd|}tj|j|d�}||j|<|S)N�00manifesttreer�smeta/%s/00manifestr�)r�r"rr�)r$r/r��
revlognamerrrr�Us
zmanifestrevlogstore._revlogcCs8g}|D]\}}|�|�}||jvr|�||f�q|SrN)r��nodemap�append)r$rPrQr/r0�mfrevlogrrrrO_s

�zmanifestrevlogstore.getmissingcCs||_||_dSrN)r��_repackendlinkrev)r$�startrev�endrevrrr�setrepacklinkrevrangehs
z)manifestrevlogstore.setrepacklinkrevrangec
Cs^|r
|�tj�r
dSd}tj|jdd�}|j}|j}t�t	|�ddd�D]%}|�
|�}||kr2n||kr7q%|�|�}	|�|||	�|�
|||	�q%|j��D]\\}
}}|dd�dkse|dd�d	krfqP|dt	d
��}tj|j|dd�d�}t�t	|�ddd�D]%}|�
|�}||kr�n||kr�q�|�|�}	|�|||	�|�
|||	�q�qPdS)Nr�r�r�r	r)�smeta/���s.is/00manifest)�	indexfile)r"r�OPTION_PACKSONLYrr�r�r�r�xrange�lenr�r0�
markdataentry�markhistoryentryr��	datafiles)
r$rTrU�treenamer��startlinkrev�
endlinkrevr�r�r0�t�pathrdrrrrSls>

 

��zmanifestrevlogstore.markledgercCr�rNr)r$rTrrr�cleanup�r�zmanifestrevlogstore.cleanuprN)rrrr r"r6r*r?r�r�rLr�rOr�rSr�rrrrr�s

	
"r�)�
__future__rrZ�mercurial.noderr�mercurial.pycompatr�	mercurialrrr�r
rr�objectr
rVrrYrwr�rrrr�<module>szH-

https://t.me/RX1948 - 2025