403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/__pycache__/bundlerepo.cpython-39.opt-1.pyc
a

�+�b,]�@s`dZddlmZddlZddlZddlmZddlmZm	Z	ddl
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlm Z dd	lm!Z"Gd
d�dej�Z#Gdd
�d
e#e
j
�Z$Gdd�de#ej%�Z&Gdd�dej�Z'Gdd�dej(�Z)Gdd�dej*�Z+dd�Z,Gdd�de-�Z.d#dd�Z/dd�Z0Gdd�de-�Z1d$d!d"�Z2dS)%z�Repository class for viewing uncompressed bundles.

This provides a read-only repository interface to bundles as if they
were part of the actual repository.
�)�absolute_importN�)�_)�hex�nullrev)�bundle2�changegroup�	changelog�cmdutil�	discovery�encoding�error�exchange�filelog�	localrepo�manifest�mdiff�pathutil�phases�pycompat�revlog�revlogutils�util�vfs)�urlutil)�	constantscsXeZdZdd�Zddd�Zdd�Zd�fdd	�	Zd
d�Zdd
�Zdd�Z	dd�Z
�ZS)�bundlerevlogcCsNt�|�}tjj||||d�||_t|�}|d|_t�|_|�	�D�]}|\}}	}
}}}
}}t|
�}|�
�|}|j�|�r�|j�
|j�|��qF||kr�t}n||�}|	|
fD]$}|j�|�s�t�||jtd���q�|j�|�s�t||jtd���|�|�}tj||||||�|	�|�|
�|d�}|j�|�|j�
|�|d7}qFdS)N)�target�radixrsunknown parentsunknown delta base)�flagsZdata_offsetZdata_compressed_lengthZdata_delta_baseZlink_revZparent_rev_1Zparent_rev_2Znode_id)�vfsmod�readonlyvfsr�__init__�bundle�len�
repotiprev�setZ
bundlerevs�	deltaiter�tell�indexZhas_node�add�revrr
�LookupErrorZ
display_idrr�entry�append)�self�openerrr�
cgunpacker�
linkmapper�nZ	deltadata�node�p1�p2�csZ	deltabase�deltarZsidedata�size�startZlinkrev�pZbaserev�e�r=�:/usr/lib64/python3.9/site-packages/mercurial/bundlerepo.pyr"8sN

��
�
zbundlerevlog.__init__NcCs<||jkrtj�||�S|j�|�|��|j�|�|��S�N)r%r�_chunkr#�seekr:�read�length)r/r+Zdfr=r=r>r@ps
zbundlerevlog._chunkcCsr||jkr6||jkr6|j|d}||krZ|�|�Sn$||jkrZ||jkrZtj�|||�St�|�|�|�|��S)z1return or calculate a delta between two revisions�)r%r)r@r�revdiffrZtextdiffZrawdata)r/Zrev1Zrev2Zrevbr=r=r>rEyszbundlerevlog.revdiffcs�|dur|�|�}d}d}g}|}||jkrf|jrL|jd|krL|jd}qf|�|�|j|d}q"|tkrtd}n.|dur�tt|�j|�	|�||d�}|\}	}}|r�d}|r�|�
|���}
t�
||
g�}q�|||fS)NFr�rD�)�_df)r+r%Z_revisioncacher.r)r�superr�_rawtextr4r@�poprZpatches)r/r4r+rHZ	validatedZrawtext�chainZiterrev�r�__r8��	__class__r=r>rJ�s2




�
zbundlerevlog._rawtextcOst�dSr?��NotImplementedError�r/�args�kwargsr=r=r>�addrevision�szbundlerevlog.addrevisioncOst�dSr?rQrSr=r=r>�addgroup�szbundlerevlog.addgroupcOst�dSr?rQrSr=r=r>�strip�szbundlerevlog.stripcCst�dSr?rQ�r/r=r=r>�	checksize�szbundlerevlog.checksize)N)N)�__name__�
__module__�__qualname__r"r@rErJrVrWrXrZ�
__classcell__r=r=rOr>r7s8
	rc@seZdZdd�ZdS)�bundlechangelogcCs6tj�||�dd�}t�||tjdf|j||�dS)NcSs|Sr?r=)�xr=r=r>�<lambda>�rGz*bundlechangelog.__init__.<locals>.<lambda>)r	r"r�revlog_constantsZKIND_CHANGELOGr)r/r0r1r2r=r=r>r"�s�zbundlechangelog.__init__N�r[r\r]r"r=r=r=r>r_�sr_cs&eZdZddd�Z�fdd�Z�ZS)�bundlemanifestNrGcCsdtjj||||d�t�||tj|f|jj||�|durTi}|jj	dkrTt
|j�}||_||_dS)N)Ztrees03)
r�manifestrevlogr"rrbZKIND_MANIFESTLOG�_revlogrr#�version�_getfilestarts�
_dirlogstarts�_linkmapper)r/�
nodeconstantsr0r1r2Zdirlogstarts�dirr=r=r>r"�s	�
zbundlemanifest.__init__csJ||jvr:|j�|j|�t|j|j|j|j|j|d�Stt|��|�S)N)rl)	rir#rArdrkr0rjrI�dirlog)r/�drOr=r>rm�s
�zbundlemanifest.dirlog)NrG)r[r\r]r"rmr^r=r=rOr>rd�s�
rdc@seZdZdd�ZdS)�
bundlefilelogcCs2tj�|||�t|tj|f|jj||d�|_dS)N)rrr1r2)rr"rrbZKIND_FILELOGrfr)r/r0�pathr1r2r=r=r>r"�s�zbundlefilelog.__init__Nrcr=r=r=r>ro�sroc@seZdZdd�ZdS)�
bundlepeercCsdS�NFr=rYr=r=r>�canpush�szbundlepeer.canpushN)r[r\r]rsr=r=r=r>rq�srqcs4eZdZ�fdd�Zdd�Zdd�Zdd�Z�ZS)	�bundlephasecachecs4tt|�j|i|��t�|d�r0t�|j�|_dS)Nr0)rIrtr"rZsafehasattrr r!r0rSrOr=r>r"�szbundlephasecache.__init__cCst�dSr?rQrYr=r=r>�write�szbundlephasecache.writecCst�dSr?rQ)r/�fpr=r=r>�_write�szbundlephasecache._writecCs||j|<|��d|_dS)NT)Z
phaserootsZ
invalidateZdirty)r/ZphaseZnewroots�trr=r=r>�_updaterootss
zbundlephasecache._updateroots)r[r\r]r"rurwryr^r=r=rOr>rt�srtcsFi}t�ji�D]0}|d}���||<t�fdd�i�D]}q:q|S)Nsfilenamecs
��d�Sr?)Z
deltachunkr=�r1r=r>ra
rGz _getfilestarts.<locals>.<lambda>)�iterZ
filelogheaderr()r1ZfilesposZ	chunkdata�fname�chunkr=rzr>rhsrhcs�eZdZdZdd�Zdd�Zd&dd�Zejd	d
��Z	ejdd��Z
d
d�Zejdd��Zdd�Z
ejdd��Zejdd��Zdd�Z�fdd�Zdd�Zdd�Zdd �Zd!d"�Zd'�fd$d%�	Z�ZS)(�bundlerepositorya%A repository instance that is a union of a local repo and a bundle.

    Instances represent a read-only repository composed of a local repository
    with the contents of a bundle file applied. The repository instance is
    conceptually similar to the state of a repository after an
    ``hg unbundle`` operation. However, the contents of the bundle are never
    applied to the actual base repository.

    Instances constructed directly are not usable as repository objects.
    Use instance() or makebundlerepository() to create instances.
    c	CsR||_||_|j�dddd�d|_t�|d�}t�|j||�}t	|t
j�r�||_d|_
d}|jdd�D]*}|jdkr�|r�td	��|}|�||�qh|s�t�td
���|�dtj�n^t	|tj�r�|��r�|j|jdd
d�}t�|j|||j�}||_||_
nt�td�t|���i|_|jj d|_!t"�#|dt"j$dd�||j!d�D��dS)N�phasesspublishFs
bundlerepo�rbT)�seekable�changegroups#can't process multiple changegroupssNo changegroups foundrs.hg10un�HG10UN)�headersbundle type %s cannot be readrcSsg|]}|���qSr=�r4��.0�ctxr=r=r>�
<listcomp>XrGz-bundlerepository.__init__.<locals>.<listcomp>)%�_tempparent�_url�uiZ	setconfig�tempfilerZ	posixfilerZ
readbundle�
isinstancerZ
unbundle20�_bundlefile�_cgunpackerZ	iterparts�typerR�_handlebundle2partr
�AbortrrA�os�SEEK_SETrZcg1unpacker�
compressed�_writetempbundlerBr�_cgfilesposr	r%�firstnewrevrZretractboundaryZdraft)r/�
bundlepath�url�
tempparent�fr#Zcgpart�partr=r=r>r"sP
����zbundlerepository.__init__cCsv|jdkrdS|}|j�dd�}t�|�}||vrHtd�}t�||��|��rb|�	|j
d|�}t�||d�|_dS)Nr�sversions01s#Unsupported changegroup version: %ss.cg%sunsUN)
r��params�getrZsupportedincomingversionsrr
r�r�r�rBZgetunbundlerr�)r/r#r�ZcgstreamrgZlegalcgvers�msgr=r=r>r�[s

z#bundlerepository._handlebundle2partrGcCs||jjd|d�\}}||_t�|d��4}|�|�|d�}|s@qL|�|�q2Wd�n1s`0Y|jj|jdd�S)zWrite a temporary file to disks
hg-bundle-)�prefix�suffix�wbiNr�)�mode)rZmkstempr�r��fdopenru�open)r/Zreadfnr�r�ZfdtempZtempZfptempr}r=r=r>r�js
*z!bundlerepository._writetempbundlecCst||j�Sr?)rtZ_phasedefaultsrYr=r=r>�_phasecacheyszbundlerepository._phasecachecCs(|j��t|j|j�}|j��|_|Sr?)r�Zchangelogheaderr_�svfsr(�manstart)r/�cr=r=r>r	}s
zbundlerepository.changelogcCsdSr?r=rYr=r=r>�_refreshchangelog�sz"bundlerepository._refreshchangelogcCsZ|j�|j�|j��|��jj}t|j|j	|j|�}|j�
�|_t�
|j	|||���Sr?)r�rAr��manifestheader�
unfilteredr	r+rdrkr�r(�	filestartr�manifestlogZnarrowmatch)r/r2Z	rootstorer=r=r>r��s
��zbundlerepository.manifestlogcCs8|j�|j�|j��|j��D]}q"|j��|_dS)zgConsumes the manifest portion of the bundle, setting filestart so the
        file portion can be read.N)r�rAr�r�r'r(r�)r/r8r=r=r>�_consumemanifest�s

