403Webshell
Server IP : 50.21.180.56  /  Your IP : 216.73.216.224
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67922704 ( 67922704)
PHP Version : 8.5.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/lib/python3/dist-packages/breezy/bzr/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/lib/python3/dist-packages/breezy/bzr/tests/__pycache__/test_inv.cpython-313.pyc
�

p��g����SSKJrJrJrJrJrJr SSKJr SSKJ	r	J
r
Jr SSKJrJ
r
JrJrJrJrJrJrJrJr SSKJrJr \rSrS	rS"S
jrS"SjrSrS
rSrS"Sjr S"Sjr!"SS\5r""SS\5r#"SS\5r$"SS\5r%"SS\RL5r'"SS\RL5r("SS\5r)"SS \5r*g!)#�)�errors�osutils�
repository�revision�tests�workingtree)�load_tests_apply_scenarios�)�chk_map�
groupcompress�	inventory)
�ROOT_ID�CHKInventory�DuplicateFileId�InvalidEntryName�	Inventory�InventoryDirectory�InventoryEntry�
InventoryFile�
TreeReference�mutable_inventory_from_tree�)�TestCase�TestCaseWithTransportc���SS[04/n[RR5HEupUR(dMUR[
UR5[US.45 MG [RR5H�nU"5n[U5(aU"5nWRRnUR(dMKUR[
URR5S-[ US.45 UR[
URR5S-["US.45 M� U$![a N�f=f)Nr�apply_delta)r�formatz.update_basis_by_deltaz.apply_inventory_delta)�apply_inventory_Inventoryr�format_registry�	iteritems�supports_full_versioned_files�append�str�__name__�1apply_inventory_Repository_add_inventory_by_deltar�
_get_all_lazy�callable�ImportError�_matchingcontroldir�repository_format�	__class__�apply_inventory_WT_basis�apply_inventory_WT)�	scenarios�_r�getter�repo_fmts     �;/usr/lib/python3/dist-packages/breezy/bzr/tests/test_inv.py�delta_application_scenariosr3&sJ��	�}�&?�@�A��I� �/�/�9�9�;�	���/�/�/��������(�'X�"(���
�<��-�-�;�;�=��	��X�F���������-�-�?�?���5�5������F�$�$�-�-�.�1I�I� 8�F�K�
�	
�	����F�$�$�-�-�.�1I�I� 2�f�E�
�	
�!>�,���#�	��	�s�E�
E#�"E#c���UR5H\up#UR(aSUR-/nO/nURRURUR
4/U5 M^ g)N�a)�iter_entries�	text_size�texts�	add_lines�file_idr)�repo�inv�_path�ie�liness     r2�create_texts_for_invr@SsW���%�%�'�	��
�<�<��B�L�L�(�)�E��E��
�
���b�j�j�"�+�+�6��E�B�(�c�(�URU5 U$)z�Apply delta to basis and return the result.

:param basis: An inventory to be used as the basis.
:param delta: The inventory delta to apply:
:return: An inventory resulting from the application.
)r)�self�basis�delta�
invalid_deltas    r2rr\s��
���e���LrAc���URSURRS9nUR5 UR	5 URRU5nUR
5 URU5 UR5 URR5nUR
5 URU5 UR5 URR5nUR5 URUR5 U(dUR5 UR$!UR5 f=f!UR5 f=f)aApply delta to basis and return the result.

This sets the tree state to be basis, and then calls apply_inventory_delta.

:param basis: An inventory to be used as the basis.
:param delta: The inventory delta to apply:
:return: An inventory resulting from the application.
�tree�r)�make_controldirrr)�create_repository�
create_branch�
initialize�
lock_write�_write_inventory�unlock�
controldir�open_workingtree�apply_inventory_delta�	lock_read�
addCleanup�	_validate�root_inventory)rCrDrErF�controlrHs      r2r-r-gs���"�"�6�$�+�+�2Q�2Q�"�R�G����������;�;�!�!�'�*�D��O�O������e�$����
��?�?�+�+�-�D��O�O����"�"�5�)����
��?�?�+�+�-�D��N�N���O�O�D�K�K� �����������	
���
��	
���
�s�1E�=E�E�E-c	���[R"U5 [R"SSSSSS9nSUl[X5 UR
SXA5 U(aUnSUlSnO6URUS5n[X5 [UR55n[R"SSSSSS9nUR
SXE5 SSS5 U$!,(df   W$=f)N�basis���foo@example.com��	timestamp�timezone�message�	committer�result)
r�
WriteGroupr�Revision�revision_idr@�add_revision�create_by_apply_delta�list�iter_entries_by_dir)r;rDrErF�rev�
result_inv�target_entriess       r2�_create_repo_revisionsrn�s���	�	�	�t�	$��������'�
��%����T�)����(�C�/���J�%.�J�"�!�N��4�4�U�I�F�J� ��2�!�*�"@�"@�"B�C�N��������'�
��	
���)�S�5�9
%�:��;
%�	$�:��s�B0C�
C c��UR5nUR5 [URR	55sSSS5 $!,(df   g=f�N)�
basis_treerTrir
rj)rHrqs  r2�_get_basis_entriesrr�s=�����"�J�	�	�	�	��J�(�(�<�<�>�?�
 �	�	�s�#A�
Ac��[5nURS/S/S/5 UR5HiupEURU;aMURSUR-/UR/UR/5 URUR5 Mk UH0upgp�X�;aM
URSU-/UR/U/5 M2 g)z4Put all entries into tree, but at a unique location.z
unique-dir�	directorys
unique-dir-idzunique-dir/N)�set�addrjr:�kind)	rHrDrE�	added_idsr=r>�	_old_path�	_new_pathr:s	         r2�_populate_different_treer{�s�����I��H�H�l�^�k�]�-=�,>�?��.�.�0�	��
�:�:��"�����-�"�*�*�,�-����y�2�:�:�,�G��
�
�b�j�j�!�1�.3�)�	�g�������-�'�)�*�R�W�W�I��y�A�.3rAc��URSURRS9nUR5 UR	5 URRU5nUR
5 [URRXU5nURU5 URS/5 UR5 UR
5 URSU5 U(dUR5 SSS5 URR!5nUR#5nUR%5 UR'UR5 UR(nU(a*[+UR-55n	UR/Xi5 U$!UR5 f=f!,(df   N�=f)a�Apply delta to basis and return the result.

This sets the parent and then calls update_basis_by_delta.
It also puts the basis in the repository under both 'basis' and 'result' to
allow safety checks made by the WT to succeed, and finally ensures that all
items in the delta with a new path are present in the WT before calling
update_basis_by_delta.

:param basis: An inventory to be used as the basis.
:param delta: The inventory delta to apply:
:return: An inventory resulting from the application.
rHrIrZrcN)rJrr)rKrLrMrNrn�branchrrO�set_parent_idsrP�update_basis_by_deltarVrQrRrqrTrUrWrirj�assertEqual)
�testrDrErFrXrHrmrq�	basis_inv�
basis_entriess
          r2r,r,�sW���"�"�6�$�+�+�2Q�2Q�"�R�G����������;�;�!�!�'�*�D��O�O��
