403Webshell
Server IP : 217.160.0.244  /  Your IP : 216.73.217.138
Web Server : Apache
System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64
User : u100174116 ( 6746176)
PHP Version : 8.5.10
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/breezy/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/breezy/__pycache__/rename_map.cpython-313.pyc
�

p��g�)��P�SSKJr SSKJrJrJr SSKJr SSKJ	r	 "SS5r
g)	�)�BytesIO�)�osutils�progress�trace)�gettext)�
ui_factoryc��\rSrSrSrSr\S5rSrSr	Sr
SrS	r\S
5r
SrSrS
r\SSj5rSrSrg)�	RenameMap�zDetermine a mapping of renames.c��Xl0Ulg�N)�tree�edge_hashes)�selfrs  �3/usr/lib/python3/dist-packages/breezy/rename_map.py�__init__�RenameMap.__init__s���	����c	#�# �Sn[[U55H!n[[XUS-55U-v� M# g7f)aIterate through the hashes of line pairs (which make up an edge).

The hash is truncated using a modulus to avoid excessive memory
consumption by the hitscount dict.  A modulus of 10Mi means that the
maximum number of keys is 10Mi.  (Keys are normally 32 bits, e.g.
4 Gi)
i��N)�range�len�hash�tuple)�lines�modulus�ns   r�iter_edge_hashes�RenameMap.iter_edge_hashess=���#���s�5�z�"�A��u�U�q�1�u�-�.�/�'�9�9�#�s�=?c��URU5H6nURRU[55R	U5 M8 g)z�Update edge_hashes to include the given lines.

:param lines: The lines to update the hashes for.
:param tag: A tag uniquely associated with these lines (i.e. file-id)
N)rr�
setdefault�set�add)rr�tag�my_hashs    r�add_edge_hashes�RenameMap.add_edge_hashes,s<���,�,�U�3�G����'�'����7�;�;�C�@�4rc	���UVs/sHo1RU5U4PM nn[R"5n[UR	U55HyunupxUR[
S5U[U55 [5n	U	RU5 U	RS5 URU	R5U5 M{ SSS5 gs snf!,(df   g=f)z�Update to reflect the hashes for files in the tree.

:param tree: The tree containing the files.
:param file_ids: A list of file_ids to perform the updates for.
zCalculating hashesrN)
�id2pathr	�nested_progress_bar�	enumerate�iter_files_bytes�updaterrr�
writelines�seekr'�	readlines)
rr�file_ids�f�
desired_files�task�num�file_id�contents�ss
          r�add_file_edge_hashes�RenameMap.add_file_edge_hashes5s���8@�@�x�!�,�,�q�/�1�-�x�
�@�
�
+�
+�
-��,5��%�%�m�4�-�(��(�g����G�$8�9�3��H�
�N��I�����X�&����q�	��$�$�Q�[�[�]�G�<�-�.�
-��A�
-�
-�s�C�BC�
C,c���0nURU5HOnURRU5nUcM#[U5nUHnXb;aSX&'X&==SU--
ss'M MQ U$)a.Count the number of hash hits for each tag, for the given lines.

Hits are weighted according to the number of tags the hash is
associated with; more tags means that the hash is less rare and should
tend to be ignored.
:param lines: The lines to calculate hashes of.
:return: a dict of {tag: hitcount}
rg�?)rr�getr)rr�hitsr&�tags�taglenr%s       r�	hitcounts�RenameMap.hitcountsFsr�����,�,�U�3�G��#�#�'�'��0�D��|����Y�F����?� !�D�I��	�S�6�\�)�	��4��rc	�^�/n[R"5n[U5H~unmUR[	S5U[U55 UR
URRT55nURU4SjUR555 M� SSS5 U$!,(df   U$=f)znFind all the hit counts for the listed paths in the tree.

:return: A list of tuples of count, path, file_id.
zDetermining hash hitsc3�2># �UHupUTU4v� M g7fr�)�.0�k�v�paths   �r�	<genexpr>�)RenameMap.get_all_hits.<locals>.<genexpr>es����F�����D�!���s�N)r	r+r,r.rrrAr�get_file_lines�extend�items)r�paths�all_hitsr5r6r>rIs      @r�get_all_hits�RenameMap.get_all_hits[s����
��
�
+�
+�
-��&�u�-�	��T����G�$;�<�c�3�u�:�N��~�~�d�i�i�&>�&>�t�&D�E�����F�����F�F�.�.�
��.�
-�
��s�BB1�1
Cc�B�URURU55$)z5Return a mapping from file_ids to the supplied paths.)�_match_hitsrQ)rrOs  r�
file_match�RenameMap.file_matchhs������ 1� 1�%� 8�9�9rc��[5n0n[USS9H'up4nXB;dXQ;aMXRU'URU5 M) U$)z�Using a hit list, determine a path-to-fileid map.

The hit list is a list of (count, path, file_id), where count is a
(possibly float) number, with higher numbers indicating stronger
matches.
T)�reverse)r#�sortedr$)�hit_list�
seen_file_ids�path_map�_countrIr7s      rrT�RenameMap._match_hitslsQ����
���%+�H�d�%C�!�F�'���7�#;��$�T�N����g�&�	&D�
�rc��0nUH_nUn[R"U5nURRU5(aM>UR	U/5RU5 M] 0nUR
5HCupg[5nUH*nURU5n	U	cMURU	5 M, X�U'ME U$)z�Return a dict of all file parents that must be versioned.

The keys are the required parents and the values are sets of their
children.
)
r�dirnamer�is_versionedr"�appendrNr#r=r$)
r�matches�required_parentsrI�child�require_ids�parent�children�child_file_idsr7s
          r�get_required_parents�RenameMap.get_required_parents}s������D�������t�,���9�9�)�)�$�/�/�� �+�+�D�"�5�<�<�U�C����� 0� 6� 6� 8��F� �U�N�!��!�+�+�e�,���&�"�&�&�w�/�"�#1���
!9��rc��/nUR5HSupEUR5H:upg[URU55nUS:�dM'URX�U45 M< MU UR	U5$)z�Map parent directories to file-ids.

This is done by finding similarity between the file-ids of children of
required parent directories and the file-ids of children of missing
parent directories.
r)rNr�intersectionrbrT)	rrd�missing_parentsrPr7�file_id_childrenrI�
path_childrenr>s	         r�
match_parents�RenameMap.match_parents�sx����)8�)>�)>�)@�%�G�'7�'=�'=�'?�#���=�5�5�6F�G�H���!�8��O�O�T��$9�:�(@�*A�
����)�)rc�X�[5n0n[5n[R"5nURR	USUS9nUGH�nUR
Sc�URS(a�URRURRURS55(d@URURS[55RUR5 UR
SS:XaURUR5 OURS:XdM�URRURS5(aGM UR
SS:XaURURS5 UR
SS:XdGMgURRURS5H-up�U	H"n
U
SS:XdMURU
S5 M$ M/ GM� SSS5 X#U4$!,(df   N=f)	NT)�want_unversioned�pbrr�file)FF�	directoryr)r#r	r+r�iter_changes�kind�	versioned�has_filenamer*�	parent_idr"r$r7�
is_ignoredrI�walkdirs)r�basis�
missing_filesrn�candidate_filesr5�iterator�change�_dirrhres           r�_find_missing_files�RenameMap._find_missing_files�s�����
����%��
�
+�
+�
-���y�y�-�-�e�d�t�-�T�H�"���;�;�q�>�)�f�.>�.>�q�.A��9�9�1�1��	�	�)�)�&�*:�*:�1�*=�>���(�2�2�6�3C�3C�A�3F���N�R�R�"�N�N���{�{�1�~��/�%�)�)�&�.�.�9���#�#�~�5��y�y�+�+�F�K�K��N�;�;� ��{�{�1�~��/�'�+�+�F�K�K��N�;��{�{�1�~��4�.2�i�i�.@�.@����Q��.P�N�D�)1��#(��8�v�#5�$3�$7�$7��a��$A�*2�/Q�'#�.�2��>�>�3.�
-�s�D
H�:A2H�19H�.!H�
H)c�~�0n[R"5n[R"SSU5nUR	5 U"U5nUR5 UR
U5up�n
UR5 URX5 SSS5 UR5 WRW
5nUn[U5S:�aEURU5nURUW	5nURU5 [U5S:�aMEUR5 URU5n
U
H5up�nn[R"[!S5R#X�55 M7 U(d"UR%U5 UR'U
5 SSS5 g!,(df   GN=f!,(df   g=f)aGuess which files to rename, and perform the rename.

We assume that unversioned files and missing files indicate that
versioned files have been renamed outside of Bazaar.

:param from_tree: A tree to compare from
:param to_tree: A write-locked working tree.
zGuessing renames�Nrz
{0} => {1})r	r+r�
ProgressPhase�	lock_read�
next_phaser�r:rUrrjrqr.�_make_inventory_deltar�noter�formatr$�apply_inventory_delta)�klass�	from_tree�to_tree�dry_runrdr5�pp�rnr�rnr�rc�parents_matches�delta�old�new�_file_id�_entrys                  r�
guess_renames�RenameMap.guess_renames�si����
�
+�
+�
-���'�'�(:�A�t�D�B��$�$�&��7�^���
�
���*�*�9�5�@�
���
�
���'�'�	�A�'�
�M�M�O��m�m�O�4�G�%�O��o�&��*�#%�#:�#:�?�#K� �"$�"2�"2�3C�_�"U������/��o�&��*�
�M�M�O��,�,�W�5�E�.3�*��(�F��
�
�7�<�0�7�7��A�B�/4�����,�-��-�-�e�4�/.�
-�&�&��.�
-�s,�)F.�AF�A=F.�BF.�
F+	�&F.�.
F<c�r�/nUR5VVs0sHup4XC_M	 nnn/nUR5H.nURURR	U55 M0 URRUS9GHupxXXRn	[R"U	5up�URU
5nUcpURRU
5nUcRURRU
/SS9up�[U5S:�aUSU
:XaM�URRU
5nURU:XaUR U:XaM�UR#5nX�lX�lURXyURU45 GM U$s snnf![
Ra GM|f=f)N)�specific_filesF)�recurser)rN�valuesrbrr*�errors�NoSuchId�iter_entries_by_dirr7r�splitr=�path2id�	smart_addr�namer|�copy)rrcr��pr3�file_id_matches�
file_id_query�old_path�entry�new_path�parent_path�new_namer|�added�ignored�	new_entrys                rr��RenameMap._make_inventory_delta�s�����,3�M�M�O�<�O�D�A�1�4�O��<��
����!�A�
��$�$�T�Y�Y�%6�%6�q�%9�:�"�
 $�y�y�<�<�(� =� 
�O�H�'�}�}�5�H�$+�M�M�(�$;�!�K����K�0�I�� � �I�I�-�-�k�:�	��$�%)�Y�Y�%8�%8�+��PU�%8�%V�N�E��7�|�a�'�G�A�J�+�,E� �$(�I�I�$5�$5�k�$B�	��z�z�X�%�%�/�/�Y�*F���
�
��I�"+��%�N��L�L�(�i�.?�.?��K�L�' 
�(���7=��
�?�?�
��
�s�F�*F�F6�5F6)rrN)F)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r�staticmethodrr'r:rArQrUrTrjrqr��classmethodr�r��__static_attributes__rErrrrsu��)���
:��
:�A�=�"�*�:����� �0
*�?�>�!5��!5�FrrN)�ior�rrr�i18nr�uir	rrErr�<module>r�s"��"�&�&���l�lr

Youez - 2016 - github.com/yon3zu
LinuXploit