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

�]Lb�&�@s�dZddlmZddlmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZddlmZGdd	�d	ej�ZGd
d�deej�ZGdd
�d
eej�ZGdd�dej�ZGdd�de
j�ZGdd�de�Z ddd�Z!dd�Z"dS)z~Repository class for "in-memory pull" of one local repository to another,
allowing operations like diff and log with revsets.
�)�absolute_import�)�_)�getattr)�	changelog�cmdutil�encoding�error�filelog�	localrepo�manifest�mdiff�pathutil�revlog�util�vfs)�	constantscsfeZdZdd�Zdd�Z�fdd�Zd�fd	d
�	Zddd�Z				dd
d�Zdd�Z	dd�Z
�ZS)�unionrevlogcCsVt�|�}t|dd�}|dur|jj}tjj||||d�||_t|�}|d|_	t
�|_|jD]x}|jj|}|\
}	}
}}}
}}}}}}}}|	d@}|durX|
|ksUJ�|}n||
�}|durd||�}|j�
|�}|duru|j�|�q0|j�|�}|j�|�}|d||||�|�|�|�|ddtjtj|f
}|j�|�|j�|�|d7}q0dS)N�target)r�radixri�����r)�vfsmod�readonlyvfsr�_revlogrr�__init__�revlog2�len�
repotiprev�set�
bundlerevs�index�get_rev�add�node�rev�revlog_constants�COMP_MODE_INLINE�append)�self�openerrr�
linkmapperr�n�rev2r$�_start�_csize�rsize�base�linkrev�p1rev�p2revr#�_sdo�_sds�_dcm�_sdcm�rank�flags�link�this_rev�p1node�p2node�e�r?�5/usr/lib/python3/dist-packages/mercurial/unionrepo.pyr(sr