z!bundlerepository._consumemanifestcCs|j|jSr?)r	r�rYr=r=r>r��szbundlerepository.manstartcCs|jd|jvr|��|jS)Nr�)r��__dict__r�r�rYr=r=r>r��s
zbundlerepository.filestartcCs|jSr?)r�rYr=r=r>r��szbundlerepository.urlcsn|js |j�|j�t|j�|_||jvrZ|j�|j|�|��jj}t|j	||j|�St
t|��|�SdSr?)
r�r�rAr�rhr�r	r+ror�rIr~�file)r/r�r2rOr=r>r��s
zbundlerepository.filecCs:|j��|jdur"|j�|j�|jr6t�|jd�dS)z'Close assigned bundle file immediately.NT)r��closer�r�unlinkr��shutil�rmtreerYr=r=r>r��s


zbundlerepository.closecCsdSrrr=rYr=r=r>�cancopy�szbundlerepository.cancopycCst|�Sr?)rqrYr=r=r>�peer�szbundlerepository.peercCst��Sr?)r�getcwdrYr=r=r>r��szbundlerepository.getcwdNcs�|dur|j}|j�|�}|j�|�}td�}|jj|krN|j�|t|��|jj|krn|j�|t|��tt	|��
||�S)Ns9setting parent to node %s that only exists in the bundle
)Znullidr	r+rr%r��warnrrIr~�
setparents)r/r5r6Zp1revZp2revr�rOr=r>r��szbundlerepository.setparents)rG)N)r[r\r]�__doc__r"r�r�rZunfilteredpropertycacher�r	r�r�r�r�r�r�r�r�r�r�r�r�r^r=r=rOr>r~s.<



	