�/��K�K�"�"�E�-�
��	
���e�$�	
���X�J�'����
�	
���	��"�"�9�e�4���N�N��
�
�?�?�+�+�-�D����"�J������O�O�J�%�%�&��)�)�I���Y�:�:�<�=�
�����7����	
���
��	�	�s�1AF�*F0�F-�0
F>c
�.�UR5nURSURS9nURU5nUR	5 [
R"U5 [R"SSSSSS9nSUl	[Xa5 URSXq5 SSS5 SSS5 UR	5 [
R"U5 URSUS	S/5 SSS5 SSS5 URR5nUR5 UR!UR"5 UR%S	5$!,(df   N�=f!,(df   N�=f!,(df   N�=f!,(df   N�=f)
aApply delta to basis and return the result.

This inserts basis as a whole inventory and then uses
add_inventory_by_delta to add delta.

:param basis: An inventory to be used as the basis.
:param delta: The inventory delta to apply:
:return: An inventory resulting from the application.
rHrIrZr[Nr\r]r^rc)rrJr)rMrNrrdrrerfr@rg�add_inventory_by_deltarQ�open_repositoryrTrUrP�
get_inventory)rCrDrErFrrXr;rks        r2r%r%�s0���[�[�]�F��"�"�6�&�2L�2L�"�M�G����W�%�D�	
���	�J�1�1�$�7��������'�
��%����T�)����(�C�/�8�	�
���	�J�1�1�$�7��#�#�H�e�Y��
�K�8�	��?�?�*�*�,�D��N�N���O�O�D�K�K� ����i�(�(�#8�7��	�	��8�7��	�	�sH�E$�#=E� E$�F�E5�-F�
E!	�E$�$
E2�5
F	�?F�
Fc�J�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
g)
�TestInventoryUpdatesic��[R"SS9nURSUR5 UR	SURR
5 g)N�	tree-root��root_id)r
r�assertNotEqual�rootr�r:�rCr<s  r2�test_creation_from_root_id�/TestInventoryUpdates.test_creation_from_root_ids@���!�!�,�7�����D�#�(�(�+�����s�x�x�'7�'7�8rAc��[R"SS9nURSUR5 UR	SSS5nSUlUR
SUR5 URX!R5 g)Nr�r\rtsmy-rootstest-rev)r
r�assertIsr��add_pathrr�r:�rCr<r>s   r2�test_add_path_of_root�*TestInventoryUpdates.test_add_path_of_rootsa���!�!�$�/���
�
�d�C�H�H�%�
�\�\�"�k�:�
6��!�������R�Z�Z�0��
�
�b�(�(�#rAc���[R"SS9nURSSS5nURSUR5 URSUR
5 g)Ns	tree_rootr��hello�file�hello-id)r
rr�r�r:rwr�s   r2�
test_add_path�"TestInventoryUpdates.test_add_path"sL���!�!�,�7��
�\�\�'�6�;�
7������b�j�j�1��������)rAc�D�[R"SS9nURSSS5nUR5nSURlSUlURSURR
5 URSURS5R5 g)	z/Make sure copy() works and creates a deep copy.ssome-tree-rootr�r�r�r�s
some-new-root�file2N)	r
rr��copyr�r:�namer��	get_entry)rCr<r>�inv2s    r2�	test_copy�TestInventoryUpdates.test_copy(s}���!�!�*;�<��
�\�\�'�6�;�
7���x�x�z��+�����������*�D�I�I�,=�,=�>�����$�.�.��"=�"B�"B�CrAc��[R"SS9nUR5nURSUR5 g)z+Make sure an empty inventory can be copied.Nr�)r
rr�r�r��rCr<r�s   r2�test_copy_empty�$TestInventoryUpdates.test_copy_empty2s/���!�!�$�/���x�x�z���
�
�d�D�I�I�&rAc��[R"SS9nSURlUR	5nURSURR5 URSURR5 g)z/Make sure the revision of the root gets copied.ssomerootr�stherevN)r
rr�rr�r�r:r�s   r2�test_copy_copies_root_revision�3TestInventoryUpdates.test_copy_copies_root_revision8s]���!�!�+�6��%������x�x�z������d�i�i�&7�&7�8�����D�I�I�$6�$6�7rAc
�h�[R"S5nUR[SSSSSS95 g)Ns
tree-root-123s	nested-id�nestedsrevsrev2)�	parent_idr�reference_revision)r
rrvrr�s  r2�test_create_tree_reference�/TestInventoryUpdates.test_create_tree_reference@s6���!�!�"2�3��������*��#*�
�	
rAc	�
�[R"S5nUR[SSS55 UR	[
RUR[SSS55nUR[U5S5 g)Nr��a-iduሴsb-idz\u1234)	r
rrvr�assertRaisesr�InconsistentDelta�assertContainsRer#)rCr<�es   r2�test_error_encoding�(TestInventoryUpdates.test_error_encodingLsi���!�!�,�/�����
�g�x��>�?�����$�$��G�G��'�8�\�:�
��
	
���c�!�f�i�0rAc��[SSS5n[SSS5nX!RUR'[R
"S5nUR
U5 URSURS55 g)N�src-id�srcr�r��hello.czsrc/hello.c)	rr�childrenr:r
rrvr��id2path)rC�parent�childr<s    r2�test_add_recursive�'TestInventoryUpdates.test_add_recursiveVsb��#�I�u�l�C���k�9�i�@��).����
�
�&��!�!�,�/��������������K�(@�ArA�N)r$�
__module__�__qualname__�__firstlineno__r�r�r�r�r�r�r�r�r��__static_attributes__r�rAr2r�r�s1��9�$�*�D�'�8�

