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

�]Lb	/�@s�ddlmZddlZddlmZddlmZmZddlm	Z	m
Z
mZmZm
Z
mZmZmZddlmZddlmZmZmZmZmZmZmZmZmZmZd	d
�Zdd�Zd
d�Z dd�Z!dd�Z"dd�Z#dS)�)�absolute_importN)�_)�hex�nullrev)�encoding�error�	localrepo�match�pycompat�scmutil�sparse�util)�procutil�)
�connectionpool�	constants�contentstore�datapack�fileserverclient�historypack�
metadatastore�
remotefilectx�
remotefilelog�shallowutilcCsZtj�|jjjd�}tj�|�st�|�tj	|||j
dd�}tj|||j
dd�}||fS)z:In-repo stores, like .hg/store/data; can not be discarded.sdataF��shared)
�os�path�join�svfs�vfs�base�exists�makedirsr�remotefilelogcontentstore�namer�remotefilelogmetadatastore)�repo�	localpath�localcontent�
localmetadata�r+�A/usr/lib/python3/dist-packages/hgext/remotefilelog/shallowrepo.py�makelocalstores's

�
�r-cCsZt�|j�}tj|||jdd�}tj|||jdd�}||_|j	�
|�|j�
|�||fS)z?Typically machine-wide, cache of remote data; can be discarded.Tr)r�getcachepath�uirr$r%rr&�sharedstore�shareddatastores�append�sharedhistorystores)r'�	cachepath�cachecontent�
cachemetadatar+r+r,�makecachestores7s
�
�r7cCs8t�|�|_t�|j|j|�}t�|j|j|�}||fS)z-These stores fetch data from a remote server.)r�fileservicer�remotecontentstorer/r�remotemetadatastore)r'r5r6�
remotecontent�remotemetadatar+r+r,�makeremotestoresIs
�
�r=cCs\t�|tj�}t�|j|�}t�|j|�}|j	�
|�|j�
|�t�|jd||�||fS)z5Packs are more efficient (to read from) cache stores.�	filestore)
r�getcachepackpathr�FILEPACK_CATEGORYr�
datapackstorer/r�historypackstorer1r2r3�reportpackmetrics)r'�packpath�packcontentstore�packmetadatastorer+r+r,�makepackstoresVs
�rGcCs�g|_g|_t|�\}}t|�\}}t|�\}}t|||�\}}tj|||||d�|_tj	|||||d�|_|}	|}
|j
�|j|j|	|
�t�
|jd||�dS)zBUnion stores iterate the other stores and return the first result.)�
writestorer>N)r1r3rGr7r-r=r�unioncontentstorer�unionmetadatastorer8�setstorerrCr/)r'rErFr5r6r)r*r;r<�fileservicedatawrite�fileservicehistorywriter+r+r,�makeunionstoresesB����
�rNcs�G��fdd�d�j����_t���_t���j�ddd��_�j�ddd��_t	�
�d�s6t����_�js<�jrKt��jdd�j�j��_dSdS)Ncs�eZdZejdd��Zej�fdd��Z�fdd�Z��fdd�Z��fd	d
�Z	e
jd��fd
d�	�Z	d�fdd�	Z
d�fdd�	Zd�fdd�	Z��fdd�Z�ZS)z#wraprepo.<locals>.shallowrepositorycSs|j�dd�S)N�
remotefilelogsreponame)r/�config��selfr+r+r,r%�sz(wraprepo.<locals>.shallowrepository.namecs,�j�dd�j�dd��}|st�d��|S)NrOsfallbackpathspathssdefaults>no remotefilelog server configured - is your .hg/hgrc trusted?)r/rPr�Abort)rRr�r'r+r,�fallbackpath�s��z0wraprepo.<locals>.shallowrepository.fallbackpathcs.|r
tj�|d�}nt���}|��rdS|S)z�
            A wrapper that allows the remotefilelog to invoke sparsematch() if
            this is a sparse repository, or returns None if this is not a
            sparse repository.
            )�revsN)r�matcher�always)rRrV�kwargs�retrTr+r,�maybesparsematch�s
z4wraprepo.<locals>.shallowrepository.maybesparsematchcsB|ddkr|dd�}|�|�rt�|j||�St�|��|�S)Nr�/r)�shallowmatchrr�super�file)rR�f��	__class__�shallowrepositoryr+r,r_�s

