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

�]Lb7W�@s�ddlmZddlZddlmZddlmZddlmZddl	m
Z
mZmZm
Z
dZdZddd	�Zd
d�Zed�Zed
�Zed�Zed�ZGdd�de�ZdS)�)�absolute_importN�)�_)�short)�
stringutil)�error�pycompat�revlog�utilcCs>|���t||�}|��Wd�S1swYdS�N)�lock�verifier�verify)�repo�level�v�r�2/usr/lib/python3/dist-packages/mercurial/verify.pyrs

$�rcCs d|vr|�dd�}d|vs|S)Ns//�/)�replace)�frrr�	_normpath!s�rsChint: run "hg debugrebuildfncache" to recover from corrupt fncache
s7parent-directory manifest refers to unknown revision %ss1warning: copy source of '%s' not in parents of %ss5warning: %s@%s: copy source revision is nullid %s:%s
c@sneZdZddd�Zdd�Zddd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
	ddd�Zdd�Zdd�Z
dS)r
NcCs�|��|_|j|_|��|_|durt}||_t�|_d|_	d|_
t|j�dk|_
t|j�d��dk|_|jjtjk|_t�|��j�|_d|_d|_|j�dd�|_d|_dS)Nr�Fsverify�	skipflagsT)�
unfilteredr�ui�narrowmatch�match�VERIFY_DEFAULT�_level�set�badrevs�errors�warnings�len�	changelog�havecl�manifestlog�
getstorage�havemf�_format_versionr	�REVLOGV0�revlogv1r
�lrucachefunc�__getitem__�	lrugetctx�refersmf�
fncachewarned�	configint�	skipflags�warnorphanstorefiles)�selfrrrrr�__init__;s"


zverifier.__init__cCs"|j�|d�|jd7_dS)zrecord a "warning" level issue�
rN)r�warnr#)r5�msgrrr�_warnOszverifier._warncCsd|dur|j�|�d|}nd}d||f}|rd||f}|j�d|d�|jd7_dS)	zrecord a "error" level issueNs%d�?�%s: %ss%s@%s� r7r)r!�addrr8r")r5�linkrevr9�filenamerrr�_errTs
z
verifier._errcCs2t�|�}|st�|�}|�|d||f|�dS)z1record exception raised during the verify processr<N)r�forcebytestrr�bytereprrA)r5r?r9�instr@�fmsgrrr�_excas

z
verifier._exccCs�t|�s|js
|jr|�|td�|�dS|��}|dr+|�dtd�|d|�|dr<|�dtd�|d|�|jtjkrR|j	sP|�
td�|�dSdS|j	r`|�
td�|�dSdS)	z�verify high level property of a revlog

        - revlog is present,
        - revlog is non-empty,
        - sizes (index and data) are correct,
        - revlog's format version is correct.
        �empty or missing %sNrsdata length off by %d bytesrsindex contains %d extra bytess"warning: `%s' uses revlog format 1s"warning: `%s' uses revlog format 0)r$r&r)rAr�	checksizer*r	r+r,r:)r5�obj�namer?�drrr�_checkrevloghs��zverifier._checkrevlogc
Cs�|�|�|��}|dks|jrv||vrv|dks|t|jj�kr$td�}ntd�}|�d|||f|�|rt|r`t|�dkr`zg}|D]}|�|�|�	�|krT|�
|�qBWn	ty_Ynwtd�}|d�t
tj|��;}|�|�d}zC|�|�\}	}
|	|vr�|	|jjkr�td�t|	�t|�f}|�|||�|
|vr�|
|jjkr�td	�t|
�t|�f}|�|||�Wn ty�}z|�|td
�t|�||�WYd}~nd}~ww||vr�|�|td�|||f|�|||<|S)a
verify a single revlog entry

        arguments are:
        - obj:      the source revlog
        - i:        the revision number
        - node:     the revision node id
        - seen:     nodes previously seen for this revlog
        - linkrevs: [changelog-revisions] introducing "node"
        - f:        string label ("changelog", "manifest", or filename)

        Performs the following checks:
        - linkrev points to an existing changelog revision,
        - linkrev points to a changelog revision that introduces this revision,
        - linkrev points to the lowest of these changesets,
        - both parents exist in the revlog,
        - the revision is not duplicated.

        Return the linkrev of the revision (or None for changelog's revisions).
        rs)rev %d points to nonexistent changeset %ds(rev %d points to unexpected changeset %dNrs (expected %s)r=sunknown parent 1 %s of %ssunknown parent 2 %s of %sschecking parents of %ssduplicate revision %d (%d))r?�revr&r$rr%rrAr/�filenode�append�	Exception�join�mapr�bytestrr:�parents�nullidrrF)r5rI�i�node�seen�linkrevsr�lrr9�p1�p2rDrrr�_checkentry�sN

