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

�]Lb�=�@s�ddlmZddlZddlZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
ddlmZddlmZdd	lmZmZmZGd
d�de�ZGdd
�d
e�ZdS)�)�absolute_importN)�bin)�_)�ancestor�error�mdiff�pycompat�revlog)�storageutil)�flagutil�)�	constants�fileserverclient�shallowutilc@s$eZdZdd�Zdd�Zdd�ZdS)�remotefilelognodemapcCs||_||_dS�N)�	_filename�_store)�self�filename�store�r�C/usr/lib/python3/dist-packages/hgext/remotefilelog/remotefilelog.py�__init__!s
zremotefilelognodemap.__init__cCs|j�|j|fg�}t|�Sr)r�
getmissingr�bool)r�node�missingrrr�__contains__%s
z!remotefilelognodemap.__contains__cCs||vrt|��|Sr)�KeyError�rrrrr�__get__)szremotefilelognodemap.__get__N)�__name__�
__module__�__qualname__rrr!rrrrr src@sJeZdZdZejZdd�Zdd�ZdFdd�Z	d	d
�Z
ddejdfdd�Z
		dFd
d�Zdd�Zdd�ZeZdd�Zdd�ZeZdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z		'	'	'		dGd(d)�Zd*d+�Zd,d-�Zd.d/�Z d0d1�Z!dHd2d3�Z"d4d5�Z#d6d7�Z$d8d9�Z%d:d;�Z&d<d=�Z'd>d?�Z(d@dA�Z)dBdC�Z*dDdE�Z+dS)I�
remotefilelogTcCs8||_||_||_t|j|j�|_d|_ttj	�|_
dS)Nr)�openerr�repor�contentstore�nodemap�version�dictr�flagprocessors�_flagprocessors)rr&�pathr'rrrr4szremotefilelog.__init__cCs4|�|�}|�d�s|S|�dd�}||dd�S)z&returns the file contents at this nodes
�N)�revision�
startswith�index)rr�t�srrr�read>s


zremotefilelog.readNc	Cs>t�||�d�|�d��}t�|||�}|j||||||d�S)N�copy�copyrev)r)r�createrevlogtext�getr
�hashrevisionsha1�addrevision)	r�text�meta�transaction�linknode�p1�p2�hashtextrrrr�addFs��zremotefilelog.addcCs�t�t|�|�}d||f}	|}
d}|r"d|vr"|d}t|d�}
|	d||
|||f7}	t�}i}
g}|
|jjkrX|}|rFt|j||j�}|
�	|�
|
��|�|
�|�|
�||jjkrp|
�	|�
|��|�|�|�|�d}|r�|�
d�}|
|\}}}}|p�d}|d|||||f7}||jjkr�||vr�|�|�|�|�||jjkr�||vr�|�|�|�|�|st|	|7}	|	S)Ns%s%s�r6r7s%s%s%s%s%sr)r�buildfileblobheader�lenr�setr'�nullidr%r&�update�ancestormap�appendrC�pop)rr<r=�flagsr@rArr?�header�data�realp1�copyfrom�visited�
pancestors�queue�p1flog�ancestortext�c�pa1�pa2�ancestorlinknode�
pacopyfromrrr�_createfileblobPsV




�



�zremotefilelog._createfileblobc
CsV|durt�|||�}t�|�\}
}t�|||�\}}
|j|||||||||
|fd�	S)N)�
_metatuple)r
r:�	parsemetar�processflagswrite�addrawrevision)rr<r>r?r@rA�
cachedeltarrM�sidedatar=�
metaoffset�rawtext�validatehashrrrr;�s&
��zremotefilelog.addrevisionc
	Csl|	r|	\}
}nt�|�\}
}|dkrd}|r||d�}n|}|�||
|||||�}
|jj�|j||
�|S)Nr)r
r^r\r'r(�addremotefilelognoder)rrdr>r?r@rArrMrar]r=rc�blobtextrOrrrr`�s

�zremotefilelog.addrawrevisioncCs2|jj�|j|�}||\}}}}|r||fSdS�NF�r'�
metadatastore�getancestorsr)rr�	ancestorsr@rAr?rQrrr�renamed�s
zremotefilelog.renamedcCst|�|��S)z#return the size of a given revision)rFr5r rrr�size�szremotefilelog.sizecCs"||jjkrdS|�|�}||kS)zpcompare text with a given file revision

        returns True if text is different than what is stored.
        T)r'rHr5)rrr<�nodetextrrr�cmp�s
zremotefilelog.cmpcC�dS)NTr�rrrr�__nonzero__��zremotefilelog.__nonzero__cCs|jdvrdStd��)N)s.hgtagss.hgsubs.hgsubstaterslen not supported)r�RuntimeErrorrrrrr�__len__�s
zremotefilelog.__len__cC�gSrrrrrrr�heads�zremotefilelog.headscCrqrhrrrrrr�emptyrtzremotefilelog.emptycCs4t|t�r
t�d��|jj}|�|j|��t	j
d�S)Ns3remotefilelog does not accept integer rev for flagsr)�
isinstance�intr�ProgrammingErrorr'r(�getmetarr9r
�METAKEYFLAG)rrrrrrrMs
�zremotefilelog.flagscCsR||jjkr|jj|jjfS|jj�|j|�}||\}}}}|r%|jj}||fSr)r'rHrjrkr�rrrJr@rAr?rQrrr�parentsszremotefilelog.parentscCs
|�|�Sr)r��r�revrrr�
parentrevss
zremotefilelog.parentrevscCs&|jj�|j|�}||\}}}}|Srrir�rrrr?szremotefilelog.linknodecCs|j��j�|�|��Sr)r'�
unfiltered�	changelogr�r?r rrr�linkrev$�zremotefilelog.linkrevFccs��~~~~~d}|D]F}	|�|	�\}
}|dur|
}}||	kr#|jj}||jjkr2d}
|�||	�}n|�|	�}
d}tj|	|
||�|	�||�|	�d|
|ddd�Vq
dS)Nr)r�p1node�p2noder?�basenoderM�baserevisionsizer0�deltarb�protocol_flags)	r�r'rH�revdiff�rawdatar	�revlogrevisiondeltar?rM)r�nodes�
nodesorder�revisiondata�assumehaveparentrevisions�
deltaprevious�	deltamode�sidedata_helpers�prevnoderr@rAr�r0r�rrr�
emitrevisions's:�

��zremotefilelog.emitrevisionscCst�|�|�|�|��Sr)r�textdiffr�)r�node1�node2rrrr�Qr�zremotefilelog.revdiffcCs8t|�dkr
t|�}t|�dkrt�||jtd���|S)N�(�sinvalid lookup input)rFrr�LookupErrorrrr rrr�lookupTs�zremotefilelog.lookupcCs|Srrr rrrr�^ryzremotefilelog.revcCst|t�r
t�d��|S)Ns2remotefilelog does not convert integer rev to node)r{r|rr}r�rrrrbs

�zremotefilelog.nodecCs�||jjkrdSt|�dkrt�||jtd���||jjjks&||jjj	vr)tj
�|jj}|�|j|�}|r8|S|�
|j|��tjd�}|dkrJ|St�|||�dS)z�returns the revlog contents at this node.
        this includes the meta data traditionally included in file revlogs.
        this is generally only used for bundling and communicating with vanilla
        hg clients.
        rDr�sinvalid revision inputr)r'rHrFrr�rr�
nodeconstants�wdirid�wdirfilenodeids�WdirUnsupportedr(r9r~r
rr�processflagsread)rr�rawrrdrMrrrr0js"�zremotefilelog.revisioncCs|j|dd�S)NF)r�)r0r rrrr��szremotefilelog.rawdatacCs�|jj}|j}t�|jj|j|�}z|�|�WSty Ynwt�	|j|�}t
j�|j
|�}zt�|�WSty?Ynw|�|j|fg�z|�|�WStyXYnwt�||jtd���)z3reads the raw file blob from disk, cache, or serversno node)r'�fileservice�
localcacher�getcachekey�namerr5r�getlocalkey�osr.�join�	localpathr�readfile�IOError�prefetchrr�r)r�idr�r��cachekey�localkeyr�rrr�_read�s0����zremotefilelog._readcCs|jj�|j|�Srrir rrrrJ�szremotefilelog.ancestormapcCsv||jjks||jjkr|jjS|�||�\}}dd�t�|�D�}t�|||||�}|r7tt|j	|��S|jjS)NcS�i|]\}}||�qSrr��.0�k�vrrr�
<dictcomp>��z*remotefilelog.ancestor.<locals>.<dictcomp>)
r'rH�_buildrevgraphr�	iteritemsrrl�min�map�__getitem__�r�a�b�revmap�
parentfuncr)�ancsrrrr�szremotefilelog.ancestorcCsf||jjks||jjkr|jjS|�||�\}}dd�t�|�D�}t�|||||�}t|j|�S)z@calculate all the heads of the common ancestors of nodes a and bcSr�rrr�rrrr��r�z6remotefilelog.commonancestorsheads.<locals>.<dictcomp>)	r'rHr�rr�r�commonancestorsheadsr�r�r�rrrr��sz"remotefilelog.commonancestorsheadscsN|�|�}|�|�}t�t�}t��||fD]8}t�|�D]0\}}||}	|\}
}}}
|
|jjkr=|
s=|	�	|
���
|
�||jjkrM|	�	|���
|�qqt�t�}i}t��fdd�|D��}|r�|��\}}||vrz|ry||�	||�qbt
|�t
|�d}|||<|r�||�	|�|�|�D]	}|�||f�q�|sd||jfS)z�Builds a numeric revision graph for the given two nodes.
        Returns a node->rev map and a rev->[revs] parent function.
        c3s �|]}|�vrd|fVqdSrr)r��n��
allparentsrr�	<genexpr>�s�z/remotefilelog._buildrevgraph.<locals>.<genexpr>r)rJ�collections�defaultdict�listrGrr�r'rHrKrC�dequerLrFr9�
appendleftr�)rr�r��amap�bmap�
parentsmap�mappingr�pdatar�r@rAr?rQr�r�rT�prevrev�current�
currentrev�parentrr�rr��sF






��

��
zremotefilelog._buildrevgraphcCsdSrr)r�minlinkr>rrr�strip�rtzremotefilelog.stripcCrwrrrrrrr�files�rtzremotefilelog.filescCrq)N)rrrrrrrr�	checksize�rtzremotefilelog.checksize)NN)NFFFNN)F),r"r#r$�
_generaldeltar�RevlogError�_flagserrorclassrr5rCr\r	�REVIDX_DEFAULT_FLAGSr;r`rmrn�rawsizerprs�__bool__rvrxrzrMr�r�r?r�r�r�r�r�rr0r�r�rJrr�r�r�r�r�rrrrr%/sd


@
�+
�,

�*


1r%)�
__future__rr�r��mercurial.noder�mercurial.i18nr�	mercurialrrrrr	�mercurial.utilsr
�mercurial.revlogutilsr�r
rr�objectrr%rrrr�<module>s

https://t.me/RX1948 - 2025