r~cCs�|rt�td���|�dd�}|s<t�t���}|dur<d}|rzt��}||krVd}n$t�	|�}|�
|�rz|t|�d�}t�
|�}|��}|jdkr�|�dd�}t|�dkr�||d}	}
q�|\}	}
n
||}	}
t||	|
�S)Ns#cannot create new bundle repositorysbundlesmainreporootrG�+rr)r
r�rZconfigr
Zfindreporr�rZnormasprefix�
startswithr$rr�Z	localpath�scheme�split�makebundlerepository)r�rp�createZintentsZ
createoptsZ
parentpath�cwd�u�s�repopath�
bundlenamer=r=r>�instance�s.





r�cCs�|rdt�|�|f}nd|}ztj||dd�}d}WnPtjy�t��}ztj||dd�}Wnty�t	�
|��Yn0Yn0Gdd�dt|j�}||_t�
||||�|S)	z?Make a bundle repository object based on repo and bundle paths.sbundle:%s+%ss	bundle:%sF)r�NTc@seZdZdS)z5makebundlerepository.<locals>.derivedbundlerepositoryN)r[r\r]r=r=r=r>�derivedbundlerepository!sr�)rZ
expandpathrr�r
Z	RepoErrorrZmkdtemp�	Exceptionr�r�r~rPr")r�r�r�r��repor�r�r=r=r>r�s"

