403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/hgext/remotefilelog/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/hgext/remotefilelog/__pycache__/contentstore.cpython-39.opt-1.pyc
a

�+�b�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__�NAMEZNODEZBASENAME�BASENODE�DATA�rr�F/usr/lib64/python3.9/site-packages/hgext/remotefilelog/contentstore.pyr
sr
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__cCsh|�||�}|dtjtjkr0t|t|�f��|��tj}|}|rd|��tj}t	�
||g�}qB|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�poprrZpatches)r"�name�node�chainZfulltext�textZdeltarrrr 4szunioncontentstore.getc	CsF|jD]*}z|�||�WSty.Yq0qt|t|�f��dS)z;Return the single delta entry for the given name/node pair.N)r�getdeltar*r�r"r,r-�storerrrr0Ls
zunioncontentstore.getdeltacCsr|�||�}|dtjtjkrn|d\}}}}}z|�||�}|�|�Wqtyj|jsb�YqnYq0q|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,r-r.�xZ
deltabasenameZ
deltabasenodeZ	morechainrrrr(Ws
zunioncontentstore.getdeltachainc	CsF|jD]*}z|�||�WSty.Yq0qt|t|�f��dS)z)Returns the metadata dict for given node.N)r�getmetar*rr1rrrr6os
zunioncontentstore.getmetacCsdd�|jD�}tj|�S)NcSsg|]}|���qSr)�
getmetrics)�.0�srrr�
<listcomp>z�z0unioncontentstore.getmetrics.<locals>.<listcomp>)rrZsumdicts)r"Zmetricsrrrr7yszunioncontentstore.getmetricsc	CsF|jD]*}z|�||�WSty.Yq0qt|t|�f��dS)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.
        N)rr(r*rr1rrrr3}s
z"unioncontentstore._getpartialchaincCstd��dS�Ns5cannot add content only to remotefilelog contentstore��RuntimeError�r"r,r-�datarrr�add�s�zunioncontentstore.addcCs"|}|jD]}|r
|�|�}q
|S�N)r�
getmissing)r"�keys�missingr2rrrrC�s

zunioncontentstore.getmissingcCs$|jr|j�|||�ntd��dS)Nsno writable store configured)r�addremotefilelognoder>r?rrrrF�sz&unioncontentstore.addremotefilelognodeNcCs|jD]}|�||�qdSrB)r�
markledger)r"�ledger�optionsr2rrrrG�s
zunioncontentstore.markledger)N)rrrrr r
�baseunionstoreZ	retriabler0r(r6r7r3rArCrFrG�
__classcell__rrr%rr(s


	

rcsTeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
�ZS)�remotefilelogcontentstorecs$tt|�j|i|��t��|_dSrB)rrLr�	threading�local�_threaddatar!r%rrr�sz"remotefilelogcontentstore.__init__cCs�|�||�}t�|�\}}}||||�}t�|�}||\}	}
}}d}
|rVt|	�}
|�|||�|tj@rvd}
}t�|||
�}|SrB)	�_getdatar�parsesizeflags�ancestormapr�_updatemetacacherZREVIDX_EXTSTOREDZcreaterevlogtext)r"r,r-r@�offset�size�flagsZcontentrR�p1�p2�linknodeZcopyfromZcopyrev�revisionrrrr �s