���
�(��zverifier._checkentryc	Cs4|j}|j}|���d�st�td���tj�	|�
d��r$|�td��|js*|j
s8|�td�|j
r4dp5d�|��\}}|�|�}~|�||�|�||�\}}|�td�t|j�||f�|jrn|�td	�|j�|jrv|�t�|jr�|�td
�|j�|jr�td�}|t|j�;}|�|�dSdS)z�verify the content of the Mercurial repository

        This method run all verifications, displaying issues as they are found.

        return 1 if any error have been encountered, 0 otherwise.sfile:s$cannot verify bundle or remote repossjournals-abandoned transaction found - run hg recover
s!repository uses revlog format %d
rrs2checked %d changesets with %d changes to %d files
s%d warnings encountered!
s!%d integrity errors encountered!
s+(first damaged changeset appears to be %d)
)rr�url�
startswithr�Abortr�os�path�exists�sjoinr8�verboser,�status�_verifychangelog�_verifymanifest�_crosscheckfiles�_verifyfilesr$r%r#r1�HINT_FNCACHEr"r!�min)	r5rr�
mflinkrevs�filelinkrevs�	filenodes�
totalfiles�
filerevisionsr9rrrr�sD��
��

zverifier.verifycCsJ|j}|j}|j}|j}|�td��i}i}i}|�|dd�|jtd�td�t|�d�}|D]l}	|�	|	�|�
|	�}
|�||	|
||	gd�z3|�|
�}|d|jj
krc|�|dg��|	�d|_|dD]}||�rx|�t|�g��|	�qgWq0ty�}
zd|_|�|	td	�t|
�|
�WYd
}
~
q0d
}
~
ww|��||fS)aIverify the changelog of a repository

        The following checks are performed:
        - all of `_checkrevlog` checks,
        - all of `_checkentry` checks (for each revisions),
        - each revision can be read.

        The function returns some of the data observed in the changesets as a
        (mflinkrevs, filelinkrevs) tuples:
        - mflinkrevs:   is a { manifest-node -> [changelog-rev] } mapping
        - filelinkrevs: is a { file-path -> [changelog-rev] } mapping

        If a matcher was specified, filelinkrevs will only contains matched
        files.
        schecking changesets
s	changelogr�checkings
changesets��unit�totalT�sunpacking changeset %sN)rrrr%rfrrL�makeprogressr$�updaterWr]�readrU�
setdefaultrOr0rrPrFr�complete)r5rrr�clrmrnrX�progressrV�n�changesrrDrrrrg�sB�


��&��zverifier._verifychangelogrc'sh|j}|j}|j}|jj}|�|�}	|s|j�td��i}
i}i}d}
|r7|}
|	��}|�|�|r7|�	�|j
rB|�|	j|
d�|j
td�td�t|	�d�}|	D]�}|s[|�|�|	�|�}|�|	|||��|g�|
�}|�vrv�|=n|r�td�t|�}|�|||
�n
|�|td�t|�|
�zW|�||�jd	d
�}|��D]F\}}}|s�|�|td��n|dkr�q�|t|�}|d
kr�|�|�s�q�|�|di�}|�|g��|�q�||�s�q�|
�|i��||�q�Wn!t�y
}z|�|td�t|�||
�WYd}~nd}~ww|jtk�rBz
|�||���}WqRt�yA}ztd�t|�}|�||||
�WYd}~qRd}~wwqR|�sJ|� �|j!�r��fdd��D�}t"|�D]&\}}|�ro|�|t#t|�|
��q[td�}|t|�;}|�|||
��q[|�s�|�r�|j�td��t$�}t$�}|j%}g} |j&j'| d�D]$\}!}}"|"dk�s�|�s�|�(d��r�|�)t|��|�)t*j+�,|���q�| D]
}|�dtd�|��q�|j
td�td�t|�d�}t-�.|�D]!\}#}$|�/|$|#||�}%t-�.|%�D]\}}&|
�|i��|&��q��q�|�s2|�r2|du�sJ�|� �|j0�r2t"|�D]}|�1td�|��q%|
S)a�verify the manifestlog content

        Inputs:
        - mflinkrevs:     a {manifest-node -> [changelog-revisions]} mapping
        - dir:            a subdirectory to check (for tree manifest repo)
        - storefiles:     set of currently "orphan" files.
        - subdirprogress: a progress object

        This function checks:
        * all of `_checkrevlog` checks (for all manifest related revlogs)
        * all of `_checkentry` checks (for all manifest related revisions)
        * nodes for subdirectory exists in the sub-directory manifest
        * each manifest entries have a file path
        * each manifest node refered in mflinkrevs exist in the manifest log

        If tree manifest is in use and a matchers is specified, only the
        sub-directories matching it will be verified.

        return a two level mapping:
            {"path" -> { filenode -> changelog-revision}}

        This mapping primarily contains entries for every files in the
        repository. In addition, when tree-manifest is used, it also contains
        sub-directory entries.

        If a matcher is provided, only matching paths will be included.
        schecking manifests