r�c@s$eZdZdd�Zdd�Zdd�ZdS)�bundletransactionmanagercCsdSr?r=rYr=r=r>�transaction+sz$bundletransactionmanager.transactioncCst�dSr?rQrYr=r=r>r�.szbundletransactionmanager.closecCst�dSr?rQrYr=r=r>�release1sz bundletransactionmanager.releaseN)r[r\r]r�r�r�r=r=r=r>r�*sr�Fcs"tj|�||d�}|\}}}	|sRz|r0t�|�WntyDYn0|g�jfSt|���fdd�|	D�}	d�d����}
|s�|
�sj|�dd�}d|vo�d|v}|o���	d	�o���	d�}
|
�r,��
��L}|�d	d
||	tj
|dd�d
d����}t�||��|�}�Wd�n1�s0Y�n��	d	��r|��
��(}|�d	d
||	d����}Wd�n1�sp0Yn�|du�r؈�	d��s؈�
��&}|�d|d
d����}Wd�n1�s�0Yd}	nB��
��(}|�d||	d
d����}Wd�n1�s0Y|
�r&d}nd}t�||||�}�|�rHd�|
�sjt|j|j|�}
�|��}|
�rx|
��}
|
j�||	�}��rdd���jd�D�}��
��$}|�dddi���}Wd�n1�s�0Ytj��d|d�}t�|_t�||����fdd�}|
||fS)aDobtains a bundle of changes incoming from peer

    "onlyheads" restricts the returned changes to those reachable from the
      specified heads.
    "bundlename", if given, stores the bundle to this file path permanently;
      otherwise it's stored to a temp file and gets deleted again when you call
      the returned "cleanupfn".
    "force" indicates whether to proceed on unrelated repos.

    Returns a tuple (local, csets, cleanupfn):

    "local" is a local repo from which to obtain the actual incoming
      changesets; it is a bundlerepo for the obtained bundle when the
      original "peer" is remote.
    "csets" lists the incoming changeset node ids.
    "cleanupfn" must be called without arguments when you're done processing
      the changes; it closes both the original "peer" and the one returned
      here.
    )�heads�forcecsg|]}|�vr|�qSr=r=)r�r`)�	commonsetr=r>r�VrGz$getremotechanges.<locals>.<listcomp>Nsdevelslegacy.exchangesbundle2sbundle1s	getbundlesincomingsclient)ZroleT)�source�common�headss
bundlecapsscg)r�r�r�schangegroupsubsetr�)snodesr�)sbasesr�r�sHG10BZr�cSsg|]}|���qSr=r�r�r=r=r>r��rGslistkeyss	namespacer)rpr�cs&�r����rt������dSr?)r�r�r�r=)r#�
bundlerepor�r=r>�cleanup�s

z!getremotechanges.<locals>.cleanup) rZfindcommonincomingr�r��OSErrorr�r&�localZ
configlistZcapableZcommandexecutorZcallcommandrZ
caps20to10�resultrZwritechunksZ_forwardchunksrZwritebundler�Zbaseui�rootr�r�r	Zfindmissingr�Z
pulloperationr�Z	trmanagerZ_pullapplyphases)r�r�r�Z	onlyheadsr�r��tmp�commonZincomingZrheadsrZlegexcZforcebundle1Z
canbundle2r<�b2r|ZcgZ
bundletypeZcsetsZ	reponodesZremotephasesZpullopr�r=)r#r�r�r�r>�getremotechanges5s�

��
���

�,
��*
��(
��(	
�
��(�r�)NN)NNF)3r�Z
__future__rr�r�Zi18nrr4rr�rrr	r
rrr
rrrrrrrrrrrrr Zutilsrrrbrr_rerdroZ	localpeerrqZ
phasecachertrh�objectr~r�r�r�r�r=r=r=r>�<module>s,Tw(

Q
"&�

Youez - 2016 - github.com/yon3zu
LinuXploit