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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/config.cpython-310.pyc
o

�]LbX"�@s`ddlmZddlZddlZddlmZddlmZddlm	Z	m
Z
mZmZGdd�de�Z
dS)	�)�absolute_importN�)�_)�getattr)�encoding�error�pycompat�utilc@s�eZdZd+dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zd+dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd,d!d"�Zd#d$�Zd%d&�Zd-d'd(�Zd-d)d*�ZdS).�configNcCsHd|_i|_g|_|r"|jD]}||��|j|<q|jd|_dSdS)Nrr)�_current_source_level�_data�_unset�copy)�self�data�k�r�2/usr/lib/python3/dist-packages/mercurial/config.py�__init__s
�zconfig.__init__cCs|jd7_dS)zYincrement the source counter

        This is used to define source priority when readingrN)r�rrrr�
new_source!szconfig.new_sourcecCst|�S�N)r
rrrrr'szconfig.copycCs
||jvSr)r�r�sectionrrr�__contains__*s
zconfig.__contains__cCs||j�|i�vSr�r�get�rr�itemrrr�hasitem-szconfig.hasitemcCs|j�|i�Srrrrrr�__getitem__0�zconfig.__getitem__ccs�|��D]}|VqdSr)�sections)r�drrr�__iter__3s��zconfig.__iter__cCs�|j}|d7}|j}|jD] \}}|j�|d�}|dur-||vr-|��|j|<|j||=q
|D]>}|j�|d�}|rC|��|j|<nt��|j|<|j|��D]\}}|\}	}
}||7}t||�}|	|
|f|j||<qQq0||_dS)Nr)	rr
rr�preparewriter	�cowsortdict�items�max)r�src�
current_level�	max_level�s�n�dsr�v�value�source�levelrrr�update7s*�

�
z
config.updatecCs|j�|i��|�Srrrrrr�_getMszconfig._getcCs |�||�}|dur|S|dS)Nr�r4)rrr�default�resultrrrrP�z
config.getcCs:z	|j||}Wn
ty||fYSw||f|S)z�return a tuple allowing restore to reinstall a previous value

        The main reason we need it is because it handles the "no data" case.
        )r�KeyError)rr�keyrrrr�backupVs�z
config.backupcCs |�||�}|durdS|dS)N�rr5�rrrr7rrrr1br8z
config.sourcecCs |�||�}|durdS|dS)N�r5r=rrrr2hr8zconfig.levelcCst|j���Sr)�sortedr�keysrrrrr"nr!zconfig.sectionscCs"t�|j�|i��}dd�|D�S)NcSsg|]
\}}||df�qS)rr)�.0rr/rrr�
<listcomp>ssz config.items.<locals>.<listcomp>)r�	iteritemsrr)rrr'rrrr'qszconfig.itemsr<cCs�tjrt|t�rJd��t|t�rJd��t|t�rJd��||vr*t��|j|<n
|j|��|j|<|||jf|j||<dS)Ns5config section may not be unicode strings on Python 3s2config item may not be unicode strings on Python 3s4config values may not be unicode strings on Python 3)	r�ispy3�
isinstance�strr	r&rr%r)rrrr0r1rrr�setus(������z
config.setcCsJ|j||}t|�}|f|dd�}t|�|ksJ�||j||<dS)zsalter a value without altering its source or level

        This method is meant to be used by `ui.fixconfig` only.rN)r�len)rrr:�	new_valuer�size�new_itemrrr�alter�s
zconfig.altercCszt|�dkr'|dd�\}}|dd�}|j|��|j|<||j||<dS|\}}||jvr;|j|�|d�dSdS)z$restore data returned by self.backupr>N)rHrr%�pop)rrrr:rrrr�restore�s
�zconfig.restorecCs�tj�d�}tj�d�}tj�d�}tj�d�}	tj�d�}
tj�d�}tj�d�}d}
d}d	}d
}|r:|�|
|
�}
|�d�D�].}|d7}|dkrU|�d
�rU|dd�}|r�|
�|�r]q?|�|�}|r�|rk|
|vrkq?|�|
|�d|�d�}|�|
||d||f�q?d}d
}|�|�}|r�|r�t�	|�d��}z	||||d�Wn,t
y�}z |jtjkr�t
�td�|t�|j�fd||f��WYd}~nd}~wwq?|	�|�r�q?|�|�}|r�|�d�}
|r�|�|
|
�}
|
|vr�t��|j|
<q?|�|�}|�r|�d�}d}|�r|
|v�rq?|�|
||�d�d||f�q?|�|�}|�rW|�d�}|�r5|
|v�r5q?|�|
|�du�rN|j|
��|j|
<|j|
|=|j�|
|f�q?|��}|�d��red|}t
�|d||f��dS)Ns\[([^\[]+)\]s([^=\s][^=]*?)\s*=\s*(.*\S|)s\s+(\S|\S.*\S)\s*$s
(;|#|\s*$)s(;|#)s%unset\s+(\S+)s%include\s+(\S|\S.*\S)\s*$r<rFTrs��
s%s:%d��remapr"scannot include %s (%s)r>� s!unexpected leading whitespace: %s)r	�re�compiler�
splitlines�
startswith�match�grouprG�
expandpath�IOError�errno�ENOENTr�ConfigErrorrr�
strtolocal�strerrorr&rr%r
�append�rstrip)rr)rr"rR�include�	sectionre�itemre�contre�emptyre�	commentre�unsetre�	includererr�line�cont�l�mr/�expanded�inst�name�messagerrr�parse�s�


�
����






�zconfig.parsecsp���|st�|d�}t|dd�dksJd||jf��tj�|����fdd�}�j||�	�|||d�dS)Nsrb�mode�rbs=config files must be opened in binary mode, got fp=%r mode=%rcs2tj�tj��|��}�j|||d����dS)NrQ)�os�path�normpath�join�readr)�relrRr"�abs��dirrrrrc�szconfig.read.<locals>.include)r"rRrc)
rr	�	posixfilerrtrvrw�dirnamersrz)rrw�fpr"rRrcrr}rrz�s��
�zconfig.readr)r<)NNN)�__name__�
__module__�__qualname__rrrrrr r$r3r4rr;r1r2r"r'rGrLrNrsrzrrrrr
s*
	



Qr
)�
__future__rr\rv�i18nrrr�rrr	�objectr
rrrr�<module>s

https://t.me/RX1948 - 2025