zremotefilelogcontentstore.getcCs"|�||�}||tj|�||�fSrB)r rr)r6�r"r,r-rZrrrr0�s
�z"remotefilelogcontentstore.getdeltacCs|�||�}||dtj|fgSrB�r rr)r[rrrr(�sz'remotefilelogcontentstore.getdeltachaincCsN|��||jjdkrB|�||�}t�|�\}}}|�|||�|jjdS�Nrr	)�_sanitizemetacacherO�	metacacherPrrQrS)r"r,r-r@rTrUrVrrrr6�sz!remotefilelogcontentstore.getmetacCstd��dSr<r=r?rrrrA�s�zremotefilelogcontentstore.addcCs"t|jdd�}|durd|j_dS)Nr_)NN)rrOr_)r"r_rrrr^�sz,remotefilelogcontentstore._sanitizemetacachecCs<|��||jjdkrdStj|tj|i}||f|j_dS)Nr)r^rOr_r�METAKEYFLAG�METAKEYSIZE)r"r-rUrV�metarrrrS�s
z*remotefilelogcontentstore._updatemetacache)rrrrr r0r(r6rAr^rSrKrrr%rrL�srLc@sNeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	ddd�Z
dS)�remotecontentstorecCs||_||_dSrB)�_fileservice�_shared)r"ZuiZfileserviceZsharedrrrr�szremotecontentstore.__init__cCs*|jj|t|�fgddd�|j�||�S�NT)�forceZ	fetchdata)rd�prefetchrrer �r"r,r-rrrr �s�zremotecontentstore.getcCs$|�||�}||tj|j�||�fSrB)r rr)rer6r[rrrr0�s�zremotecontentstore.getdeltacCs|�||�}||dtj|fgSrBr\r[rrrr(�sz remotecontentstore.getdeltachaincCs*|jj|t|�fgddd�|j�||�Srf)rdrhrrer6rirrrr6s�zremotecontentstore.getmetacCstd��dS)Nscannot add to a remote storer=r?rrrrA
szremotecontentstore.addcCs|SrBr)r"rDrrrrCszremotecontentstore.getmissingNcCsdSrBr)r"rHrIrrrrGszremotecontentstore.markledger)N)rrrrr r0r(r6rArCrGrrrrrc�s	rcc@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)	r2�_storeZsvfs�_svfs�dict�_revlogsr�_cl�_repackstartlinkrev)r"Zreporrrrs
zmanifestrevlogstore.__init__cCs|�|��|�SrB)�_revlogZrawdatarirrrr szmanifestrevlogstore.getcCs$|�||�}|||jj|�||�fSrB)r rqr)r6r[rrrr0"szmanifestrevlogstore.getdeltacCs |�||�}||d|jj|fgSrB)r rqr)r[rrrr(&sz!manifestrevlogstore.getdeltachaincCs0|�|�}|�|�}tj|�|�tj|�|�iSrB)rs�revrr`rVraZrawsize)r"r,r-�rlrtrrrr6*s


�zmanifestrevlogstore.getmetaNcCs�|durt�}||vrgS|�|�}i}|h}|j|�|�gdd�D]�}|�|�}|�|�|�|�\}	}
|	|jjkr�|	|vr�|�	|	�|
|jjkr�|
|vr�|�	|
�|j�|�
|��}|	|
|df||�|�<|sDq�qD|S)NT)Z	inclusiver;)�setrs�	ancestorsrtr-�discard�parentsrqr)rA�linkrev)r"r,r-ZknownrurwrEZancrevZancnoderWrXrYrrr�getancestors2s(




z manifestrevlogstore.getancestorscCsD|j}|�|�}|�|�}|�|�|��}|d|d|�|�dfSr])rqrsryrzrtr-)r"r,r-Zclruryrzrrr�getnodeinfoKs


zmanifestrevlogstore.getnodeinfocGstd��dS)Nscannot add to a revlog storer=)r"r#rrrrARszmanifestrevlogstore.addcCsF|j�|�}|durBd}|dkr(d|}tj|j|d�}||j|<|S)N�00manifesttreer;smeta/%s/00manifestrk)rpr rrn)r"r,ruZ
revlognamerrrrsUs
zmanifestrevlogstore._revlogcCs8g}|D]*\}}|�|�}||jvr|�||f�q|SrB)rsZnodemap�append)r"rDrEr,r-ZmfrevlogrrrrC_s

zmanifestrevlogstore.getmissingcCs||_||_dSrB)rr�_repackendlinkrev)r"ZstartrevZendrevrrr�setrepacklinkrevrangehsz)manifestrevlogstore.setrepacklinkrevrangec
Csf|r|�tj�rdSd}tj|jdd�}|j}|j}t�t	|�ddd�D]J}|�
|�}||krdq�||krnqJ|�|�}	|�|||	�|�
|||	�qJ|j��D]�\}
}}|dd�dks�|dd�d	kr�q�|dt	d
��}tj|j|dd�d�}t�t	|�ddd�D]R}|�
|�}||k�r(q�||k�r6�q|�|�}	|�|||	�|�
|||	��qq�dS)Nr;r}rkr	r'�smeta/���s.is/00manifest)Z	indexfile)r rZOPTION_PACKSONLYrrnrrrrZxrange�lenrzr-Z
markdataentryZmarkhistoryentryrmZ	datafiles)
r"rHrIZtreenameruZstartlinkrevZ
endlinkrevrtrzr-�t�pathrUrrrrGls:

 



zmanifestrevlogstore.markledgercCsdSrBr)r"rHrrr�cleanup�szmanifestrevlogstore.cleanup)N)N)rrrrr r0r(r6r{r|rArsrCr�rGr�rrrrrjs

	
"rj)Z
__future__rrMZmercurial.noderrZmercurial.pycompatrZ	mercurialrrr�r
rr�objectr
rJrrLrcrjrrrr�<module>szH-

Youez - 2016 - github.com/yon3zu
LinuXploit