z(wraprepo.<locals>.shallowrepository.filecsB|�|�rtj||g|�Ri|��St�|�j|g|�Ri|��S�N)r]rr^�filectx)rRr�argsrYrar+r,re�s

���z+wraprepo.<locals>.shallowrepository.filectxFNcsz|��s2|����}g}|��|��D]}|�||j�}||jkr+|�|t|�f�q|j	�
|�t�|�j|||d�S)z{Add a new revision to current repository.
            Revision information is passed via the context argument.
            )r�origctx)
�manifestnode�p1�manifest�modified�added�get�nullidr2rr8�prefetchr^�	commitctx)rR�ctxrrg�m1�filesr`�fparent1rar+r,rp�s	
�
�z-wraprepo.<locals>.shallowrepository.commitctxcslt��d�jdg}|r|�d�|r|d|g7}i}�j�dd�r'�jj|d<tj|tj	fdd	i|��d
S)z0Runs prefetch in background with optional repacks-Rsprefetchs--repacks-rsdevelsremotefilelog.bg-wait�record_wait�ensurestartFN)
r�hgexecutable�origrootr2r/�
configbool�atexit�runbgcommandr�environ)rRrVr!�repack�pats�opts�cmdrYrTr+r,�backgroundprefetch�s
��
�z6wraprepo.<locals>.shallowrepository.backgroundprefetchc	sV���jddddtd��j��|�||||�Wd�dS1s$wYdS)z|Prefetches all the necessary file revisions for the given revs
            Optionally runs repack in background
            sprefetchlockTNsprefetching in %s)�_lockrrrx�	_prefetch)rRrVr!r~rrTr+r,ro�s�"�z,wraprepo.<locals>.shallowrepository.prefetchcs|j}|r#��d|�}|dur"|tkr"t��d||��}|r"|d}n�}�j}|�d�}	|durC|�|����}
tt	�
|
��}nt�}|��}|��}
t�}|�t�t
|�}|jjtd�|d�}|�d�t|�D]l}�|}|r|t�|||����|��|��}|	�|�}|	�|�\}}||vr�||vr�||��}
n||��}
t	�
|
�}|r��fdd�|D�}�r��fd	d�|D�}||vr�|
�|�n|�|�|�|�|��qm|�|�|
�|�|��|
r�d
d�|
D�}�jj|dd
�|�rdd�|D�}�j�|�dSdS)Nsoutgoing(%s)sfirst(reverse(::%s) - %ld)r�sprefetching)�totalc3� �|]}�|d�r|VqdS�rNr+��.0�pf)�mr+r,�	<genexpr>0��z@wraprepo.<locals>.shallowrepository._prefetch.<locals>.<genexpr>c3r�r�r+r�)�sparsematchr+r,r�2r�cS�g|]
\}}|t|�f�qSr+�r�r�r�fnoder+r+r,�
<listcomp>A�zAwraprepo.<locals>.shallowrepository._prefetch.<locals>.<listcomp>T)�forcecSr�r+r�r�r+r+r,r�Fr�)rUrVr�list�manifestlog�
getstoragerh�read�setr
�	iteritems�copy�add�lenr/�makeprogressr�update�sortedrr	r[�rev�
parentrevs�readfast�	increment�difference_update�completer8ro)rRrVr!r~rrU�	localrevs�
serverbase�mfl�mfrevlog�mfdict�skiprs�serverfiles�visited�revcount�progressr�rq�mfnode�mfrevri�p2�diff�resultsrT)r�r�r,r��sr���










�z-wraprepo.<locals>.shallowrepository._prefetchcst�|���|j��dSrd)r^�closerrQrar+r,r�Isz)wraprepo.<locals>.shallowrepository.close)FN)NFNN)NNN)�__name__�
__module__�__qualname__r
�
propertycacher%rUr[r_rer�unfilteredmethodrpr�ror�r��
__classcell__r+�r'rc)rbr,rc�s
	�OrcrOsincludepatternsexcludepatternrr�)
rbr	rXr]rNr/�
configlist�includepattern�excludepatternr
�safehasattrr�rootrTr+r�r,�wraprepo�s$?
��
��r�)$�
__future__rr�mercurial.i18nr�mercurial.noderr�	mercurialrrrr	r
rrr
�mercurial.utilsr�rrrrrrrrrrr-r7r=rGrNr�r+r+r+r,�<module>s(
0
)

https://t.me/RX1948 - 2025