ó
    6°ho  ã                  ó˜   • S r SSKJr  SSKJr  SSKJrJrJrJ	r	J
r
JrJrJr  0 r\R                  " \5      r\" SSSS9  S	 rS
 rS rS rg)ax  check 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.

é    )Úannotations)Ú_)ÚcommandsÚcopiesÚerrorÚ
extensionsÚpycompatÚ	registrarÚscmutilÚsimilaró   automvó
   similarityé_   )Údefaultc                óš   • [         R                  " [        R                  S[        5      nUS   R                  SSS [        S5      45        g )Ns   commité   ó    s	   no-automvs%   disable automatic file move detection)r   Úwrapcommandr   ÚtableÚmvcheckÚappendr   )ÚuiÚentrys     Ú./usr/lib/python3/dist-packages/hgext/automv.pyÚextsetupr   3   s<   € Ü×"Ò"¤8§>¡>°9¼gÓF€EØ	ˆ!�H‡O�OØ	ˆl˜D¤!Ð$LÓ"MÐNõr   c           	     ó–  • SnUR                  SS5      nUR                  5          U(       d§  UR                  SS5      nSUs=::  a  S::  d!  O  [        R                  " [        S5      5      eUS:”  aa  [        R                  " US   U[        R                  " U5      5      n[        X(5      u  pš[        R                  " US	S
9n[        X+XšUS-  5      nUb=  UR                  R                  U5         [        R                  " USSU5        SSS5        U " X/UQ70 UD6sSSS5        $ ! , (       d  f       N#= f! , (       d  f       g= f)z&Hook to check for moves at commit timeNÚ	no_automvFr   r   r   éd   s+   automv.similarity must be between 0 and 100T)Úlegacyrelativevalueg      Y@© )ÚpopÚwlockÚ	configintr   ÚAbortr   r   Úmatchr	   ÚbyteskwargsÚ_interestingfilesÚgetuipathfnÚ_findrenamesÚdirstateÚchanging_filesÚ_markchanges)Úorigr   ÚrepoÚpatsÚoptsÚrenamesÚdisabledÚ	thresholdr%   ÚaddedÚremovedÚuipathfns               r   r   r   :   s  € à€GØ�x‰x˜ UÓ+€HØ	�‰�ÞØŸ™ Y°Ó>ˆIØ˜	Õ( SÕ(Ü—k’kÜÐDÓEóð ð ˜1‹}ÜŸšØ˜‘J ¤h×&:Ò&:¸4Ó&@ó�ô "3°4Ó!?‘�Ü"×.Ò.¨tÈÑN�Ü&Ø E°IÀÑ4Eó�ð ÑØ—‘×-Ñ-¨dÕ3ô ×$Ò$ T¨2¨r°7Ô;÷ 4ñ �BÐ,˜tÒ, tÑ,÷3 
‰÷$ 4Õ3ú÷% 
�ús$   ¥CD:Ã2D)ÄD:Ä)
D7	Ä3D:Ä:
Ec                óÎ   • U R                  US9nUR                  nUR                  n[        R                  " U S   U S   U5      nU Vs/ s H  ofU;  d  M
  UPM     nnX44$ s  snf )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%   ó   .N)Ústatusr4   r5   r   Ú
pathcopies)r.   ÚmatcherÚstatr4   r5   ÚcopyÚfs          r   r'   r'   Z   sg   € ð �;‰;˜Wˆ;Ð%€DØ�J‰J€EØ�l‰l€Gä×Ò˜T $™Z¨¨d©°WÓ=€DáÓ/š�1¨$¡�Q™€EÐ/àˆ>Ðùò 0s   Á
	A"ÁA"c                óv  • 0 nUS:”  ay  [         R                  " XX45       H^  u  pgnU R                  R                  (       a9  U R                  R	                  [        S5      U" U5      U" U5      US-  4-  5        XeU'   M`     U(       a0  U R                  R	                  [        S5      [        U5      -  5        U$ )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.

r   s)   detected move of %s as %s (%d%% similar)
r   s   detected move of %d files
)r   Úfindrenamesr   Úverboser9   r   Úlen)	r.   r6   r4   r5   Ú
similarityr1   ÚsrcÚdstÚscores	            r   r)   r)   l   s¢   € ð €GØ�Aƒ~Ü&×2Ò2Ø˜ö 
‰OˆC�eð �w‰w��Ø—‘—‘ÜÐCÓDÙ “}¡h¨s£m°U¸S±[ÐAñBôð �C‹Lñ 
ö Ø�‰�‰”qÐ7Ó8¼3¸w»<ÑGÔHØ€Nr   N)Ú__doc__Ú
__future__r   Úmercurial.i18nr   Ú	mercurialr   r   r   r   r	   r
   r   r   ÚconfigtableÚ
configitemr   r   r'   r)   r    r   r   Ú<module>rM      s^   ðñ	õ( #å ÷	÷ 	ó 	ð €Ø×!Ò! +Ó.€
á 
ØØØòòò-ò@ó$r   