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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

�]Lb�
�@sRdZddlmZddlZddlmZddlmZddlm	Z	Gdd	�d	e	j	�Z
dS)
z�
    [infinitepush]
    # Server-side option. Used only if indextype=disk.
    # Filesystem path to the index store
    indexpath = PATH
�)�absolute_importN)�util)�
stringutil�)�indexapics�eZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Z�ZS)�fileindexapicsntt|���||_|j�dd�}|stj�dd�}tj�|d�|_	tj�|d�|_
tj�|d�|_d|_dS)Nsinfinitepushs	indexpathsscratchbranchessindexsnodemapsbookmarkmapsnodemetadatamap)
�superr�__init__�_repo�ui�config�os�path�join�_nodemap�_bookmarkmap�_metadatamap�_lock)�self�repo�root��	__class__��A/usr/lib/python3/dist-packages/hgext/infinitepush/fileindexapi.pyr	s
zfileindexapi.__init__cCs|j��|_|S�N)r
�wlockr)rrrr�	__enter__&szfileindexapi.__enter__cCs|jr
|j�|||�dSdSr)r�__exit__)r�exc_type�exc_val�exc_tbrrrr*s�zfileindexapi.__exit__cCs.|D]}tj�|j|���}|�||�qdSr)r
rrr�hex�_write)r�bundleid�nodesctx�node�nodepathrrr�	addbundle.s�zfileindexapi.addbundlecCs tj�|j|�}|�||�dSr)r
rrrr#)r�bookmarkr&�bookmarkpathrrr�addbookmark3szfileindexapi.addbookmarkcCs"|��D]
\}}|�||�qdSr)�itemsr+)r�	bookmarksr)r&rrr�addmanybookmarks7s�zfileindexapi.addmanybookmarkscCs<|D]}|�|�D]\}}tj�|j|�}|�|�q	qdSr)�_listbookmarksr
rrr�_delete)r�patterns�patternr)�_r*rrr�deletebookmarks;s��zfileindexapi.deletebookmarkscC�tj�|j|�}|�|�Sr)r
rrr�_read)rr&r'rrr�	getbundleA�
zfileindexapi.getbundlecCr5r)r
rrrr6)rr)r*rrr�getnodeEr8zfileindexapi.getnodecCst|�|��Sr)�dictr/)r�queryrrr�getbookmarksIszfileindexapi.getbookmarkscCs$|jj}|�tj�|j|�|�dSr)r
�vfs�writer
rrr)rr&�jsonmetadatar=rrr�saveoptionaljsonmetadataLsz%fileindexapi.saveoptionaljsonmetadatac	cs��|�d�rd|dd�d}t�|�\}}}t|j�d}|jj�|j�D],\}}}|D]$}	tj	�
||	�|d�}
t�|
�}
||
�sEq.|
|�
tj	�
||	��fVq.q'dS)N�*sre:^���s.*r)�endswithr�
stringmatcher�lenrr
r=�walkr
rrr�pconvertr6)rr2�kind�pat�matcher�	prefixlen�dirpathr3�books�bookr)rrrr/Ps�

��zfileindexapi._listbookmarkscCs6|jj}|�|�}|�|�s|�|�|�||�dSr)r
r=�dirname�exists�makedirsr>)rr�valuer=rOrrrr#]s



zfileindexapi._writecC� |jj}|�|�sdS|�|�Sr)r
r=rP�read�rrr=rrrr6e�

zfileindexapi._readcCrSr)r
r=rP�unlinkrUrrrr0krVzfileindexapi._delete)�__name__�
__module__�__qualname__r	rrr(r+r.r4r7r9r<r@r/r#r6r0�
__classcell__rrrrrs 
r)�__doc__�
__future__rr
�	mercurialr�mercurial.utilsr�rrrrrr�<module>s

https://t.me/RX1948 - 2025