�1�BrAr�c���\rSrSr\"5rSSjrS SjrSrSr	Sr
SrS	rS
r
SrSrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!g)!�TestDeltaApplicationi_Nc��[R"5nUb'URRURlU$SURlU$)a�Get an empty inventory.

Note that tests should not depend on the revision of the root for
setting up test conditions, as it has to be flexible to accomodate non
rich root repositories.

:param reference_inv: If not None, get the revision for the root from
    this inventory. This is useful for dealing with older repositories
    that routinely discarded the root entry data. If None, the root's
    revision is set to 'basis'.
rZ)r
rr�r)rC�
reference_invr<s   r2�get_empty_inventory�(TestDeltaApplication.get_empty_inventorybsJ���!�!�#���$� -� 2� 2� ;� ;�C�H�H���
�!)�C�H�H���
rAc�^�[R"XU5nSUlSUlSUlU$)Nrcr[rA)r
rrr7�	text_sha1)rCr:r�r��ie_files     r2�make_file_ie�!TestDeltaApplication.make_file_ieus1���)�)�'��C��$����������rAc��UR5n/nURXU5nURU5nUR/URU55 grp)r�rr��_make_delta)rCr<rEr�s    r2�test_empty_delta�%TestDeltaApplication.test_empty_delta|sR���&�&�(�������t�%�0���'�'��,������T�-�-�c�2�3rAc��UR5n[R"SSURR5nSUlSUlSSSU4/nUR
[RURXU5 g)N�dirid�dir1rc�
r�r
rr�r:rr�rr�r�rCr<r�rEs    r2�test_None_file_id�&TestDeltaApplication.test_None_file_id�sn���&�&�(���+�+�H�f�c�h�h�>N�>N�O�����!��
����d�+�,�����&�2�2�D�4D�4D�d�QV�WrAc��UR5n[R"SSURR5nSUlSUlSSURU4/nUR
[RURXU5 g)Nr�r��diridrcr�r�s    r2�test_unicode_file_id�)TestDeltaApplication.test_unicode_file_id�sr���&�&�(���+�+�H�f�c�h�h�>N�>N�O�����!��
������d�3�4�����&�2�2�D�4D�4D�d�QV�WrAc�D�UR5n[R"SSURR5nSUlSUlSUlUR5nSUl	SSSU4SSSU4/nUR[RURXU5 g)N�id�path1rcr[rA�path2)r�r
rr�r:rr7r�r�r�r�rr�r�rCr<�file1r�rEs     r2�test_repeated_file_id�*TestDeltaApplication.test_repeated_file_id�s����&�&�(���'�'��w����8H�8H�I��"����������
�
�����
�����.��w��u�0M�N�����&�2�2�D�4D�4D�d�QV�WrAc�D�UR5n[R"SSURR5nSUlSUlSUlUR5nSUlSSSU4SSSU4/nUR[RURXU5 g)N�id1�pathrcr[rA�id2)
r�r
rr�r:rr7r�r�r�rr�rr�s     r2�test_repeated_new_path�+TestDeltaApplication.test_repeated_new_path�s����&�&�(���'�'������8H�8H�I��"����������
�
�����
�����.��v�v�u�0M�N�����&�2�2�D�4D�4D�d�QV�WrAc���UR5n[R"SSURR5nSUlSUlSUl[R"SSURR5nSUlSUlSUlURU5 URU5 SS	/nUR[RURXU5 g)
Nr�r�rcr[rAr�r�)r�Nr�N)r�Nr�N�
r�r
rr�r:rr7r�rvr�rr�rr�s     r2�test_repeated_old_path�+TestDeltaApplication.test_repeated_old_path�s����&�&�(���'�'������8H�8H�I��"����������'�'������9I�9I�J��"�������������������-�/K�L�����&�2�2�D�4D�4D�d�QV�WrAc��UR5n[R"SSURR5nSUlSUlSUlSSSU4/nUR[RURXU5 g)Nr�r�rcr[rAr��r�r
rr�r:rr7r�r�rr�r�rCr<r�rEs    r2�test_mismatched_id_entry_id�0TestDeltaApplication.test_mismatched_id_entry_id�su���&�&�(���'�'������8H�8H�I��"������������u�-�.�����&�2�2�D�4D�4D�d�QV�WrAc��UR5nS/nUR[RURXU5 g)N)Nr�r�N)r�r�rr�r)rCr<rEs   r2�#test_mismatched_new_path_entry_None�8TestDeltaApplication.test_mismatched_new_path_entry_None�s9���&�&�(��,�-�����&�2�2�D�4D�4D�d�QV�WrAc��UR5n[R"SSURR5nSUlSUlSUlSSSU4/nUR[RURXU5 g)Nr�r�rcr[rAr�r�s    r2�#test_mismatched_new_path_None_entry�8TestDeltaApplication.test_mismatched_new_path_None_entry�su���&�&�(���'�'������8H�8H�I��"����������$���.�/�����&�2�2�D�4D�4D�d�QV�WrAc��UR5n[R"SSURR5nSUlSUlSUl[R"SSS5nSUlSUlSUlURU5 SSSU4/nUR[RURXU5 g)	Nr�r�rcr[rAr�r��
path/path2r�r�s     r2�test_parent_is_not_directory�1TestDeltaApplication.test_parent_is_not_directory�s����&�&�(���'�'������8H�8H�I��"����������'�'����@��"����������������f�e�4�5�����&�2�2�D�4D�4D�d�QV�WrAc���UR5n[R"SSS5nSUlSUlSUlSSSU4/nUR
[RURXU5 g)Nr�r�s
missingparentrcr[rAr)
r�r
rrr7r�r�rr�r)rCr<r�rEs    r2�test_parent_is_missing�+TestDeltaApplication.test_parent_is_missing�sl���&�&�(���'�'���9I�J��"�����������f�e�4�5�����&�2�2�D�4D�4D�d�QV�WrAc���UR5n[R"SSURR5nSUl[R"SSURR5nSUl[R"SSS5nSUlSUlS	UlURU5 URU5 SS
SU4/nUR[RURXU5 g)N�p-1�dirrc�p-2�dir2r�r�r[rA�dir/path�r�r
rr�r:rrr7r�rvr�rr�r�rCr<�parent1�parent2r�rEs      r2�!test_new_parent_path_has_wrong_id�6TestDeltaApplication.test_new_parent_path_has_wrong_id�s����&�&�(���.�.�v�u�c�h�h�>N�>N�O��$����.�.�v�v�s�x�x�?O�?O�P��$����'�'��v�v�>��"��������������������
�E�5�1�2�����&�2�2�D�4D�4D�d�QV�WrAc��UR5n[R"SSURR5nSUl[R"SSURR5nSUl[R"SSS5nSUlSUlS	UlURU5 URU5 URU5 S
/nUR[RURXU5 g)Nr
rrcrr
r�r�r[rA�rNr�Nrrs      r2�test_old_parent_path_is_wrong�2TestDeltaApplication.test_old_parent_path_is_wrong�s����&�&�(���.�.�v�u�c�h�h�>N�>N�O��$����.�.�v�v�s�x�x�?O�?O�P��$����'�'��v�v�>��"������������������������1�1�����&�2�2�D�4D�4D�d�QV�WrAc��UR5n[R"SSURR5nSUl[R"SSURR5nSUl[R"SSS5nSUlSUlS	Ul[R"S
SS5nSUlSUlS	UlURU5 URU5 URU5 URU5 S/nUR[RURXU5 g)Nr
rrcrr
r�r�r[rAr�rr)rCr<rrr�r�rEs       r2�$test_old_parent_path_is_for_other_id�9TestDeltaApplication.test_old_parent_path_is_for_other_ids���&�&�(���.�.�v�u�c�h�h�>N�>N�O��$����.�.�v�v�s�x�x�?O�?O�P��$����'�'��v�v�>��"����������'�'����?��"�����������������������������1�1�����&�2�2�D�4D�4D�d�QV�WrAc�x�UR5n[R"SSURR5nSUl[R"SSURR5nSUlUR
U5 SSSU4/nUR[RURXU5 g)Nr
r�rcr
�r�r
rr�r:rrvr�rr�r�rCr<rrrEs     r2�test_add_existing_id_new_path�2TestDeltaApplication.test_add_existing_id_new_path'����&�&�(���.�.�v�v�s�x�x�?O�?O�P��$����.�.�v�v�s�x�x�?O�?O�P��$������������0�1�����&�2�2�D�4D�4D�d�QV�WrAc�x�UR5n[R"SSURR5nSUl[R"SSURR5nSUlUR
U5 SSSU4/nUR[RURXU5 g)Nr
r�rcrrrs     r2�test_add_new_id_existing_path�2TestDeltaApplication.test_add_new_id_existing_path1r!rAc���UR5n[R"SSURR5nSUl[R"SSS5nSUl[R"SSS5nSUlUR
U5 UR
U5 UR
U5 SS	/nUR[RURXU5 g)
Nr
r�rcr�child1�p-3�child2)r�Nr
N)zdir1/child2Nr'Nr)rCr<r�r
�dir3rEs      r2�&test_remove_dir_leaving_dangling_child�;TestDeltaApplication.test_remove_dir_leaving_dangling_child;s����&�&�(���+�+�F�F�C�H�H�<L�<L�M��!��
��+�+�F�H�f�E��!��
��+�+�F�H�f�E��!��
�����
�����
�����
�-�/R�S�����&�2�2�D�4D�4D�d�QV�WrAc�,�UR5n[R"SSURR5nSUlSUlSUlSSSU4/nURXUSS9nURSURS5R5 g)N�file-idr�rcr[rAF�rF)r�r
rr�r:rr7r�rr�r��rCr<r�rE�res_invs     r2�
test_add_file�"TestDeltaApplication.test_add_fileIs����&�&�(���'�'�
�F�C�H�H�<L�<L�M��"�����������
�E�2�3���"�"�4�e�5�"�I������W�%6�%6�z�%B�%J�%J�KrAc��UR5n[R"SSURR5nSUlSUlSUlURU5 S/nURXUSS9nURSURS55 UR[RURS5 g)	Nr-r�rcr[rA)r�Nr-NFr.)r�r
rr�r:rr7r�rvrr��path2idr�r�NoSuchIdr�r/s     r2�test_remove_file�%TestDeltaApplication.test_remove_fileSs����&�&�(���'�'�
�F�C�H�H�<L�<L�M��"��������������1�2���"�"�4�e�5�"�I������w���v�6�7����&�/�/�7�?�?�J�GrAc��UR5nURSURRS9nUR	U5 URSURRS9nSSSU4/nURXUSS9nUR
SURS55 UR
SURS55 g)Nr�)r�r�r�r-Fr.�r�r�r�r:rvrr�r4�rCr<r�r�rEr0s      r2�test_rename_file�%TestDeltaApplication.test_rename_file_s����&�&�(���!�!�v����9I�9I�!�J��������!�!�w�#�(�(�:J�:J�!�K���'�:�u�5�6���"�"�4�e�5�"�I������w���v�6�7�����W�_�_�W�%=�>rAc�J�UR5nURSURRS9nUR	U5 URSURRS9nSSSSU4/nURXUSS9nUR
SURS55 g)Nr�)r:r�r�)r�Nr�Nr�Fr.r9r:s      r2�test_replaced_at_new_path�.TestDeltaApplication.test_replaced_at_new_pathis����&�&�(���!�!�&�C�H�H�<L�<L�!�M��������!�!�&�C�H�H�<L�<L�!�M��-��f�f�e�/L�M���"�"�4�e�5�"�I����������!8�9rAc���UR5n[R"SSURR5nSUlUR
SS9nURU5 URU5 [R"SSURR5nSUlSSSU4/nURXUSS9nURS	URS
55 g)N�dir-idr�rZ�r�r
rcFr.r-z	dir2/name�r�r
rr�r:rr�rvrr�r4)rCr<r�r�r
rEr0s       r2�test_rename_dir�$TestDeltaApplication.test_rename_dirrs����&�&�(���+�+�I�v�s�x�x�?O�?O�P�� ��
��!�!�I�!�6������
�������+�+�I�v�s�x�x�?O�?O�P��!��
��&�)�T�2�3���"�"�4�e�5�"�I������W�_�_�[�%A�BrAc���UR5n[R"SSURR5nSUlUR
SSSS9nUR
SSSS9nURU5 URU5 URU5 [R"SS	URR5nS
UlUR
SSURR5nSS	SU4SSSU4/nURXUSS
9nURSURS55 URSURS55 URSURS55 g)NrAr�rZs	file-id-1�name1rBs	file-id-2�name2r
rcz
dir1/name2Fr.z
dir2/name1z
dir2/name2rC)	rCr<r�r�r�r
�file2brEr0s	         r2�#test_renamed_dir_with_renamed_child�8TestDeltaApplication.test_renamed_dir_with_renamed_child�sJ���&�&�(���+�+�I�v�s�x�x�?O�?O�P�� ��
��!�!�,��9�!�M���!�!�,��9�!�M������
������������+�+�I�v�s�x�x�?O�?O�P��!��
��"�"�<��#�(�(�:J�:J�K��
�V�Y��-�
�7�L�&�9�
���"�"�4�e�5�"�I������w���|�'D�E�����w���|�<�=�����w���w�'?�@rAc���[R"S5nURURS55 UR	URS55 SUR
lUR	URS55 URURS55 SUlUR	URS55 UR	URS55 g)z*Ensure our root-checking code is accurate.�	TREE_ROOTsboogaN)r
r�
assertTrue�is_root�assertFalser�r:r�s  r2�test_is_root�!TestDeltaApplication.test_is_root�s����!�!�,�/��������L�1�2�������X�.�/�#�����������\�2�3�������H�-�.����������\�2�3�������X�.�/rAc�V�[SS9nUR/UR55 g)z9Test that entries() will not fail for an empty inventory.Nr�)rr��entriesr�s  r2� test_entries_for_empty_inventory�5TestDeltaApplication.test_entries_for_empty_inventory�s"����%������S�[�[�]�+rAr�rp)r-r�N)"r$r�r�r�r3r.r�r�r�r�r�r�r�r�r�r�rrrrrrrr#r*r1r6r;r>rDrJrQrUr�r�rAr2r�r�_s���+�-�I��&�4�X�X�	X�	X�X�*X�X�
X�X�X�X�"X�$X�0X�X�X�L�
H�?�:�C�A�,0�,rAr�c�h�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrg)�TestInventoryEntryi�c�Z�UR[[RSS[5 g)N�123z	a/hello.c)r�rr
rr�rCs r2�test_file_invalid_entry_name�/TestInventoryEntry.test_file_invalid_entry_name�s!������i�5�5�v�{�G�	
rAc�t�[R"SS[5nURURS5 g)NrZzh\ello.c)r
rrr�r��rCr�s  r2�test_file_backslash�&TestInventoryEntry.test_file_backslash�s*���&�&�v�{�G�D��������K�0rAc�|�[R"SS[5nURUR	5S5 g�NrZr�r\)r
rrr��kind_characterr_s  r2�test_file_kind_character�+TestInventoryEntry.test_file_kind_character�s/���&�&�v�y�'�B������,�,�.��3rAc�|�[R"SS[5nURUR	5S5 g)NrZr��/)r
rrr�rd�rCrs  r2�test_dir_kind_character�*TestInventoryEntry.test_dir_kind_character�s/���*�*�6�9�g�F������+�+�-�s�3rAc�|�[R"SS[5nURUR	5S5 grc)r
�
InventoryLinkrr�rdris  r2�test_link_kind_character�+TestInventoryEntry.test_link_kind_character�s/���%�%�f�i��A������+�+�-�r�2rAc�f�[SS[5nURUR5S5 g)NrZr��+)rrr�rdris  r2�test_tree_ref_kind_character�/TestInventoryEntry.test_tree_ref_kind_character�s)���F�I�w�7������+�+�-�s�3rAc��[R"SS[5n[R"SS[5nURSUR	U55 URSUR	U55 g)NrZr��FF)r
rrr��detect_changes�rC�left�rights   r2�test_dir_detect_changes�*TestInventoryEntry.test_dir_detect_changes�s`���+�+�F�I�w�G���,�,�V�Y��H�������)<�)<�U�)C�D������)=�)=�d�)C�DrAc�8�[R"SS[5nSUl[R"SS[5nSUlUR	SURU55 UR	SURU55 SUlUR	SURU55 UR	SURU55 SUlUR	SURU55 UR	SURU55 g)	NrZr��{ruT�FTiA�TT)r
rrr�r�rv�
executablerws   r2�test_file_detect_changes�+TestInventoryEntry.test_file_detect_changes�s����&�&�v�y�'�B������'�'��	�7�C����������)<�)<�U�)C�D������)=�)=�d�)C�D���������(;�(;�E�(B�C������(<�(<�T�(B�C��������t�':�':�5�'A�B�����u�';�';�D�'A�BrAc��[R"SS[5nSUl[R"SS[5nSUlUR	SURU55 UR	SURU55 SUlUR	SURU55 UR	SURU55 g)NrZr��fooru�	different)TF)r
rmr�symlink_targetr�rvrws   r2�test_symlink_detect_changes�.TestInventoryEntry.test_symlink_detect_changes�s����&�&�v�y�'�B��#����'�'��	�7�C��$��������)<�)<�U�)C�D������)=�)=�d�)C�D�)��������(;�(;�E�(B�C������(<�(<�T�(B�CrAc�z�[R"SS[5nURUR	55 g�NrZr�)r
rrrN�has_textr_s  r2�test_file_has_text�%TestInventoryEntry.test_file_has_text�s(���&�&�v�y�'�B������
�
��(rAc�z�[R"SS[5nURUR	55 gr�)r
rrrPr�ris  r2�test_directory_has_text�*TestInventoryEntry.test_directory_has_text�s*���*�*�6�9�g�F���������(rAc�z�[R"SS[5nURUR	55 gr�)r
rmrrPr�)rC�links  r2�test_link_has_text�%TestInventoryEntry.test_link_has_text�s*���&�&�v�y�'�B���������)rAc�`�UR[R"SS[5[R5 UR[R"SS[5[R
5 UR[R"SS[5[R5 g)Nr�r��symlinkrt)�assertIsInstancer
�
make_entryrrrmrr[s r2�test_make_entry�"TestInventoryEntry.test_make_entry�s������ � ����9�9�;R�;R�	
�	
���� � ��F�G�<�i�>U�>U�	
�	
���� � ��f�g�>��(�(�	
rAc���[Rn[R[l[R"SS[
5nUR
SUR5 URU[R5 [R[lUR[R[RSS[
5 U[lg!U[lf=f)Nr�uå�å)r�normalized_filename�_accessible_normalized_filenamer
r�rr�r�r�r�!_inaccessible_normalized_filenamer�r�InvalidNormalization)rC�orig_normalized_filename�entrys   r2�test_make_entry_non_normalized�1TestInventoryEntry.test_make_entry_non_normalized�s���#*�#>�#>� �	C�*1�*Q�*Q�G�'��(�(���G�D�E����V�U�Z�Z�0��!�!�%��)@�)@�A�*1�*S�*S�G�'�����+�+��$�$����
�+C�G�'��*B�G�'�s�B?C�
C*r�N)r$r�r�r�r\r`rerjrnrrrzr�r�r�r�r�r�r�r�r�rAr2rXrX�sL��
�
1�4�4�3�4�E�C�	D�)�)�*�

�CrArXc� �\rSrSrSrSrSrg)�TestDescribeChangesic���[SS[5nSUlSUl[SS[5nSUlSUlUR	SX5 SUlSUlUR	SX5 UR	S	SU5 UR	S
US5 UR	SSS5 SUlUR	SX5 UR
UlS
UlUR	SX5 URUlURUlUR
UlSUlUR	SX5 UR
UlS
UlUR	SX5 g)Nr��a_files123132r[�	unchanged�
sabcabc�modified�added�removed�newfilenamezmodified and renameds
somedir-id�renamed)rrr�r7�assertChangeDescriptionr�r�)rC�old_a�new_as   r2�test_describe_change�(TestDescribeChanges.test_describe_changes=���g�x��9��#�������g�x��9��#�������$�$�[�%�?����#����$�$�Z��>��$�$�W�d�E�:��$�$�Y��t�<��$�$�[�$��=�#��
��$�$�%;�U�J��Z�Z��
�'����$�$�%;�U�J� �/�/����/�/����Z�Z��
�"��
��$�$�Y��=��Z�Z��
�'����$�$�Y��=rAc�R�[R"X#5nURX5 grp)r�describe_changer�)rC�expected_change�old_ie�new_ie�changes     r2r��+TestDescribeChanges.assertChangeDescriptionCs ���/�/��?������1rAr�N)r$r�r�r�r�r�r�r�rAr2r�r�s
��1>�f2rAr�c���\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"S!r#S"r$S#r%g$)%�TestCHKInventoryiHc�d�[R"SSS5nURS5nU"U5$�NTrr\�r�make_pack_factory�
get_transport�rC�factory�transs   r2�
get_chk_bytes�TestCHKInventory.get_chk_bytesI�0���1�1�$��a�@���"�"�2�&���u�~�rAc�^�URU/SS5n[U5RS5$)N�	unorderedT�fulltext)�get_record_stream�next�get_bytes_as)rC�	chk_bytes�key�streams    r2�
read_bytes�TestCHKInventory.read_bytesNs-���,�,�c�U�K��F���F�|�(�(��4�4rAc�F�[5nSUlSURlUR	5n[
R"X!5nUR5n[
R"X$S5nURSUR5 URSURR5 URURRURR5 URURRURR5 URURRURR5 URSURR5 URSUR5 g)N�revid�rootrev�r�rt�plain)rrfr�rr�r�from_inventory�to_lines�deserialiser�rwr:r�r��_search_key_name)rCr<r��chk_invr?�new_invs      r2�#test_deserialise_gives_CHKInventory�4TestCHKInventory.test_deserialise_gives_CHKInventoryRs$���k��"���&������&�&�(�	��-�-�i�=��� � �"���*�*�9�[�I������7�#6�#6�7�����g�l�l�&7�&7�8�������)�)�7�<�<�+?�+?�@�������+�+�W�\�\�-C�-C�D������������(9�(9�:�����W�\�\�%:�%:�;�����7�#;�#;�<rAc��[5nSUlSURlUR	5n[
R"X!5nUR5nUR[[
RX$S5 g)Nr�r���revid2)rrfr�rr�rr�r�r��
ValueErrorr��rCr<r�r�r?s     r2�test_deserialise_wrong_revid�-TestCHKInventory.test_deserialise_wrong_revidbse���k��"���&������&�&�(�	��-�-�i�=��� � �"�������0�0�)�L�	
rAc�B�[5nSUlSURlUR	5n[
R"X!5nUR5nUR/SQU5 [
R"X$S5nURSUR5 g�N�foo�bar)�chkinventory:
�revision_id: foo
�root_id: TREE_ROOT
�Mparent_id_basename_to_file_id: sha1:eb23f0ad4b07f48e88c76d4c94292be57fb2785f
�;id_to_entry: sha1:debfe920f1f10e7929260f0534ac9a24d7aabbb4
�r�r��rrfr�rr�rr�r�r�r�r�r�s     r2�test_captures_rev_root_byid�,TestCHKInventory.test_captures_rev_root_byidm����k�� ���"������&�&�(�	��-�-�i�=��� � �"�����
�
�		
��*�*�9�Y�G������7�#;�#;�<rAc�B�[5nSUlSURlUR	5n[
R"X!5nUR5nUR/SQU5 [
R"X$S5nURSUR5 gr�r�r�s     r2�&test_captures_parent_id_basename_index�7TestCHKInventory.test_captures_parent_id_basename_index�r�rAc�@�[5nSUlSURlUR	5n[
R"X!SS9nUR5nUR/SQU5 [
R"X$S5nURSUR5 g)Nr�r�shash-16-way)�search_key_name)r�ssearch_key_name: hash-16-way
r�r�r�r�r�r�r�s     r2�test_captures_search_key_name�.TestCHKInventory.test_captures_search_key_name�s����k�� ���"������&�&�(�	��-�-��N�
��� � �"�����
�
�
	
��*�*�9�Y�G�������)A�)A�BrAc�`�[5nSUlSURlUR	[SSURR55 SURS5lSURS5lSURS5l	SURS5l
UR5n[R"X!5nUR5n[R"X$S	5nURURR5nUR!SUR"5 UR!S1[%UR&55 URS5nUR&SnUR!UR(UR(5 UR!URUR5 UR!UR*UR*5 UR!UR,UR,5 UR!URUR5 UR!URUR5 UR!URUR5 UR!URUR5 g�
Nr�r��fileidr��filerevT�ffffrr�)rrfr�rrvrr:r�r�r�r7r�rr�r�r�r��	_childrenrur�rwr�r�)	rCr<r�r�r?r��
root_entry�file_direct�
file_founds	         r2�!test_directory_children_on_demand�2TestCHKInventory.test_directory_children_on_demand�s���k��"���&��������
�i�����1A�1A�B�C�,6��
�
�i� �)�.2��
�
�i� �+�-4��
�
�i� �*�-.��
�
�i� �*��&�&�(�	��-�-�i�=��� � �"���*�*�9�[�I���&�&�s�x�x�'7�'7�8�
�����z�3�3�4����&��3�z�':�':�#;�<��'�'�	�2���(�(��0�
�����)�)�:�?�?�;�����,�,�j�.@�.@�A�����.�.�
�0D�0D�E�����)�)�:�?�?�;�����-�-�z�/B�/B�C�����.�.�
�0D�0D�E�����.�.�
�0D�0D�E�����/�/��1F�1F�GrAc�Z�[5nSUlSURlUR	5n[
R"X!S5nURR5 URSURRR5 URSURRR5 URnUR5 URSURR5 URSURR5 g)Nr�r��xrr
)rrfr�rr�rr��id_to_entry�_ensure_rootr��
_root_node�maximum_size�
_key_width�parent_id_basename_to_file_id)rCr<r�r��
p_id_basenames     r2� test_from_inventory_maximum_size�1TestCHKInventory.test_from_inventory_maximum_size�s����k��"���&������&�&�(�	��-�-�i�c�B�����(�(�*�����g�1�1�<�<�I�I�J�����G�/�/�:�:�E�E�F��=�=�
��"�"�$�����m�6�6�C�C�D�����M�4�4�?�?�@rAc�t�[5nSUlSURlUR	[SSURR55 SURS5lSURS5lSURS5l	SURS5l
UR5n[R"X!5nUR5n[R"X$S	5n[!UR#55nUR%URRS/U5 gr�)rrfr�rrvrr:r�r�r�r7r�rr�r�r��sorted�iter_all_idsr�)rCr<r�r�r?r��fileidss       r2�test_iter_all_ids�"TestCHKInventory.test_iter_all_ids�s����k��"���&��������
�i�����1A�1A�B�C�,6��
�
�i� �)�.2��
�
�i� �+�-4��
�
�i� �*�-.��
�
�i� �*��&�&�(�	��-�-�i�=��� � �"���*�*�9�[�I����-�-�/�0�����#�(�(�*�*�I�6��@rAc���[5nSUlSURlUR	[SSURR55 SURS5lSURS5lSURS5l	SURS5l
UR5n[R"X!5nURS	[U55 g)
Nr�r�r�r�rTrrr
)rrfr�rrvrr:r�r�r�r7r�rr�r��len�rCr<r�r�s    r2�test__len__�TestCHKInventory.test__len__�s����k��"���&��������
�i�����1A�1A�B�C�,6��
�
�i� �)�.2��
�
�i� �+�-4��
�
�i� �*�-.��
�
�i� �*��&�&�(�	��-�-�i�=������C��L�)rAc�,�[5nSUlSURlUR	[SSURR55 SURS5lSURS5lSURS5l	SURS5l
UR5n[R"X!5nUR5n[R"X$S	5nURURR5nURS5nUR!S
UR"5 UR!URRUR5 UR!URR$UR$5 UR!URR&UR&5 UR!SUR5 UR!SUR"5 UR!SUR5 UR!URRUR$5 UR!SUR&5 UR!SUR5 UR!SUR5 UR!SUR5 UR!SUR5 UR)[*R,URS5 g)Nr�r�r�r�rTrrr�rt�missing)rrfr�rrvrr:r�r�r�r7r�rr�r�r�r�rwr�r�r�rr5)rCr<r�r�r?r�r�
file_entrys        r2�test_get_entry�TestCHKInventory.test_get_entry�s?���k��"���&��������
�i�����1A�1A�B�C�,6��
�
�i� �)�.2��
�
�i� �+�-4��
�
�i� �*�-.��
�
�i� �*��&�&�(�	��-�-�i�=��� � �"���*�*�9�[�I���&�&�s�x�x�'7�'7�8�
��&�&�y�1�
�����j�o�o�6�������)�)�:�+=�+=�>�������+�+�Z�-A�-A�B���������
���8�����Z�%8�%8�9��������1�����J�$6�$6�7�������)�)�:�+?�+?�@��������1�����Z�%8�%8�9�����*�"6�"6�7�����J�0�0�1�����z�4�4�5����&�/�/�7�+<�+<�i�HrAc�L�[5nSUlSURlUR	[SSURR55 SURS5lSURS5lSURS5l	SURS5l
UR5n[R"X!5nURURS55 URURURR55 g)	Nr�r�r�r�rTrr)rrfr�rrvrr:r�r�r�r7r�rr�rN�has_idrs    r2�test_has_id_true�!TestCHKInventory.test_has_id_trues����k��"���&��������
�i�����1A�1A�B�C�,6��
�
�i� �)�.2��
�
�i� �+�-4��
�
�i� �*�-.��
�
�i� �*��&�&�(�	��-�-�i�=��������y�1�2�������s�x�x�'7�'7�8�9rAc���[5nSUlSURlUR	5n[
R"X!5nURURS55 g)Nr�r�r�)	rrfr�rr�rr�rPr$rs    r2�test_has_id_not� TestCHKInventory.test_has_id_notsQ���k��"���&������&�&�(�	��-�-�i�=��������	�2�3rAc�L�[5nSUlSURl[	SSURR
5n[
SSS5nURU5 URU5 SURS5lSURS5l	S	URS5l
S
URS5lSURS5lUR5n[R"XA5nUR5n[R "XFS5nUR#SUR%URR
55 UR#SUR%S55 UR#S
UR%S55 g�Nr�r�r�rr�r�rTrrr�r\zdir/file)rrfr�rrr:rrvr�r�r�r7r�rr�r�r�r�r��rCr<�direntry�	fileentryr�r�r?r�s        r2�test_id2path�TestCHKInventory.test_id2path'sB���k��"���&�����%�h��s�x�x�7G�7G�H��!�)�V�X�>�	���������	��,6��
�
�i� �)�.2��
�
�i� �+�-4��
�
�i� �*�-.��
�
�i� �*�+5��
�
�h��(��&�&�(�	��-�-�i�=��� � �"���*�*�9�[�I������W�_�_�S�X�X�-=�-=�>�?��������� 9�:�����W�_�_�Y�%?�@rAc�L�[5nSUlSURl[	SSURR
5n[
SSS5nURU5 URU5 SURS5lSURS5l	S	URS5l
S
URS5lSURS5lUR5n[R"XA5nUR5n[R "XFS5nUR#URR
UR%S55 UR#SUR%S55 UR#SUR%S
55 gr+)rrfr�rrr:rrvr�r�r�r7r�rr�r�r�r�r4r,s        r2�test_path2id�TestCHKInventory.test_path2id<sB���k��"���&�����%�h��s�x�x�7G�7G�H��!�)�V�X�>�	���������	��,6��
�
�i� �)�.2��
�
�i� �+�-4��
�
�i� �*�-.��
�
�i� �*�+5��
�
�h��(��&�&�(�	��-�-�i�=��� � �"���*�*�9�[�I��������)�)�7�?�?�2�+>�?�����7�?�?�5�#9�:�����G�O�O�J�$?�@rAc���[5nSURlSUlUR	5n[
R"X!5nURSSSS5 SUlSURl[
R"X!5nSSURRS4SSSUR4/nURUS5nURURUR5 g)Ns	myrootrevr�r\rtsmyrootid�
expectedid)rr�rrfr�rr�r�r:rhr�)rCr<r��base_invr�rEr�s       r2�$test_create_by_apply_delta_sets_root�5TestCHKInventory.test_create_by_apply_delta_sets_rootQs����k��(�����"����&�&�(�	��.�.�y�>�����R��k�4�8�'���(�����$�3�3�I�C�
�
��x�}�}�,�,�d�3�
�2�{�C�H�H�-�
���0�0��
�F������+�+�W�\�\�:rAc�8�[5nSUlSURlUR	5n[
R"X!5n[SSURR5nSUlSUl	SUl
SUlURU5 S	Ul[
R"X!5nSSSU4/nURUS	5nURURUR5 URURUR5 UR R#5 UR R#5 URUR R$R&UR R$R&5 g�
Nr�r�sA-id�ArTrrr5)rrfr�rr�rr�rr:r�r�r7rvrhr�r�r
rr�_key�rCr<r�r6�a_entryr�rEr�s        r2�*test_create_by_apply_delta_empty_add_child�;TestCHKInventory.test_create_by_apply_delta_empty_add_childbsJ���k��"���&������&�&�(�	��.�.�y�>�����c�h�h�.>�.>�?��%���!���#�����������'���$�3�3�I�C�
���W�g�.�/���0�0��
�F������2�2�G�4G�4G�H�����.�.����@��!�!�.�.�0����(�(�*�����%�%�0�0�5�5����*�*�/�/�	
rAc�<�[5nSUlSURlUR	5n[
R"X!5n[SSURR5nSUlSUl	SUl
SUlURU5 S	Ul[
R"X!5nSSSU4/nURUS	5nURR5 UR R5 URR5 UR R5 UR#URUR5 UR#UR$UR$5 UR#URR&R(URR&R(5 UR#UR R&R(UR R&R(5 gr:)rrfr�rr�rr�rr:r�r�r7rvrhr
rrr�r�rr<r=s        r2�<test_create_by_apply_delta_empty_add_child_updates_parent_id�MTestCHKInventory.test_create_by_apply_delta_empty_add_child_updates_parent_id|s����k��"���&������&�&�(�	��.�.�y�>�����c�h�h�.>�.>�?��%���!���#�����������'���$�3�3�I�C�
���W�g�.�/���0�0��
�F���!�!�.�.�0��3�3�@�@�B����(�(�*��-�-�:�:�<�����2�2�G�4G�4G�H�����.�.����@�����%�%�0�0�5�5����*�*�/�/�	
�	
����7�7�B�B�G�G��1�1�<�<�A�A�	
rAc��[5nSUlSURlUR	[SSURR55 SURS5lSURS5lSURS5l	SURS5l
[5nS	UlSURlUR	[SSURR55 S
URS5lSURS5lSURS5l	S
URS5l
UR5n[R"X15nUR5n[R"X5S5n[R"X25nUR5n[R"X5S5nUR!S/[#UR%U555 g)Nr�r�r�r�rTrrr�sfilerev2Fsbbbbr
r�r�)r��r�r�Tr)rMrMrErEr~)rrfr�rrvrr:r�r�r�r7r�rr�r�r�r�ri�iter_changes)	rCr<r�r�r�r?�inv_1�chk_inv2�inv_2s	         r2�test_iter_changes�"TestCHKInventory.test_iter_changes�s����k��"���&��������
�i�����1A�1A�B�C�,6��
�
�i� �)�.2��
�
�i� �+�-4��
�
�i� �*�-.��
�
�i� �*��{��$���'��	�	������y�&�#�(�(�2B�2B�C�D�-8����y�!�*�/4����y�!�,�.5����y�!�+�./����y�!�+��&�&�(�	��-�-�i�=��� � �"���(�(��;�G���.�.�y�?���!�!�#���(�(��<�H�����	�
�
��#�#�E�*�+�	
rAc��[5nSUlSURlUR	[SSURR55 SURS5lSURS5lSURS5l	SURS5l
UR5n[R"X!5nUR5n[R"X$S	5nUR!UR"[$R&5 UR)S
SS.[+UR"R-555 g)Nr�r�r�r�rTrrr�rM))rArA)rMsfile)rrfr�rrvrr:r�r�r�r7r�rr�r�r�r�rr�CHKMapr��dictr )rCr<r��tmp_invr?r�s      r2�0test_parent_id_basename_to_file_id_index_enabled�ATestCHKInventory.test_parent_id_basename_to_file_id_index_enabled�s���k��"���&��������
�i�����1A�1A�B�C�,6��
�
�i� �)�.2��
�
�i� �+�-4��
�
�i� �*�-.��
�
�i� �*��&�&�(�	��-�-�i�=��� � �"���*�*�9�[�I�����g�C�C�W�^�^�T����%�	�J���6�6�@�@�B�C�	
rAc��[S5n[R"SSS5nSUlSUlSUlSUlURU5nURSU5 URU5nURX$5 URUR[5 URS	URU55 g)
Nr-�filename�	parent-idT�file-rev-idsabcdefgh�ds;file: file-id
parent-id
filename
file-rev-id
abcdefgh
100
Y)sfilenamer-rU�rr
rr�rr�r7�_entry_to_bytesr��_bytes_to_entryr�r�r#�_bytes_to_utf8name_key�rCr<r>�bytes�ie2s     r2�test_file_entry_to_bytes�)TestCHKInventory.test_file_entry_to_bytes�s����4� ��
�
$�
$�Z��\�
J����
�$���"�������#�#�B�'�����P��	
��!�!�%�(������!����c�h�h��,����5�s�7Q�7Q�RW�7X�	
rAc��[S5n[R"SSS5nSUlSUlSUlSUlURU5nURSU5 URU5nURX$5 URUR[5 URS	URU55 g)
Nr-uΩnamerTFrUs123456�s6file: file-id
parent-id
Ωname
file-rev-id
123456
25
N)sΩnamer-rUrWr[s     r2�test_file2_entry_to_bytes�*TestCHKInventory.test_file2_entry_to_bytes�s����4� ��
�
$�
$�Z��|�
L����
�$��� �������#�#�B�'�����Q��	
��!�!�%�(������!����c�h�h��,����9��&�&�u�-�	
rAc�d�[S5n[R"SSS5nSUlUR	U5nURSU5 UR
U5nURX$5 URUR[5 URSURU55 g)NrA�dirnamerT�
dir-rev-ids(dir: dir-id
parent-id
dirname
dir-rev-id)sdirnamerArf)rr
rrrXr�rYr�r�r#rZr[s     r2�test_dir_entry_to_bytes�(TestCHKInventory.test_dir_entry_to_bytess����4� ��
�
)�
)�)�Y��
M��#����#�#�B�'�����G��O��!�!�%�(������!����c�h�h��,����2�C�4N�4N�u�4U�	
rAc��[S5n[R"SSS5nSUlUR	U5nURSU5 UR
U5nURX$5 URUR[5 URURS5 URSURU55 g)NrAu	dirΩnamerfs!dir: dir-id

dirΩname
dir-rev-id)s	dirΩnamerArf)
rr
rrrXr�rYr�r�r#r�r�rZr[s     r2�test_dir2_entry_to_bytes�)TestCHKInventory.test_dir2_entry_to_bytess����4� ��
�
)�
)�)�_�d�
K��#����#�#�B�'�����F��N��!�!�%�(������!����c�h�h��,��
�
�c�m�m�T�*����:��&�&�u�-�	
rAc��[S5n[R"SSS5nSUlSUlURU5nUR
SU5 URU5nUR
X$5 URUR[5 URUR[5 UR
SURU55 g)N�link-id�linknamerT�link-rev-idztarget/paths;symlink: link-id
parent-id
linkname
link-rev-id
target/path)slinknamermro�rr
rmrr�rXr�rYr�r�r#rZr[s     r2�test_symlink_entry_to_bytes�,TestCHKInventory.test_symlink_entry_to_bytess����4� ��
�
$�
$�Z��\�
J��$���)����#�#�B�'�����N��	
��!�!�%�(������!����c�h�h��,����c�0�0�#�6����5�s�7Q�7Q�RW�7X�	
rAc��[S5n[R"SSS5nSUlSUlURU5nUR
SU5 URU5nUR
X$5 URUR[5 URUR[5 UR
SURU55 g)Nrmu
linkΩnamerTrou
target/Ωpaths?symlink: link-id
parent-id
linkΩname
link-rev-id
target/Ωpath)s
linkΩnamermrorpr[s     r2�test_symlink2_entry_to_bytes�-TestCHKInventory.test_symlink2_entry_to_bytes1s����4� ��
�
$�
$�Z�1A�<�
P��$���/����#�#�B�'�����
0��	
�
�!�!�%�(������!����c�h�h��,����c�0�0�#�6����=��&�&�u�-�	
rAc�r�[S5n[R"SSS5nSUlSUlURU5nUR
SU5 URU5nUR
X$5 URUR[5 UR
SURU55 g)N�tree-root-idu
treeΩnamerT�tree-rev-ids
ref-rev-ids>tree: tree-root-id
parent-id
treeΩname
tree-rev-id
ref-rev-id)s
treeΩnamerwrx)rr
rrr�rXr�rYr�r�r#rZr[s     r2�"test_tree_reference_entry_to_bytes�3TestCHKInventory.test_tree_reference_entry_to_bytesEs����4� ��
�
$�
$�_�6F��
U��$��� -����#�#�B�'�����W��	
��!�!�%�(������!����c�h�h��,����B��&�&�u�-�	
rAc���[5nSUlSURlURRnUR[
SSU55 SURS5lSURS5lSURS5l	UR[SS	U55 S
URS5lUR[
SSS55 SURS5lSURS5lSURS5l	UR5n[R"X15nUR5n[R"X5S
5$)Nr�r�r��fïlerrr[r��dir-€�dirrev�childid�chïldr�)rrfr�rr:rvrr�r�r7rr�rr�r�r�)rCr<r�r�r�r?s      r2�make_basic_utf8_inventory�*TestCHKInventory.make_basic_utf8_inventoryWs"���k��"���&������(�(�"�"�����
�i��G�<�=�,6��
�
�i� �)�-4��
�
�i� �*�-.��
�
�i� �*����"�8�-@�'�J�K�+4��
�
�h��(����
�j�*�h�?�@�-7��
�
�j�!�*�.5��
�
�j�!�+�./��
�
�j�!�+��&�&�(�	��-�-�i�=��� � �"���'�'�	�+�F�FrAc�h�UR5nUR0UR5 URUR5 UR5 UR[
URSSS/5[
URR555 URURnURSS/[
URR555 URSnURS/[
URR555 g)Nr�r�rr}r|r�)
r�r��_fileid_to_entry_cacherP�
_fully_cached�_preload_cacherr��keysr)rCr��ie_root�ie_dirs    r2�test__preload_handles_utf8�+TestCHKInventory.test__preload_handles_utf8ks����0�0�2������W�;�;�<�����.�.�/���� �����G�O�O�Y��*�E�F��7�1�1�6�6�8�9�	
��0�0����A�����
 �)�,�f�W�5F�5F�5K�5K�5M�.N�	
��/�/��9�����*��v�f�.>�.>�.C�.C�.E�'F�GrAc��[5nSUlSURlURRnUR[
SSU55 SURS5lSURS5lSURS5l	SURS5l
UR[S	S
U55 SURS	5lUR[
SS
S	55 SURS5lSURS5lSURS5l	SURS5l
UR5n[R"X15nUR5n[R "X5S5nUR#0UR$5 UR'UR(5 UR+5 UR#[-USS	S/5[-UR$R/555 UR1UR(5 UR$UnUR#S
S/[-UR2R/555 UR$S	nUR#S
/[-UR2R/555 g)Nr�r�r�r�rTrrr�rr~rr�Fsddddr�)rrfr�rr:rvrr�r�r�r7rr�rr�r�r�r�r�rPr�r�rr�rNr)	rCr<r�r�r�r?r�r�r�s	         r2�test__preload_populates_cache�.TestCHKInventory.test__preload_populates_cache{s0���k��"���&������(�(�"�"�����
�i���9�:�,6��
�
�i� �)�.2��
�
�i� �+�-4��
�
�i� �*�-.��
�
�i� �*����"�8�U�G�<�=�+4��
�
�h��(����
�j�'�8�<�=�-7��
�
�j�!�*�/4��
�
�j�!�,�.5��
�
�j�!�+�./��
�
�j�!�+��&�&�(�	��-�-�i�=��� � �"���*�*�9�[�I������W�;�;�<�����.�.�/���� �����G�Y��*�=�>��7�1�1�6�6�8�9�	
�	
����-�-�.��0�0��9�����%���&��1B�1B�1G�1G�1I�*J�K��/�/��9�����'��F�6�+;�+;�+@�+@�+B�$C�DrAc�z�UR5nURUR5nURSUR5 URSS/[
URR555 URSS/[
URR555 UR5 URSS/[
URR555 URS5nURS/[
URR555 g)Nr}r|r�r�)
r�r�r�r�rr�rr�r�r�)rCr�r>r�s    r2�3test__preload_handles_partially_evaluated_inventory�DTestCHKInventory.test__preload_handles_partially_evaluated_inventory�s����0�0�2��
�
�
�w���
/���
�
�d�B�L�L�)����-�y�9�6�"�+�+�BR�BR�BT�;U�V����-�y�9�6�"�,�,�BS�BS�BU�;V�W���� ����-�y�9�6�"�,�,�BS�BS�BU�;V�W��"�"�8�,�����*��v�f�.>�.>�.C�.C�.E�'F�GrAc	�h�[S5nSURlURSSS5nSUlURSSS5nS	UlURS
SS5nS
Ul[R
"S5Ul[S5UlUR5n[R"XQ5nURS
S
SU4SSSU4/S5nURSS/5nUR/SQUR5VVs/sHupxXxR 4PM snn5 gs snnf)Nr�r�r�rtr�ssrcrevzsrc/sub/�sub-idssubrev�	src/sub/ar�r�r�content
�src2s	new-rev-2))r\r�)r�r�)zsrc/subr�)r�r�)rr�rr�r�
sha_stringr�rr7r�rr�rh�filterr�r6r:)	rCr<�src_ie�sub_ie�a_ier�r�r�r>s	         r2�'test_filter_change_in_renamed_subfolder�8TestCHKInventory.test_filter_change_in_renamed_subfolder�s'����%��&��������e�[�)�<��#������j�+�y�A��#����|�|�K���9��"��
� �+�+�L�9����\�*����&�&�(�	��)�)�)�9���'�'��k�7�D�9���	�6�2�
�
�
���*�*�g�y�1�2�����
�18�0D�0D�0F�G�0F�H�D�d�J�J�
�0F�G�	
��
Hs�D.r�N)&r$r�r�r�r�r�r�r�r�r�r�rrrrr!r%r(r/r2r7r?rBrJrPr^rbrgrjrqrtryr�r�r�r�r�r�r�rAr2r�r�Hs����
5�=� 	
�=�(=�(C�.H�6
A�A� *�I�<:�4�A�*A�*;�"
�4
�@)
�V
�(
�&
�*
�

�
�$
�(
�$G�(H�  E�DH�
rAr�c�r�\rSrSrSrSrSSjrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrg)�TestCHKInventoryExpandi�c�d�[R"SSS5nURS5nU"U5$r�r�r�s   r2r��$TestCHKInventoryExpand.get_chk_bytes�r�rAc�|�URSX#URS5S-5nXElURU5 g)Nrt�utf-8�-id)r��encoderrv)rCr<r�r�rr>s      r2�make_dir�TestCHKInventoryExpand.make_dir�s3��
�^�^�K��$�+�+�g�:N�QW�:W�
X��������rAc���URSX#URS5S-5n[R"U5Ul[U5UlXFlURU5 g)Nr�r�r�)	r�r�rr�r�rr7rrv)rCr<r�r�r�contentr>s       r2�	make_file� TestCHKInventoryExpand.make_file�sO��
�^�^�F�D�T�[�[��5I�F�5R�
S���)�)�'�2����7�|���������rAc�"�[S5nSUlSURlUR	USSS5 UR	USSS5 UR	USSS5 URUS	SS
5 URUSSS
5 URUSSS
5 URUS
SS
5 URUSSS
5 UR
5n[R"X!SSS9nUR5n[R"X$S5$)NrMr�r�r�r~r
zsub-dir1�dir1-id�toprz	sub-file1z	sub-file2zsubsub-file1�sub-dir1-idz
sub2-file1�dir2-idrVshash-255-way)r
r�r�)rrfr�rr�r�r�rr�r�r�r�s     r2�make_simple_inventory�,TestCHKInventoryExpand.make_simple_inventory�s�����%��"���&�����	
�
�
�c�6�<��;��
�
�c�6�<��;��
�
�c�:�z�9�=����s�E�<��<����s�K��Z�@����s�K��Z�@����s�N�N�J�G����s�L�*�j�A��&�&�(�	��-�-���o�
��� � �"���'�'�	�+�F�FrAc	��UR[U5[URU5Vs/sHoDRPM sn55 gs snfrp)r�r�	_getitemsr:)rC�expected_fileidsr<�file_idsr>s     r2�assert_Getitems�&TestCHKInventoryExpand.assert_Getitems�s@������#�$�����x�)@�A�)@�2�J�J�)@�A�B�	
��As�Ac��URU5upEUR[U5U5 URU5n0nUH:nUR	UR
/5n	U	R
UR5 M< UR5V
Vs0sHup�U
[U5_M nn
nUR5V
Vs0sHup�U
[U5_M nn
nURXu5 gs snn
fs snn
frp)
�'_expand_fileids_to_parents_and_childrenr�rur��
setdefaultr�r"r:�itemsr)rC�all_idsr<r��val_all_ids�val_childrenrT�expected_childrenr��s�k�vs            r2�assertExpand�#TestCHKInventoryExpand.assertExpand�s���&)�&Q�&Q��'
�#��	
����W��{�3��-�-��,�����E�!�,�,�U�_�_�b�A�A�
�H�H�U�]�]�#��2>�1C�1C�1E�F�1E����6�!�9��1E��F�6G�6M�6M�6O�P�6O�d�a�Q��q�	�\�6O��P����*�9��G��Ps�C0�C6c��UR5n/nUR5H!up4URX4R45 M# UR	/SQU5 g)N)	)r\rM)r�r�)r
r�)r��top-id)z
dir1/sub-dir1r�)zdir1/sub-file1�sub-file1-id)zdir1/sub-file2�sub-file2-id)zdir1/sub-dir1/subsub-file1�subsub-file1-id)zdir2/sub2-file1�
sub2-file1-id)r�rjr"r:r�)rCr<�layoutr�r�s     r2�test_make_simple_inventory�1TestCHKInventoryExpand.test_make_simple_inventory
sU���(�(�*�����2�2�4�K�D��M�M�4���/�0�5����

�
�
	
rAc��UR5nURS/US/5 URSUR;5 UR	SUR;5 URS/US/5 URSS/USS/5 URSUR;5 URSUR;5 g)Nr�r�)r�r�rNr�rPr�s  r2�test__getitems�%TestCHKInventoryExpand.test__getitems!s����(�(�*�����j�\�3���=����
�c�&@�&@�@�A�����C�,F�,F�F�G����j�\�3���=����
��)�3��_�0M�	
�	
���
�c�&@�&@�@�A�����3�+E�+E�E�FrAc�P�UR5nURSS/US/5 g�NrMr��r�r�r�s  r2�test_single_file�'TestCHKInventoryExpand.test_single_file0�)���(�(�*�����<��3�S�9�+�FrAc�P�UR5nUR/SQUS/5 g�N)rMr�r�r�r�r�r�s  r2�test_get_all_parents�+TestCHKInventoryExpand.test_get_all_parents4s.���(�(�*�����
�
�
� �		
rAc�P�UR5nUR/SQUS/5 g)N)rMr�r�r�r�r�r�r�r�s  r2�test_get_children�(TestCHKInventoryExpand.test_get_childrenAs-���(�(�*�����
�
�
�L�	
rAc�P�UR5nUR/SQUS/5 g)N)	rMr�r�r�r�r�r�r�r�rMr�r�s  r2�test_from_root�%TestCHKInventoryExpand.test_from_rootPs-���(�(�*�����

�
�
�N�	
rAc�P�UR5nURSS/US/5 gr�r�r�s  r2�test_top_level_file�*TestCHKInventoryExpand.test_top_level_filebr�rAc�P�UR5nUR/SQUS/5 gr�r�r�s  r2�test_subsub_file�'TestCHKInventoryExpand.test_subsub_filefs*���(�(�*�����J��
� �	
rAc�R�UR5nUR/SQUSS/5 g)N)rMr�r�r�r�r�r�r�r�s  r2�test_sub_and_root�(TestCHKInventoryExpand.test_sub_and_rootns-���(�(�*�����U��
�*�+�	
rAr�N)r�)r$r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rAr2r�r��sQ���
�
�G�:
�:�
�(
G�G�
�

�
�$G�
�
rAr�c� �\rSrSrSrSrSrg)�TestMutableInventoryFromTreeiwc��URS5nUR"[R5n[	U5nUR[RUR5 URS[U55 g)N�.r[)�make_repository�
revision_treer�
NULL_REVISIONrr�rfr)rCrrHr<s    r2�
test_empty�'TestMutableInventoryFromTree.test_emptyxs`���)�)�#�.�
��'�'��(>�(>�?��)�$�/������/�/����A�����C��H�%rAc��URS5nURS/5 URS/S/S9 URS5nURR
R
U5n[U5nURX$R5 URS[U55 URSURS5R5 URURRS5R5 SURS5lURURRS5R5 g)Nr��as	thefileid)�ids�commitr
T)�make_branch_and_tree�
build_treervr�r}rr�rr�rfrr�r�rPrWr�)rC�wt�revidrHr<s     r2�test_some_files�,TestMutableInventoryFromTree.test_some_filess��
�
&�
&�s�
+��������
����u�<�.��)��	�	�(�#���y�y�#�#�1�1�%�8��)�$�/��������0�����C��H�%�����c�m�m�L�9�>�>�?�	
����,�,�6�6�|�D�O�O�P�15��
�
�l�#�.�����,�,�6�6�|�D�O�O�PrAr�N)r$r�r�r�r�r�r�r�rAr2r�r�ws
��&�QrAr�c��\rSrSrSrSrg)�
ErrorTestsi�c�R�[SS5nURS[U55 g)N�	a_file_idr�z6File id {a_file_id} already exists in inventory as foo)r�assertEqualDiffr#)rC�errors  r2�test_duplicate_file_id�!ErrorTests.test_duplicate_file_id�s%����U�3�����D�c�%�j�	
rAr�N)r$r�r�r�rr�r�rAr2r�r��s��
rAr�N)T)+r\rrrrrr�tests.scenariosr	rrr
rrrrrrrrrrrr�
load_testsr3r@rr-rnrrr{r,r%r�r�rXr��TestCaseWithMemoryTransportr�r�r�r�r�rAr2�<module>r	s���$J�I�9�0�0����.�
'�
�*�ZC���D�B@�
B� +�^'+� )�FKB�8�KB�\G,�0�G,�T
cC��cC�L62�(�62�r	
�u�8�8�	
�Dj
�U�>�>�j
�ZQ�#8�Q�2
��
rA

Youez - 2016 - github.com/yon3zu
LinuXploit