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

�]Lb��@sdddlmZddlmZddlmZmZdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dS)�)�absolute_import�)�_)�mdiff�pycompatc	cs��i}|jjtd�t|�t|�td�d�}|D]}|��t|���}||vr.|g||<q||�|�q|D]$}|��|��}t|�}|�|g�D]}||��kr[||fVnqLq8|�	�dS)z�find renamed files that have no changes

    Takes a list of new filectxs and a list of removed filectxs, and yields
    (before, after) tuples of exact matches.
    ssearching for exact renames�files)�total�unitN)
�ui�makeprogressr�len�	increment�hash�data�append�get�complete)	�repo�added�removed�hashes�progress�fctx�h�adata�rfctx�r�3/usr/lib/python3/dist-packages/mercurial/similar.py�_findexactmatchess0��
��rcCs|��}|t�|�fS�N)rr�
splitnewlines)r�origrrr�_ctxdata6sr"c
Csl|\}}|��}d}t�||�}|D]\}}}	}
||	|
�D]}|t|�7}qqt|�t|�}|d|S)Nrg@)rr�blocksr)
r�	otherdatar!�lines�text�equal�matches�x1�x2�y1�y2�line�lengthsrrr�_score<s�r/cCst|t|��Sr)r/r")�fctx1�fctx2rrr�scoreK�r2ccs��i}|jjtd�td�t|�d�}|D].}|��d}|D]#}|�|d|f�d}	|dur2t|�}t||�}
|
|	krA||
f||<qq|��t	�
|�D]\}}|\}
}|
||fVqLdS)z�find potentially renamed files based on similar file content

    Takes a list of new filectxs and a list of removed filectxs, and yields
    (before, after, score) tuples of partial matches.
    ssearching for similar filesr)r	rNr)r
rrrr
rr"r/rr�	iteritems)rrr�	threshold�copiesr�rr�a�	bestscore�myscore�dest�v�source�bscorerrr�_findsimilarmatchesOs,��
���r?cCsdd�|D�S)NcSsg|]
}|��dkr|�qS)r)�size��.0�xrrr�
<listcomp>ksz_dropempty.<locals>.<listcomp>r)�fctxsrrr�
_dropemptyjr3rFc	#s��|d�����t�fdd�t|�D��}t�fdd�t|�D��}t��t|||�D]\}}��|�|��|��dfVq,|dkrd�fdd�|D�}t||||�D]\}}}|��|��|fVqTdSdS)z:find renamed files -- yields (before, after, score) tuplesNc3s�|]}�|VqdSrr�rB�fp)�wctxrr�	<genexpr>vs�zfindrenames.<locals>.<genexpr>c3s �|]}|�vr�|VqdSrrrG)�pctxrrrJws�g�?csg|]}|�vr|�qSrrrA)�matchedfilesrrrD�szfindrenames.<locals>.<listcomp>)�p1rF�sorted�setr�add�pathr?)	rrrr5�
addedfiles�removedfilesr8�br2r)rLrKrIr�findrenamesns"�
��rUN)�
__future__r�i18nr�rrrr"r/r2r?rFrUrrrr�<module>s%

https://t.me/RX1948 - 2025