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/hgext/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/hgext/__pycache__/automv.cpython-310.pyc
o

�]Lb��@s�dZddlmZddlmZddlmZmZmZm	Z	m
Z
mZmZm
Z
iZe�e�Zedddd�d	d
�Zdd�Zd
d�Zdd�ZdS)axcheck for unrecorded moves at commit time (EXPERIMENTAL)

This extension checks at commit/amend time if any of the committed files
comes from an unrecorded mv.

The threshold at which a file is considered a move can be set with the
``automv.similarity`` config option. This option takes a percentage between 0
(disabled) and 100 (files must be identical), the default is 95.

�)�absolute_import)�_)�commands�copies�error�
extensions�pycompat�	registrar�scmutil�similar�automv�
similarity�_)�defaultcCs.t�tjdt�}|d�dddtd�f�dS)Nscommit��s	no-automvs%disable automatic file move detection)r�wrapcommandr�table�mvcheck�appendr)�ui�entry�r�./usr/lib/python3/dist-packages/hgext/automv.py�extsetup3s�rcOs�t�|�}d}|�dd�}|sL|�dd�}d|krdks'nt�td���|dkrLt�|d||�}t	||�\}	}
tj
|d	d
�}t|||	|
|d�}|���#|dur]t�
|dd|�|||g|�Rit�|���Wd�S1svwYdS)
z&Hook to check for moves at commit timeNs	no_automvFrr
r�ds+automv.similarity must be between 0 and 100T)�legacyrelativevaluegY@r)r�byteskwargs�pop�	configintr�Abortrr
�match�_interestingfiles�getuipathfn�_findrenames�wlock�_markchanges�	strkwargs)�origr�repo�pats�opts�renames�disabled�	thresholdr!�added�removed�uipathfnrrrr:s&
�
$�rcsH|j|d�}|j}|j}t�|d|d|���fdd�|D�}||fS)z�Find what files were added or removed in this commit.

    Returns a tuple of two lists: (added, removed). Only files not *already*
    marked as moved are included in the added list.

    )r!�.Ncsg|]}|�vr|�qSrr)�.0�f��copyrr�
<listcomp>^sz%_interestingfiles.<locals>.<listcomp>)�statusr/r0r�
pathcopies)r)�matcher�statr/r0rr5rr"Qsr"c	Cs~i}|dkr/t�||||�D] \}}}|jjr*|j�td�||�||�|df�|||<q|r=|j�td�t|��|S)z�Find what files in added are really moved files.

    Any file named in removed that is at least similarity% similar to a file
    in added is seen as a rename.

    rs)detected move of %s as %s (%d%% similar)
rsdetected move of %d files
)r�findrenamesr�verboser8r�len)	r)r1r/r0�
similarityr,�src�dst�scorerrrr$cs���
r$N)�__doc__�
__future__r�mercurial.i18nr�	mercurialrrrrrr	r
r�configtable�
configitemrrr"r$rrrr�<module>s(
�

https://t.me/RX1948 - 2025