��
�zunionrevlog.__init__cCs*||jkrtj�||�S|j�|�|��S�N)rr�_chunkrr#)r(r$r?r?r@rBus
zunionrevlog._chunkcs|||jkr||jkr|j�|j�|�|��|j�|�|���S||jkr2||jkr2tt|��||�St�|�	|�|�	|��S)z1return or calculate a delta between two revisions)
rr�revdiffr$r#�superrr
�textdiff�rawdata)r(�rev1r,��	__class__r?r@rCzs�zunionrevlog.revdiffNFcsdt|t�r
|}|�|�}n|}|�|�}||jkr%t|jd|j�}|j}ntt	|�j}||||d�S)Nr)�_df�raw)
�
isinstance�intr#r$rrr�
_revisiondatarDr)r(�	nodeorrevrJrKr$r#r�funcrHr?r@rN�s


zunionrevlog._revisiondatacC�t�rA��NotImplementedError)r(�text�transactionr:�p1�p2�dr?r?r@�addrevision��zunionrevlog.addrevisioncCrQrArR)r(�deltasr*rU�alwayscache�
addrevisioncb�duplicaterevisioncb�maybemissingparentsr?r?r@�addgroup�s
zunionrevlog.addgroupcCrQrArR)r(�minlinkrUr?r?r@�strip�rZzunionrevlog.stripcCrQrArR�r(r?r?r@�	checksize�rZzunionrevlog.checksize�NF)NNN)FNNF)�__name__�
__module__�__qualname__rrBrCrNrYr`rbrd�
__classcell__r?r?rHr@r'sM

�rc@�eZdZdd�ZdS)�unionchangelogcCs4tj�||�d}t�|�}t�|||j||�dSrA)rrrr)r(r)�opener2r*�
changelog2r?r?r@r�s
zunionchangelog.__init__N�rfrgrhrr?r?r?r@rk��rkc@rj)�
unionmanifestcCs6tj�|||�t�||�}t�|||jj||�dSrA)r�manifestrevlogrrrr)r(�
nodeconstantsr)rlr*�	manifest2r?r?r@r�s
�zunionmanifest.__init__Nrnr?r?r?r@rp�rorpc@seZdZdd�Zdd�ZdS)�unionfilelogcCsPtj�|||�t�||�}t||jj|j|�|_||_|jj|_|jj|_dSrA)r
rrrr�_reporr)r(r)�pathrlr*�repo�filelog2r?r?r@r�s�
zunionfilelog.__init__cCs6||jkrtj�||�S|�|�}|j�|j�|��S)z Check if a revision is censored.)rr
�
iscensoredr#rr$)r(r$r#r?r?r@ry�s

zunionfilelog.iscensoredN)rfrgrhrryr?r?r?r@rt�s
rtc@rj)�	unionpeercC�dSrer?rcr?r?r@�canpush�rZzunionpeer.canpushN)rfrgrhr|r?r?r?r@rz�rorzc@sleZdZdZdd�Zejdd��Zejdd��Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�ZdS)�unionrepositoryz�Represents the union of data in 2 repositories.

    Instances are not usable if constructed directly. Use ``instance()``
    or ``makeunionrepository()`` to create a usable instance.
    cCs"||_||_|j�dddd�dS)NsphasesspublishFs	unionrepo)�repo2�_url�ui�	setconfig)r(r~�urlr?r?r@r�szunionrepository.__init__cCst|j|jj�SrA)rk�svfsr~rcr?r?r@r�szunionrepository.changelogcCs2t|j|j|jj|��j�}t�|j|||���SrA)	rprrr�r~�
unfiltered�_clrevr�manifestlog�narrowmatch)r(�	rootstorer?r?r@r��s��zunionrepository.manifestlogcCs|jj�|�}|j�|�S)z?map from repo2 changelog rev to temporary rev in self.changelog)r~rr#r$)r(r,r#r?r?r@r��szunionrepository._clrevcCs|jSrA)rrcr?r?r@r��szunionrepository.urlcCst|j||jj|��j|�SrA)rtr�r~r�r�)r(�fr?r?r@�file�s�zunionrepository.filecCs|j��dSrA)r~�closercr?r?r@r��szunionrepository.closecCr{rer?rcr?r?r@�cancopyrZzunionrepository.cancopycCst|�SrA)rzrcr?r?r@�peer�zunionrepository.peercCst��SrA)r�getcwdrcr?r?r@r�r�zunionrepository.getcwdN)rfrgrh�__doc__rr�unfilteredpropertycacherr�r�r�r�r�r�r�r�r?r?r?r@r}�s

r}Nc
Cs�|r	t�td���|�dd�}|st�t���}|durd}|r=t��}||kr+d}nt�	|�}|�
|�r=|t|�d�}|�
d�ra|�dd�d�dd�}t|�dkr\||d	}}	n
|\}}	n||}}	t
|||	�S)
Ns"cannot create new union repositorysbundlesmainreporoot�sunion:�:r�+r)r	�Abortr�configr�findreporr�r�normasprefix�
startswithr�split�makeunionrepository)
r�rv�create�intents�
createopts�
parentpath�cwd�s�repopath�	repopath2r?r?r@�instances*




r�cCshtj||dd�}tj||dd�}dt�|�t�|�f}Gdd�dt|j�}|}||_t�|||�|S)z7Make a union repository object from 2 local repo paths.F)r�sunion:%s+%sc@seZdZdS)z3makeunionrepository.<locals>.derivedunionrepositoryN)rfrgrhr?r?r?r@�derivedunionrepository5sr�)rr�r�
expandpathr}rIr)r��	repopath1r��repo1r~r�r�rwr?r?r@r�+s�r�)NN)#r��
__future__r�i18nr�pycompatr�rrrr	r
rrr
rrrrr�revlogutilsrr%rrkrqrprt�	localpeerrz�objectr}r�r�r?r?r?r@�<module>s	8	
7

https://t.me/RX1948 - 2025