smanifestrrrs	manifestsrss#%s not in parent-directory manifests%s not in changesetsT)�shallowsentry without name in manifests	/dev/null�trsreading delta %sNsreading full manifest %scs"g|]
}�|D]}||f�qqSrr)�.0�m�c�rmrr�
<listcomp>�s"z,verifier._verifymanifest.<locals>.<listcomp>s'changeset refers to unknown revision %sschecking directory manifests
��undecodablesmeta/�cannot decode filename '%s'�warning: orphan data file '%s')2rrrr'r(rfr�files�difference_update�	incrementr0rL�_revlogrwr$rxrWr]�getrrA�	readdelta�iterentriesr�visitdirrzrOrPrFr�VERIFY_FULLryr{r)�sorted�WARN_PARENT_DIR_UNKNOWN_REVr r,�store�	datafilesr_r>rarb�dirnamer�	iteritemsrhr4r:)'r5rm�dir�
storefiles�subdirprogressrrr�mfl�mfro�subdirnodesrX�label�revlogfilesr}rVr~rZr9�mfdeltar�fn�fl�fullpath�sdnrD�changesetpairsr�r��subdirsr,r��t�size�subdirrY�subdirfilenodes�onefilenodesrr�rrhs�

�


�(�����
����zverifier._verifymanifestc		s|j}|j}|�td��t|�t|�}|jtd�td�|d�}|jrBt|�D]}|��||vrA||d}|�	|td�|�q(|j
r}t|�D]3}|��||vr|z|�|��t�fdd�||D��}Wnt
yrd}Ynw|�	|td	�|�qI|��dS)
Ns0crosschecking files in changesets and manifests
s
crosschecking�filesrsrs in changeset but not in manifestcsg|]
}����|���qSr)r?rM)r�r~�r�rrr��sz-verifier._crosscheckfiles.<locals>.<listcomp>s in manifest but not in changeset)rrrfrr$rwr)r�r�rAr&�filerlrPr{)	r5rnrorrrur}rrZrr�rri�s6��
��zverifier._crosscheckfilesc#s|j}|j}|j}|j}|j}|�td��t�}g}	|jj	|	d�D]\}
}}|dks-|s9|�
d�r9|�t|��q"|	D]}|�
dtd�|�q<|jjj|j|�dd�dkd	�}
tt|�t|�B�}d}|jtd
�td�t|�d�}t|�D�]�\}}|j||d
�z||}Wnty�g}Ynw|r�|d}nd}z|�|�}Wntjy�}z|�
|td�||�WYd}~qwd}~ww|��D]#}z|�|�Wq�ty�|jr�td�}|�||�d|_Yq�wt|��s|j s�|j�r|�
|td�|�nNt�|
d<t�|
d<|�!|
�D]>}|j"du�r$|�#|�$|j"��}nd}|j%�r2|�|j%��q|j�rI|du�r=|n|}|�
||j|��qt�&d|j'��i}|D]�}|d7}|�"|�}|�(||||||�}||v�r�|�r�|||v�r�|�
|td�t)|�|�n|||=||
dv�r�||
dv�r��qUzw|�*|����r|du�r�|j+�r�||�}t,�fdd�|�-�D���s�|�t.||f�|��d�}t|��s�td�}|�
||�dt)�d�f|�n&�d|jj/k�r
t0}|||�dt)�d�f;}|�1|�n|�$�d�W�qUt2�y5} z|�3|td�t)|�| |�WYd} ~ �qUd} ~ ww||v�r`dd�t4�5||�D�}!t|!�D]\}}"td�}|�
||t)|"�|��qKqw|�6�|j�rzt|�D]}|�td�|��qmt|�|fS)Nschecking files
r�rsdata/r�scensorspolicysabort)sexpectedversionrserroroncensoredrrr�rs)�itemsbroken revlog! (%s)s% warning: revlog '%s' not in fncache!TrGsskipreadssafe_renameds<problem instance does not set warning or error attribute: %srs%s not in manifestsc3s�|]	}�d|vVqdS)rNr)r��pctx��rprr�	<genexpr>/s�z(verifier._verifyfiles.<locals>.<genexpr>s)empty or missing copy source revlog %s:%sschecking rename of %scSsg|]\}}||f�qSrr)r��krrrrr�Bsz)verifier._verifyfiles.<locals>.<listcomp>s&manifest refers to unknown revision %sr�)7rrr/r,r)rfrr r�r�r_r>rrAr%r*r3�configr�rwr$�	enumeraterx�KeyErrorr�r�StorageErrorr��remover4r:r1r&�verifyintegrityrWr?rM�warning�ProgrammingErrorr9r]r�renamedre�anyrT�WARN_UNKNOWN_COPY_SOURCErU�WARN_NULLID_COPY_SOURCE�noterPrFrr�r{)#r5rornrrr/r,r)r�r�r�rr��stater��	revisionsr}rVrYrZr��e�ffr9�problemr?�linkrev_msgrXr~�ctx�fl2r�rD�fnsrWrr�rrj�s�����
����

��




$����
�zverifier._verifyfilesr)rNN)�__name__�
__module__�__qualname__r6r:rArFrLr]rrgrhrirjrrrrr
:s



:.1
�r
r)�
__future__rra�i18nrrWr�utilsr�rrr	r
rr�rrrkr�r�r��objectr
rrrr�<module>s.
����

https://t.me/RX1948 - 2025