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: //proc/self/root/lib64/python2.7/site-packages/mercurial/repair.pyc
�
1�3\c@@s<ddlmZddlZddlZddlmZddlmZmZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZddlmZeed�Zd	�Zd
�Zd�Zd�Zed
d�Zd�Zdefd��YZded�Z!d�Z"d�Z#d�Z$d�Z%dS(i(tabsolute_importNi(t_(thextshort(
tbundle2tchangegroupt	discoveryterrortexchangetobsoletetobsutiltphasestpycompattutil(t
stringutilcC@sLd}|j}|j|�s.|j|�n|jd||�}	td�|	D��}
tjdj|
��j�}d|t	|�t
|d �|f}tj|�}
d}|
dkr�d}|r�d	}q�n|r�d
}nd}tj|d|d
|�}i|
d6|d6td6}tj|j|d|||||d|�S(s8create a bundle with the specified revisions as a backupsstrip-backups%ln::%lncs@s|]}|j�VqdS(N(R(t.0tc((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pys	<genexpr>.sts%s/%s-%s-%s.hgit01tHG20tBZtHG10BZtHG10UNtmissingrootstmissingheadss
cg.versiontobsolescenceRtstriptcompressionN(tvfstisdirtmkdirtsettsortedthashlibtsha1tjointdigestRRRtlocalversiontNoneRtoutgoingtTrueRtwritenewbundletui(trepotbasestheadstnodetsuffixtcompressRt	backupdirRt
allcommitst	allhashest	totalhashtnamet	cgversiontcompt
bundletypeR'tcontentopts((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pytbackupbundle#s2		
cC@sMt�}x7tj|t|��D]}|j||j��q"Wt|�S(s+find out the filelogs affected by the strip(RRtxrangetlentupdatetfilesR (R+tstriprevR>tx((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt
_collectfilesGs	cC@s5|j|�\}}g|D]}|j|�^qS(N(t
getstrippointtlinkrev(trevlogR?Rt	brokensettr((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt_collectrevlogPscC@st|jjd�|�S(NR(RGtmanifestlogt
getstorage(R+R?((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt_collectmanifestTscC@sSt�}|jt||��x-|D]%}|jt|j|�|��q&W|S(s<return the changesets which will be broken by the truncation(RR=RJRGtfile(R+R>R?tstfname((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt_collectbrokencsetsWs
	
#tbackupc*@s�|j�dk	r$tjd��n|dkr9t}n|j�}|j�|j}t|t	�rs|g}ng|D]}|j
|�^qz}t|�}t||�}	t
||	|�}
t|��t|
�}x�|jd|d�D]z}t�fd�|j|�D��r,�j|�n|�kr�|
j|�|j|j|��|j|�q�q�Wg|D]}|j|�^qv}|
r�t|j|
��}
|
j|
�ng|
D]}|j|�^q�}g�D]}|j|�^q�}d }}|jjdd�r4tj||�}n|rqgt|j�D]\}}||krJ|^qJ}n|jd	���}|r�||j�j�}nd
}|j}g}x>|D]6}|||j
�}|�kr�|j|�q�q�Wd}|j}|d}|r}t |||j!�||�}|jj"t#d�|j$|��|jj%d
d|j$|��nd}|r�t ||||ddtdt�}n|j&���y!|j'd��0}t(|j)�}|j*�|j+||�t,||||	�x'|	D]}|j-|�j+||�qW|j.�x�t/j0|t(|j)��D]i}|j)|\}}} |j1|ddt2��}!|!j3|�WdQX|dkr^|j4j5|�q^q^Wt6|j|�|`|j7�|j8j9|�WdQX|r|j:t#d��|j;|d�}"t<j=||"||�}#|jj>s`|jj?�nd|j$|�}$d}%t|#t@jA�s�dtBjC|$�}%n|j'|%��&}t@jD||#|ddd|$�WdQX|jj>s�|jjE�n|"jF�n|j'd��C}g|D]}|||j�f^q}&|jG|||&�WdQXx�|jH�D]w\}'}(y|'jI|(�WqbtJk
r�})|)jKtKjLkr�|jMt#d�|'j$|(�tNjO|)�f�q�qbXqbWWn||r
|jMt#d�|j$|��n|rV|jMt#d�|j$|��|jMt#d�|j$|��n�nX|rs|jI|�nWdQX|jP�|S(!Ns&cannot strip from inside a transactiontnoneRtstartic3@s|]}|�kVqdS(N((Rtp(ttostrip(s6/usr/lib64/python2.7/site-packages/mercurial/repair.pys	<genexpr>�stdevelsstrip-obsmarkerssmax(parents(%ld) - (%ld))t.i����ssaved backup bundle to %s
R:ttempR0Rtat
checkambigisadding branch
trbsbundle:sstrip
%stsourceturltrepairserror removing %s: %s
s+strip failed, backup bundle stored in '%s'
s1strip failed, unrecovered changes stored in '%s'
sG(fix the problem, then recover the changesets with "hg unbundle '%s'")
(RPR((QtcurrenttransactionR&RtProgrammingErrortFalset
unfilteredt
destroyingt	changelogt
isinstancetstrtrevtminRARNRtrevstanyt
parentrevstaddtdifference_updateR.tdescendantsR*t
configboolR
texclusivemarkerst	enumeratetobsstoretfirstt
_bookmarkstappendRR:R-tstatusRR#tlogtuninterruptablettransactionR<t_entriest
startgroupRt
stripmanifestRKtendgroupRR;tsvfsR(ttruncatetstoretmarkremovedtdeleteobsmarkerstinvalidatevolatilesetst_phasecachet
filterunknowntnotetopenRt
readbundletverboset
pushbufferRt
unbundle20R
thidepasswordtapplybundlet	popbuffertclosetapplychangest	undofilestunlinktOSErrorterrnotENOENTtwarnRtforcebytestrt	destroyed(*R*R+tnodelistROttopictclR.t	striplistR?R>tsaverevst	saveheadsRFRlt	savebasest
stripbaseststripobsidxt
obsmarkerstitmtnewbmtargettbmtupdatebmRet
backupfileRt
tmpbundlefilettrtoffsettfnRKttroffsettignoretfptftgenttmpbundleurlttxnnamet	bmchangestundovfstundofilete((RSs6/usr/lib64/python2.7/site-packages/mercurial/repair.pyRas�	
	"	%
"""
	
	




"


)#
c	@s��j�jj�t�fd�|D��}d}t�j|||tj|��}||}|r�djt�fd�|D���}|j	t
d�|�ng�jd|�D]}|j�^q�S(sDreturn list of roots of nodes where descendants are covered by nodesc3@s|]}�|�VqdS(N((Rtn(ttorev(s6/usr/lib64/python2.7/site-packages/mercurial/repair.pys	<genexpr>ss5%ld - ( ::( (roots(%ld):: and not _phase(%s)) -%ld) )s, c3@s%|]}t�|j��VqdS(N(RR.(RR�(R+(s6/usr/lib64/python2.7/site-packages/mercurial/repair.pys	<genexpr>ss9warning: orphaned descendants detected, not stripping %s
s
roots(%ld)(R`RbReRRgRtinternalR#R R�RR.(	R*R+tnodesRgtrevsetRStnotstriptnodestrR((R+R�s6/usr/lib64/python2.7/site-packages/mercurial/repair.pytsafestriprootss$
%t
stripcallbackcB@s)eZdZd�Zd�Zd�ZRS(s(used as a transaction postclose callbackcC@s7||_||_||_|p$d|_g|_dS(NRO(R*R+ROR�R�(tselfR*R+ROR�((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt__init__$s
			cC@s|jj|�dS(N(R�textend(R�R�((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pytaddnodes+scC@sJt|j|j|j�}|rFt|j|j||j|j�ndS(N(R�R*R+R�RROR�(R�R�troots((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt__call__.s(t__name__t
__module__t__doc__R�R�R�(((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyR�!s		cC@s�|j�}|s@t|||�}t|||d|d|�S|jd�}|dkr�t||d|d|�}|jd|�n|r�||_n|j|�dS(silike strip, but works inside transaction and won't strip irreverent revs

    nodelist must explicitly contain all descendants. Otherwise a warning will
    be printed that some nodes are not stripped.

    Will do a backup if `backup` is True. The last non-None "topic" will be
    used as the backup topic name. The default backup topic name is "backup".
    ROR�s�stripN(	R]R�RtgetpostcloseR&R�taddpostcloseR�R�(R*R+R�R�ROR�R�tcallback((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pytdelayedstrip3s	cC@s9|jjd�}|j||�t||||�dS(NR(RHRIRt
striptrees(R+R?R�R>RD((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyRzJscC@s�d|jkrxm|jj�D]Y\}}}|jd�r|jd�r|dd!}|jj|�j||�qqWndS(Nttreemanifestsmeta/s00manifest.iii�(trequirementsR~t	datafilest
startswithtendswithRHRIR(R+R�R?R>t	unencodedtencodedtsizetdir((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyR�Os
cC@s�|j�}d|jkr2|jtd��dS|j���|jj}d|krZnt|j�}t�}t�}|j	td�dtd�dt
|��}x�|D]�}|j|�||}x�|j�D]}}	|	|kr�q�n|j
|	�d	|	}
d
|	}|jj|
�r4|j
|
�n|jj|�r�|j
|�q�q�Wq�W|j�d|jkr�xrtj|�D]^}d|}
d
|}|jj|
�r�|j
|
�n|jj|�r�|j
|�q�q�Wnt
||�}
t
||�}x/t||�D]}|jtd�|�qWx/t||�D]}|jtd�|�qOW|
s||r�|jtd�|
|f�||_t|_|jd��}|j|�WdQXn|jtd��WdQXdS(stRebuilds the fncache file from repo history.

    Missing entries will be added. Extra entries will be removed.
    tfncachesE(not rebuilding fncache because repository does not support fncache)
Nt
irrelevantt
rebuildingtunitt
changesetsttotals	data/%s.is	data/%s.dR�smeta/%s/00manifest.ismeta/%s/00manifest.dsremoving %s
s
adding %s
s(%d items added, %d removed from fncache
sfncache already up to date
(R`R�R�RtlockR~R�RtentriestmakeprogressR<R=R>Rjt_existstcompleteR
tdirsR twriteR(t_dirtyRw(R*R+tfnct
oldentriest
newentriest	seenfilestprogressRetctxR�R�tdR�taddcounttremovecountRRR�((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pytrebuildfncacheXsb
		








		c	C@s�|s
dSg}|j}d}xCt|�D]5\}}||krT|d7}q,n|j|�q,W|jdddt�}x-tj|t|j�D]}|j|�q�W|j	�|S(s�Delete some obsmarkers from obsstore and return how many were deleted

    'indices' is a list of ints which are the indices
    of the markers to be deleted.

    Every invocation of this function completely rewrites the obsstore file,
    skipping the markers we want to be removed. The new temporary file is
    created, remaining markers are written there and on .close() this file
    gets atomically renamed to obsstore, thus guaranteeing consistency.NiiRptwt
atomictemp(
t_allRoRsR|R(R	t
encodemarkerst_versionR�R�(	RptindicestlefttcurrentR�R�R�tnewobsstorefiletbytes((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyR��s
	

(&t
__future__RR�R!ti18nRR.RRRRRRRRR	R
RRR
tutilsRR(R:RARGRJRNRR�tobjectR�R&R�RzR�R�R�(((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt<module>	s(F#					
�					H