HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //lib64/python2.7/site-packages/mercurial/bundlerepo.pyo
�
1�3\c@@s�dZddlmZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZdejfd	��YZd
eejfd��YZdeej fd
��YZ!dejfd��YZ"dej#fd��YZ$dej%fd��YZ&d�Z'de(fd��YZ)ddd�Z+d�Z,de(fd��YZ-dde.d�Z/dS(s�Repository class for viewing uncompressed bundles.

This provides a read-only repository interface to bundles as if they
were part of the actual repository.
i(tabsolute_importNi(t_(tnullid(tbundle2tchangegroupt	changelogtcmdutilt	discoverytencodingterrortexchangetfilelogt	localrepotmanifesttmdifftnodetpathutiltphasestpycompattrevlogtutiltvfstbundlerevlogcB@sbeZd�Zd	d�Zd�Zd	ed�Zd�Zd�Z	d�Z
d�Zd�ZRS(
c	C@s�tj|�}tjj|||�||_t|�}|d|_t�|_xy|j	�D]k}|\}}}	}
}}}
t|�}|j
�|}||
�}||jkr�|jj|j|�q`nxD||	fD]6}||jkr�t
j||jtd���q�q�W||jkrIt||jtd���n|j|�}tj||
�|d|||j|�|j|	�|f}|jj|�||j|<|jj|�|d7}q`WdS(Nisunknown parentsunknown delta basei����(tvfsmodtreadonlyvfsRt__init__tbundletlent
repotiprevtsett
bundlerevst	deltaiterttelltnodemaptaddR	tLookupErrort	indexfileRtrevtoffset_typetindextappend(tselftopenerR$t
cgunpackert
linkmappertnt	deltadataRtp1tp2tcst	deltabasetdeltatflagstsizetstarttlinktptbaserevte((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR-s8	
!
cC@sT||jkr"tjj||�S|jj|j|��|jj|j|��S(N(RRt_chunkRtseekR6treadtlength(R)R%tdf((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR;YscC@s�||jkrK||jkrK|j|d}||kr|j|�Sn4||jkr||jkrtjj|||�Stj|j|dt�|j|dt��S(s1return or calculate a delta between two revisionsitraw(	RR'R;RtrevdiffRttextdifftrevisiontTrue(R)trev1trev2trevb((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRAbscC@sst|t�r'|}|j|�}n|}|j|�}|tkrLdSd}g}|}x^||jkr�|jr�|jd|kr�|jd}Pn|j|�|j	|d}qaW|dkr�|j
|�}nx4|r|j|j��}	t
j||	g�}q�W|j||j|�dd|�\}
}|r]|j|
|d|�n|||f|_|
S(	sTreturn an uncompressed revision of a given node or revision
        number.
        tiiiR=R@R%N(t
isinstancetintRR%RtNoneRt_revisioncacheR(R'tbaserevisionR;tpopRtpatchest
_processflagsR4t	checkhash(R)t	nodeorrevt_dfR@R%RtrawtexttchaintiterrevR3ttexttvalidatehash((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRCos6

	cC@stjj||dt�S(NR@(RRCRD(R)RR((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRM�scO@s
t�dS(N(tNotImplementedError(R)targstkwargs((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pytaddrevision�scO@s
t�dS(N(RY(R)RZR[((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pytaddgroup�scO@s
t�dS(N(RY(R)RZR[((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pytstrip�scC@s
t�dS(N(RY(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyt	checksize�sN(
t__name__t
__module__RRKR;RAtFalseRCRMR\R]R^R_(((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR,s	,		
&				tbundlechangelogcB@seZd�Zd�ZRS(cC@s<tjj||�d�}tj|||j||�dS(NcS@s|S(N((tx((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyt<lambda>�RH(RRRR$(R)R*R+R,((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR�s	cC@s@|j}z&d|_tjj||dt�SWd||_XdS(NR@((tfilteredrevsRRCRD(R)RRt	oldfilter((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRM�s
		(R`RaRRM(((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRc�s	tbundlemanifestcB@s)eZddd�Zd�Zd�ZRS(RHcC@s�tjj||d|�tj|||j||�|dkrni}|jjdkrnt|j�}qnn||_	||_
dS(Nttreet03(R
tmanifestrevlogRRR$RKRtversiont_getfilestartst
_dirlogstartst_linkmapper(R)R*R+R,tdirlogstartstdir((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR�s	cC@si|}t|t�r'|j|�}n||jkrJd|j|}ntjj||dt�}|S(Ns%sR@(RIRJRt
fulltextcacheR
RkRCRD(R)RRRtresult((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRM�scC@sa||jkrK|jj|j|�t|j|j|j|jd|�Stt|�j|�S(NRq(RnRR<RhR*Rotsupertdirlog(R)td((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRu�sN(R`RaRKRRMRu(((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRh�s	t
bundlefilelogcB@seZd�Zd�ZRS(cC@s5tjj|||�t||j||�|_dS(N(RRRR$t_revlog(R)R*tpathR+R,((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR�scC@stjj||dt�S(NR@(RRCRD(R)RR((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRM�s(R`RaRRM(((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRw�s	t
bundlepeercB@seZd�ZRS(cC@stS(N(Rb(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pytcanpush�s(R`RaR{(((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRz�stbundlephasecachecB@s,eZd�Zd�Zd�Zd�ZRS(cO@sGtt|�j||�tj|d�rCtj|j�|_ndS(NR*(RtR|RRtsafehasattrRRR*(R)RZR[((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR�scC@s
t�dS(N(RY(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pytwrite�scC@s
t�dS(N(RY(R)tfp((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyt_write�scC@s$||j|<|j�t|_dS(N(t
phaserootst
invalidateRDtdirty(R)tphasetnewrootsttr((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyt_updateroots�s

(R`RaRR~R�R�(((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR|�s			c@sdi}xWt�ji�D]C}|d}�j�||<x t�fd�i�D]}qRWqW|S(Ntfilenamec@s
�jd�S(N(t
deltachunkRK((R+(s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRe�RH(titert
filelogheaderR (R+tfilespost	chunkdatatfnametchunk((R+s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRm�s
tbundlerepositorycB@s�eZdZd�Zd�Zdd�Zejd��Zejd��Z	ejd��Z
d�Zejd	��Zejd
��Z
d�Zd�Zd
�Zd�Zd�Zd�Zed�ZRS(s%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	C@s�||_||_|jjddtd�d|_tj|d�}t	j
|j||�}t|tj
�r||_d|_d}xW|jdt�D]C}|jdkr�|r�td��n|}n|j||�q�W|stjtd���n|jd	tj�n�t|tj�r�|j�rp|j|jd
dd�}t	j
|j|||j �}n||_||_ntjtd
�t|���i|_!|j"j#d|_$t%j&|dt%j'g||j$D]}|j(�^q��dS(NRtpublisht
bundlerepotrbtseekableRs#can't process multiple changegroupssNo changegroups foundis.hg10untheadertHG10UNsbundle type %s cannot be readi()t_tempparentt_urltuit	setconfigRbRKttempfileRt	posixfileR
t
readbundleRIRt
unbundle20t_bundlefilet_cgunpackert	iterpartsRDttypeRYt_handlebundle2partR	tAbortRR<tostSEEK_SETRtcg1unpackert
compressedt_writetempbundleR=Rt_cgfilesposRRtfirstnewrevRtretractboundarytdraftR(	R)t
bundlepathturlt
tempparenttfRtcgparttparttctx((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRs@							!		cC@s�|jdkrdS|}|jjdd�}tj|�}||krktd�}tj||��n|j�r�|j	|j
d|�}ntj||d�|_dS(NRRlt01s#Unsupported changegroup version: %ss.cg%suntUN(
R�tparamstgetRtsupportedincomingversionsRR	R�R�R�R=tgetunbundlerR�(R)RR�tcgstreamRltlegalcgverstmsg((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR�DsRHcC@s�|jjddd|�\}}||_tj|d��D}|j|�x-tr{|d
�}|skPn|j|�qOWWdQX|jj|jdd	�S(s'Write a temporary file to disk
        tprefixs
hg-bundle-tsuffixtwbiiNtmodeR�i(RtmkstempR�R�tfdopenR~RDtopen(R)treadfnR�R�tfdtempttemptfptempR�((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR�Ss	
	cC@st||j�S(N(R|t_phasedefaults(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyt_phasecachedscC@s8|jj�t|j|j�}|jj�|_|S(N(R�tchangelogheaderRctsvfsR tmanstart(R)tc((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRhs
cC@sr|jj|j�|jj�|j�jj}t|j|j|�}|jj	�|_
tj|j||�S(N(
R�R<R�tmanifestheadert
unfilteredRR%RhR�R t	filestartR
tmanifestlog(R)R,t	rootstore((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR�ps
cC@sP|jj|j�|jj�x|jj�D]}q0W|jj�|_dS(sgConsumes the manifest portion of the bundle, setting filestart so the
        file portion can be read.N(R�R<R�R�RR R�(R)R3((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyt_consumemanifest{s

cC@s|j|jS(N(RR�(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR��scC@s*|jd|jkr#|j�n|jS(NR�(R�t__dict__R�R�(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR��s
cC@s|jS(N(R�(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR��scC@s�|js1|jj|j�t|j�|_n||jkr�|jj|j|�|j�jj}t|j	||j|�St
t|�j|�SdS(N(
R�R�R<R�RmR�RR%RwR�RtR�tfile(R)R�R,((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR��s	cC@sU|jj�|jdk	r2|jj|j�n|jrQtj|jt	�ndS(s'Close assigned bundle file immediately.N(
R�tcloseR�RKRtunlinkR�tshutiltrmtreeRD(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR��s

	cC@stS(N(Rb(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pytcancopy�scC@s
t|�S(N(Rz(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pytpeer�scC@s
tj�S(N(Rtgetcwd(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR��scC@s�|jj|�}|jj|�}td�}|jj|krb|jj|tj|��n|jj|kr�|jj|tj|��ntt	|�j
||�S(Ns9setting parent to node %s that only exists in the bundle
(RR%RRR�twarntnodemodthexRtR�t
setparents(R)R/R0tp1revtp2revR�((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR��s  (R`Rat__doc__RR�R�RtunfilteredpropertycacheR�RR�R�R�R�R�R�R�R�R�R�RR�(((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR�s"	5			
						cC@sL|rtjtd���n|jdd�}|sctjtj��}|dkrcd}qcn|r�tj�}||kr�d}q�t	j
|�}|j|�r�|t|�}q�nt
j|�}|j�}|jdkr/|jdd�}t|�dkr ||d}	}
q<|\}	}
n
||}	}
t||	|
�S(Ns#cannot create new bundle repositoryRtmainreporootRHt+ii(R	R�RtconfigRtfindrepoRR�RKRtnormasprefixt
startswithRRR�t	localpathtschemetsplittmakebundlerepository(R�Rytcreatetintentst
createoptst
parentpathtcwdtutstrepopatht
bundlename((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pytinstance�s.	
cC@s�|r"dtj|�|f}n
d|}y"tj||dt�}d}Wn`tjk
r�tj	�}ytj||dt
�}Wq�tk
r�tj
|��q�XnXdt|jfd��Y}||_tj||||�|S(s?Make a bundle repository object based on repo and bundle paths.sbundle:%s+%ss	bundle:%sR�tderivedbundlerepositorycB@seZRS((R`Ra(((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR��sN(Rt
expandpathRR�RbRKR	t	RepoErrorRtmkdtempRDt	ExceptionR�R�R�t	__class__R(R�R�R�R�trepoR�R�((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR��s"




	tbundletransactionmanagercB@s#eZd�Zd�Zd�ZRS(cC@sdS(N(RK(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyttransactionscC@s
t�dS(N(RY(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyR�scC@s
t�dS(N(RY(R)((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pytreleases(R`RaRR�R(((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyRs		c@s�tj|�d|d|�}|\}}}	|sqy|rLtj|�nWntk
r`nX|g�jfSt|�}
g|	D]}||
kr�|^q�}	d�d��j�}|s�|r|j	dd�}
d|
ko�d|
k}|o�j
d�o�j
d�}|r��j��p}|jdidd	6|d
6|	d6t
j|dd�d
6td6�j�}tj||j�|�}�WdQXn'�j
d�r��j��4}|jdidd	6|d
6|	d6�j�}WdQXn�|dkrQ�j
d�rQ�j��-}|jdi|d6dd	6�j�}WdQXd}	nB�j��4}|jdi|d6|	d6dd	6�j�}WdQX|r�d}nd}tj||||�}�|r�d�n|st|j|j|�}�|j�}qn|r|j�}n|jj||	�}�r�g��jD]}|j�^qE}�j��&}|jdidd6�j�}WdQXt
j��d|�}t �|_!t
j"||�n���fd�}|||fS(sDobtains 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.
    theadstforcetdevelslegacy.exchangeRtbundle1t	getbundletincomingtsourcetcommontroletclientt
bundlecapstcgNtchangegroupsubsetRtnodestbasestHG10BZR�tlistkeysRt	namespacec@s7�r�j�n�r)tj��n�j�dS(N(R�R�R�((RR�R�(s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pytcleanup�s

(#RtfindcommonincomingR�R�tOSErrorR�RRKtlocalt
configlisttcapabletcommandexecutortcallcommandR
t
caps20to10RDRsRtwritechunkst_forwardchunksRtwritebundleR�tbaseuitrootRR�RtfindmissingR�Rt
pulloperationRt	trmanagert_pullapplyphases(R�RR�t	onlyheadsR�RttmpRR	trheadst	commonsetRdRtlegexctforcebundle1t
canbundle2R:tb2R�Rt
bundletypetcsetsR�t	reponodestremotephasestpullopR((RR�R�s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pytgetremotechangess�	
%
				
		
&(0R�t
__future__RR�R�ti18nRRRRHRRRRRRR	R
RRR
RR�RRRRRRRRRcRkRhRwt	localpeerRzt
phasecacheR|RmtobjectR�RKR�R�RRbR5(((s:/usr/lib64/python2.7/site-packages/mercurial/bundlerepo.pyt<module>s&|{ 			�!	%