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

�]Lb�I�@sddlmZddlZddlmZddlmZmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZddlmZmZmZ	d)d	d
�Zdd�Zd
d�Zdd�Zd*dd�Zd*dd�Zdd�Z dd�Z!dd�Z"Gdd�de#�Z$d+dd�Z%d d!�Z&d"d#�Z'd,d%d&�Z(d'd(�Z)dS)-�)�absolute_importN�)�_)�hex�short)
�bundle2�changegroup�	discovery�error�exchange�obsolete�obsutil�pathutil�phases�pycompat�requirements�scmutil�util)�hashutil�
stringutil�urlutilTcCs�d}|j}|�|�s|�|�|�d||�}	tdd�|	D��}
t�d�|
����}d|t	|�t
|dd��|f}t�|�}
d}|
d	krKd
}|rJd}n|rPd}nd
}t
j|||d�}|
|dd�}tj|j|d||||||d�	S)z8create a bundle with the specified revisions as a backupsstrip-backups%ln::%lncss�|]}|��VqdS�N)r��.0�c�r�2/usr/lib/python3/dist-packages/mercurial/repair.py�	<genexpr>4��zbackupbundle.<locals>.<genexpr>�s%s/%s-%s-%s.hgN�s01sHG20sBZsHG10BZsHG10UN)�missingroots�ancestorsofT)s
cg.versionsobsolescencesphases�strip)�compression)�vfs�isdir�mkdir�set�sortedr�sha1�join�digestrrr�localversionr	�outgoingr�writenewbundle�ui)�repo�bases�heads�node�suffix�compress�obsolescence�	backupdirr%�
allcommits�	allhashes�	totalhash�name�	cgversion�comp�
bundletyper.�contentoptsrrr�backupbundle(sN

�
���rAcCs6t�}t�|t|��D]}|�||���qt|�S)z+find out the filelogs affected by the strip)r(r�xrange�len�update�filesr))r1�striprevrE�xrrr�
_collectfiles[srHcs ��|�\}}�fdd�|D�S)Nc�g|]}��|��qSr)�linkrev�r�r��revlogrr�
<listcomp>g�z"_collectrevlog.<locals>.<listcomp>)�
getstrippoint)rNrFr�	brokensetrrMr�_collectrevlogesrScCsHt�}t|�D]
}|�t||��q|D]
}|�t|�|�|��q|S)z<return the changesets which will be broken by the truncation)r(�manifestrevlogsrDrS�file)r1rErF�srN�fnamerrr�_collectbrokencsetsjsrX�backupc$s^���durt�d��|dvrd}��������j}�j�j�t|t	�r*|g}�fdd�|D�}t
|�}t�|�}t�||�}	t
|��t
|	�}
�j|dd�D]+}t�fdd	���|�D��rg��|�|�vr}|	�|�|
���|��|
�|�qR�fd
d�|
D�}
|	r�t
��|	��}|	�|��fdd�|	D�}
�fdd��D�}d
}��j�dd�r�t��|���rƇfdd�t�j�D�}t���\�}d}|d}|r�t�|||�}d}|
r�t�|
|
|dddd�}|������zp��d���}t
|j� ��}|�!|j"�|�#���$||�t%�|||�|D]}��&|��$||��q|�'�|�(�}|D]5\}}||v�r;�q0�j)|ddd��
}|�*|�Wd�n	1�sTwY|dk�rd�j+�,|��q0t-�j|��`��.��j/�0��Wd�n	1�s�wY|�r�|�1t2d��|�3|d�}t4�5||||�}�jj6�s��j�7�nt8�9�}|�?d|�:|�}d}t|t;j<��s�dt=�>|�}��|��}t;j?�||d|d�Wd�n	1�s�wYWd�n	1�s�wY|�@���d��}��fdd�|D�} �j�A�|| �Wd�n	1�swY��B�D]8\}!}"z|!�C|"�W�q(tD�y`}#z|#jEtEjFk�rU|�Gt2d �|!�:|"�tH�I|#�f�WYd}#~#�q(d}#~#wwWn.|�ru|�Gt2d!�|�:|��|�r�|�Gt2d"�|�:|��|�Gt2d#�|�:|���|�r�|�C|�Wd�n	1�s�wY��J�|S)$Ns&cannot strip from inside a transaction)snoner#FcrIr)�rev)rr4��clrrrO�rPzstrip.<locals>.<listcomp>r)�startc3s�|]}|�vVqdSrr)r�p)�tostriprrr�rzstrip.<locals>.<genexpr>crIr�r4rKr[rrrO�rPcrIrr`rKr[rrrO�rPcrIrr`rKr[rrrO�rPrsdevelsstrip-obsmarkerscsg|]
\}}|�vr|�qSrr)r�i�m)�
obsmarkersrrrO�s���stemp)r6r7r#�aT)�
checkambigrsadding branch
srbsbundle:sstrip
%s)�source�urlsrepairc�g|]
}|����f�qSrr`�rrb��newbmtargetr1rrrO�serror 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'")
)K�currenttransactionr
�ProgrammingError�
unfiltered�
destroyingr%�
_bookmarks�	changelog�
isinstance�bytes�minrHrXr(�revs�any�
parentrevs�add�difference_update�descendantsr0�
configboolr
�exclusivemarkers�	enumerate�obsstore�_bookmarkmovements�_createstripbackuprA�uninterruptible�transaction�
_offsetmap�keysrD�	_newfiles�
startgroup�strip�
stripmanifestrU�endgroup�readjournal�svfs�truncate�store�markremoved�deleteobsmarkers�invalidatevolatilesets�_phasecache�
filterunknown�noter�openr�
readbundle�verbose�silentr�nullcontextmanagerr+r�
unbundle20r�hidepassword�applybundle�close�applychanges�	undofiles�unlink�OSError�errno�ENOENT�warnr�forcebytestr�	destroyed)$r0r1�nodelist�backup�topicr%�	striplistrFrE�saverevs�	saveheadsrLr|�	savebases�
stripbases�stripobsidx�updatebm�
backupfiler4�
tmpbundlefile�tr�oldfiles�fn�entriesrU�troffset�fp�f�gen�maybe_silent�tmpbundleurl�txnname�	bmchanges�undovfs�undofile�er)r\rlrcr1r_rr�vs*


	


�

��

�
�����
�����������
�������
��br�cs�dd���d|�D�}|sdSd}|r|d}t�|||�}t�|�\�}��d��$}	t��|	tj|���fdd�|D�}
�j��|	|
�Wd�|S1sQwY|S)z/perform a "soft" strip using the archived phasecS�g|]}|���qSrr`rrrrrO8�zsoftstrip.<locals>.<listcomp>ssort(%ln::)Nrr#crirr`rjrkrrrODrm)	r(r�r�r�r�retractboundary�archivedrrr�)r0r1r�r�r�r_r�r4r�r�r�rrkr�	softstrip6s 
��r�cCst|j}g}|D]}|||��}||vr|�|�qd}|r6|�d||�}|r4||����}||fSd}||fS)Nsmax(parents(%ld) - (%ld))�.)rrrZ�appendrw�firstr4)r1r_�bmr�rbrZrlrrrr�Is
��r�cCsT|j}|j}t|||��||�}|j�td�|�|��|j�dd|�|��|S)Nssaved backup bundle to %s
sbackupbundle)	r%rsrAr3r0�statusrr+�log)r1r�r4r�r%r\r�rrrr�_s�r�cs����jj��fdd�|D�}d}t��|||tj|��}||}|r:d�t�fdd�|D���}|�	t
d�|�dd	���d
|�D�S)zDreturn list of roots of nodes where descendants are covered by nodescsh|]}�|��qSrr�r�n)�torevrr�	<setcomp>nr�z!safestriproots.<locals>.<setcomp>s5%ld - ( ::( (roots(%ld):: and not _phase(%s)) -%ld) )s, c3s �|]}t�|���VqdSr)rr4r�)r1rrrws�z!safestriproots.<locals>.<genexpr>s9warning: orphaned descendants detected, not stripping %s
cSr�rr`rrrrrO|r�z"safestriproots.<locals>.<listcomp>s
roots(%ld))rprsrZr(rwr�internalr+r)r�r)r0r1�nodesrw�revsetr_�notstrip�nodestrr)r1r�r�safestriprootsks��r�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
stripcallbackz(used as a transaction postclose callbackcCs&||_||_||_|pd|_g|_dS)NrY)r0r1r�r�r�)�selfr0r1r�r�rrr�__init__�s


zstripcallback.__init__cCs|j�|�dSr)r��extend)r�r�rrr�addnodes�szstripcallback.addnodescCs6t|j|j|j�}|rt|j|j||j|j�dSdSr)r�r0r1r�r�r�r�)r�r��rootsrrr�__call__�s�zstripcallback.__call__N)�__name__�
__module__�__qualname__�__doc__r�r�r�rrrrr�s
r�cCsp|��}|st|||�}t|||||d�S|�d�}|dur,t||||d�}|�d|�|r1||_|�|�dS)ailike 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".
    )r�r�s�stripN)rnr�r��getpostcloser��addpostcloser�r�)r0r1r�r�r�r�r��callbackrrr�delayedstrip�s	
r�cCst|�D]}|�||�qdSr)rTr�)r1rFr�rErNrrrr��s�r�ccsf�|j�d�Vt�|�r/|j��D]\}}}|�d�r.|�d�r.|dd�}|j�|�VqdSdS)Nrsmeta/s00manifest.i�i�)�manifestlog�
getstorager�istreemanifestr��	datafiles�
startswith�endswith)r1�t�	unencoded�size�dirrrrrT�s�
���rTFc	Cs�|��}tj|jvr|�td��dS|����F|jj}|j|jd�t	|j
�}t	�}t	�}|rh|D]3}|dd�dkrf|dd�dkrf|�|dd��|�|�|dd�d}|j�|�rf|�|�q3nO|j
td	�td
�t|�d�}	|D]:}
|	�|
�||
}|��D]*}||vr�q�|�|�d|}d
|}
|j�|�r�|�|�|j�|
�r�|�|
�q�qx|	��tj|jvr�t�|�D] }d|}d|}
|j�|�r�|�|�|j�|
�r�|�|
�q�t||�}t||�}t||�D]}|�td�|�q�t||�D]}|�td�|��q|�s|�rG|�td�||f�||_
d|_|�d��
}|�|�Wd�n	1�sAwYn|�td��Wd�dSWd�dS1�sbwYdS)ztRebuilds the fncache file from repo history.

    Missing entries will be added. Extra entries will be removed.
    sE(not rebuilding fncache because repository does not support fncache)
N)r�r�sdata/���s.is.ds
rebuildings
changesets)�unit�totals	data/%s.is	data/%s.dsmeta/%s/00manifest.ismeta/%s/00manifest.dsremoving %s
s
adding %s
s(%d items added, %d removed from fncache
Tsfncachesfncache already up to date
)rpr�FNCACHE_REQUIREMENTr�r�lockr��fncache�ensureloadedr(r�rz�_exists�makeprogressrCrDrE�complete�TREEMANIFEST_REQUIREMENTr�dirsr)�write�_dirtyr�)r0r1�	only_data�fnc�
oldentries�
newentries�	seenfilesr��dataf�progressrZ�ctxra�dr��addcount�removecountr^r�rrr�rebuildfncache�s���
 

���



��

�������$rc	Cs�|sdSg}|j}d}t|�D]\}}||vr|d7}q|�|�q|jdddd�}t�|d|j�D]}|�|�q2|��|S)a�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.Nrrsobsstore�wT)�
atomictemp)	�_allrr�r�r�
encodemarkers�_versionr�r�)	r��indices�left�currentr�rarb�newobsstorefilerurrrr�s
r�)TT)TrY)NT)F)*�
__future__rr��i18nrr4rr�rrr	r
rrr
rrrrrr�utilsrrrrArHrSrXr�r�r�r�r��objectr�r�r�rTrr�rrrr�<module>s.<
�3


A


\

https://t.me/RX1948 - 2025