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__/per_versionedfile.cpython-313.pyc
�

p��g����6�SSKrSSKJr SSKJr SSKJrJrJrJ	r	J
r
 SSKJr SSKJ
r
Jr SSKJrJrJrJr SS	KJr SS
KJr SSKJr SS
KJr SSKJr SSKJr SSKJrJrJ r  SSKJ!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r( SSK)J*r*J+r+ SSK,J-r- \r.S.Sjr/S/Sjr0"SS5r1"SS\\15r2"SS\5r3"SS5r4"SS\\45r5"S S!5r6"S"S#\\65r7"S$S%\5r8"S&S'\5r9"S(S)\5r:"S*S+\5r;"S,S-\5r<g)0�N)�GzipFile)�BytesIO�)�errors�osutils�progress�	transport�ui��graph)�RevisionAlreadyPresent�RevisionNotPresent)�TestCase�TestCaseWithMemoryTransport�TestNotApplicable�TestSkipped)�TestCaseWithWebserver)�load_tests_apply_scenarios)�MemoryTransport�)�
groupcompress)�knit)�
versionedfile)�cleanup_pack_knit�make_file_factory�make_pack_factory)�ChunkedContentFactory�ConstantMapper�ExistingContent�HashEscapedPrefixMapper�PrefixMapper�UnavailableRepresentation�VirtualVersionedFiles�make_versioned_files_factory)�	WeaveFile�WeaveInvalidChecksum)�write_weavec	�8�SSSSSS.nU(aSnOSnURS/SU-/5 URS	S/S	U-/5 URS
S	/SS
U-/5 U(d5URSS	/SSU-/5 URS
S
S/SSSS
U-/5 X4$)zlGet a diamond graph to exercise deltas and merges.

:param trailing_eol: If True end the last line with \n.
�)��origin)��base)��left��right)r+r-r/r1�merged�
�r+r-r/�base
r1r2�left
�right
��	add_lines)�f�trailing_eol�	left_only�parents�	last_chars     �D/usr/lib/python3/dist-packages/breezy/bzr/tests/per_versionedfile.py�get_diamond_vfr@<s���� ���,��G���	��	��K�K�	�2�	�I� 5�6�7��K�K��)��w��':�&;�<��K�K��'��Y��)�0C�$D�E��	���H�w�i�)�X�	�5I�)J�K�	����
�h��
�	�:�y�9�/D�E�	
�

�:�r4c��^^^�T(aSmUS:XaS/nOSS/nU(aSnOSn/nUU4Sjn	U4S	jn
UH2mURURTU
"S
5-SS
U-/55 M4 UH9mURURTU
"S5-U	"S/5SU-/55 M; UH:mURURTU
"S
5-U	"S/5SS
U-/55 M< U(d�UH:mURURTU
"S5-U	"S/5SSU-/55 M< UH=mURURTU
"S5-U	"SS/5SSSSU-/55 M? U$)a�Get a diamond graph to exercise deltas and merges.

This creates a 5-node graph in files. If files supports 2-length keys two
graphs are made to exercise the support for multiple ids.

:param trailing_eol: If True end the last line with \n.
:param key_length: The length of keys in files. Currently supports length 1
    and 2 keys.
:param left_only: If True do not add the right and merged nodes.
:param nograph: If True, do not provide parents to the add_lines calls;
    this is useful for tests that need inserted data but have graphless
    stores.
:param nokeys: If True, pass None is as the key for all insertions.
    Currently implies nograph.
:return: The results of the add_lines calls.
T�r)��FileA��FileBr3r4c�L>�T(agUVs/sHnTU-PM
 nnU$s snf)Nr)r))�suffix_list�suffix�result�nograph�prefixs   ��r?�get_parents�&get_diamond_files.<locals>.get_parentszs,�����4?�@�K�&�f�v�o�K�F�@��M��As�!c�>�T(agU4$)N�Nr))rI�nokeyss �r?�get_key�"get_diamond_files.<locals>.get_key�s������9�r4r+r-r*r/r,r5r1r2r.r0r6r7)�appendr9)�files�
key_lengthr;r<rKrQ�prefixesr>rJrMrRrLs    ``     @r?�get_diamond_filesrXZs����&����Q���4����-����	��	�
�F������
�
��O�O�F�W�Y�%7�7��i�)�>S�=T�U�	
�����
�
��O�O����)�)��\�N�+��9�$�%�
�	
�����
�
��O�O����)�)��Z�L�)��G�i�/�0�
�	
����F��M�M�����W�X�.�.����-���9� 4�5��
���F��M�M�����W�Y�/�/���[� 9�:��	�:�y�9�7L�M��
���Mr4c���\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrS$SjrSrSr Sr!S r"S!r#S"r$g#)%�VersionedFileTestMixIn�z�A mixin test class for testing VersionedFiles.

This is not an adaptor-style test at this point because
theres no dynamic substitution of versioned file implementations,
they are strictly controlled by their owning repositories.
c�J�[US5(dSUlUR$)N�_transaction)�hasattrr]��selfs r?�get_transaction�&VersionedFileTestMixIn.get_transaction�s#���t�^�,�,� $�D��� � � r4c��^�TR5nURS/SS/5 URSS/SS/5 U4SjnU"U5 TRSS9nU"U5 g)	N�r0�a
�b
�r1�c
c�H>�UR5nTRSU;5 TRSU;5 TRURS5SS/5 TRUR	S5S5 TRURS5SS/5 TRS[U55 TRSUR
55 TR[URSS	//5 TR[URS//5 g)
Nrdrgrerf�a
b
rhr�r2�foo)�versions�
assertTrue�assertEqual�	get_lines�get_text�len�num_versions�assertRaisesrr9r
)r:rmr`s  �r?�verify_file�4VersionedFileTestMixIn.test_add.<locals>.verify_file�s�����z�z�|�H��O�O�E�X�-�.��O�O�E�X�-�.����Q�[�[��/�&�&�1A�B����Q�Z�Z��.�	�:����Q�[�[��/�&�&�1A�B����Q��A��'����Q���� 0�1����0�!�+�+�u�v�h�PR�S����4�a�k�k�5�"�b�Qr4T��create)�get_filer9�reopen_file)r`r:rus`  r?�test_add�VersionedFileTestMixIn.test_add�sc����M�M�O��	���E�2���/�0�	���E�E�7�V�V�$4�5�	R�	�A�����D��)���A�r4c�^�TR5n0nURS/SS/5u o2S'URSSS/SS/US9u o2S'URSS/SS	/US9 TR	SUS5 TR	SUS5 U4S
jnU"U5 TR5nU"U5 g![a URSS/SS/US9u o2S'N�f=f)Nrdrerfrg�ghostrh)�parent_textsrk�d
c�>�UR5nTRSU;5 TRSU;5 TRSU;5 TRURS5SS/5 TRURS5SS/5 TRURS5SS/5 TRSUR	55 URS5nTRUS	S	S5 TRUS
S	S5 URS5nTRUS	S	S5 TRUS
S	S5 g)Nrdrgrkrerfrhr�rrrB)rmrnrorprs�annotate)r:rm�originsr`s   �r?ru�GVersionedFileTestMixIn.test_adds_with_parent_texts.<locals>.verify_file�s.����z�z�|�H��O�O�E�X�-�.��O�O�E�X�-�.��O�O�E�X�-�.����Q�[�[��/�&�&�1A�B����Q�[�[��/�&�&�1A�B����Q�[�[��/�&�&�1A�B����Q���� 0�1��j�j��'�G����W�Q�Z��]�E�2����W�Q�Z��]�E�2��j�j��'�G����W�Q�Z��]�E�2����W�Q�Z��]�E�2r4)ryr9�add_lines_with_ghosts�NotImplementedError�assertNotEqualrz)r`r:r�_rus`    r?�test_adds_with_parent_texts�2VersionedFileTestMixIn.test_adds_with_parent_texts�s����M�M�O����$%�K�K��r�F�F�;K�$L�!��1�5�!�	�()�(?�(?���x�(�6�6�*:��)@�)�%�A�q�u�%�	
���E�E�7�V�V�$4�<��P����D�,�u�"5�6����D�,�u�"5�6�	3� 	�A��������A���7#�	�()�����w��� 0�|�)4�)�%�A�q�u�%�	�s�B2�2%C�Cc���UR5nUR[RURS//SQ5 UR[R[
4URS//SQ5 g)N�a)rezb
rh)ryrtr�BzrBadParameterUnicoder9r�r��r`�vfs  r?�test_add_unicode_content�/VersionedFileTestMixIn.test_add_unicode_content�sg���]�]�_������)�)��L�L���#�	
�	
���
�
*�
*�,?�@��$�$���#�	
r4c�t�UR5n[U[5(a[S5eUR	S/S/5 UR	SS//SQSS/S9 UR/SQUR
S55 UR	S	S//SQS
S/S9 UR/SQUR
S	55 g)z�If we change left_matching_blocks, delta changes.

Note: There are multiple correct deltas in this case, because
we start with 1 "a" and we get 3.
z&WeaveFile ignores left_matching_blocks�1re�2)rerere�rrrB)rBrr��left_matching_blocks�3)rrrBN)ry�
isinstancer%rr9rorpr�s  r?�%test_add_follows_left_matching_blocks�<VersionedFileTestMixIn.test_add_follows_left_matching_blocks
s����]�]�_���b�)�$�$��F�G�G�
���T�2��x�(�
����
�F�$�"+�Y�!7�		�	
�	
���1�2�<�<��3E�F�
����
�F�$�"+�Y�!7�		�	
�	
���1�2�<�<��3E�Fr4c�Z�UR5nUR[RURS/S/5 UR[R[
4URS/S/5 UR	S/S/5 UR
S/S/5 g![
a gf=f)Nr�sa

sa
�b)ryrtr�BzrBadParameterContainsNewliner9r�r�r�s  r?�test_inline_newline_throws�1VersionedFileTestMixIn.test_inline_newline_throws&s���
�]�]�_������1�1�2�<�<��r�H�:�	
�	
���
�
2�
2�4G�H��$�$���
�J�	
�	���T�2��z�*�	��$�$�T�2��z�:��"�	��	�s�B�
B*�)B*c��UR5nUR[RURS//SQ5 g)N�a:)rerfrh)ryrtr�
ReservedIdr9r�s  r?�test_add_reserved�(VersionedFileTestMixIn.test_add_reserved:s1��
�]�]�_��������r�|�|�U�B�8P�	
r4c
��UR5nS/4nSSS/4nSSS/4n/nX#U4H-upgURU/U5un n	URU5 M/ [XRX445H[unupgUR	[
URUS-/UUS9 UR	[RURUS-5 M] g	)
�6When nostore_sha is supplied using old content raises.r�r��foo
�bar
�c�barr���nostore_shaN)	ryr9rT�ziprtrrrrp)
r`r��
empty_text�sample_text_nl�sample_text_no_nl�shas�version�lines�shar�s
          r?�test_add_lines_nostoresha�0VersionedFileTestMixIn.test_add_lines_nostoresha@s���
�]�]�_���B�Z�
���8� 4�5��!�H�f�#5�6����)�;L�M�N�G����W�b�%�8�I�C��A��K�K���N�&)��~�A�&
�!�C�!�'�
��������$�����

�
�
���f�7�7����w�QU�~�V�&
r4c
���UR5nS/4nSSS/4nSSS/4n/nX#U4H-upgURU/U5un n	URU5 M/ URS//5 [
XRX445H[unupgUR[URUS
-/UUS9 UR[RURUS
-5 M] g	![an
[S5U
eS	n
A
ff=f)r�r�r�r�r�r�r��dz!add_lines_with_ghosts is optionalNr�r�)ryr9rTr�r�rr�rtrrrrp)r`r�r�r�r�r�r�r�r�r��es           r?�%test_add_lines_with_ghosts_nostoresha�<VersionedFileTestMixIn.test_add_lines_with_ghosts_nostoreshaYs ��
�]�]�_���B�Z�
���8� 4�5��!�H�f�#5�6����)�;L�M�N�G����W�b�%�8�I�C��A��K�K���N�
	J��$�$�T�2�r�2�&)��~�A�&
�!�C�!�'�
�����(�(��$�����

�
�
���f�7�7����w�QU�~�V�&
��#�	J��A�B��I��	J�s�C�
C4�#C/�/C4c
���UR5nS/4nSSS/4nSSS/4nX#U4HuupVURU/U5nURS[U55 UR[R
"U5[
[[U554USS	5 Mw US
nUR[R
"U5[
[[U554URSSS/U5SS	5 g)Nr�r�r�r�r�r�rrrrBr�)ryr9rorrr�sha_strings�sum�map)r`r�r�r�r�r�r�rJs        r?�test_add_lines_return_value�2VersionedFileTestMixIn.test_add_lines_return_valuews���
�]�]�_���B�Z�
���8� 4�5��!�H�f�#5�6��)�;L�M�N�G��\�\�'�2�u�5�F����Q��F��,�����$�$�U�+�S��S�%��-A�B�F�1�Q�K�
�
N��q�!�����
�
 �
 ��
'��S��e�_�)=�>��L�L���d�|�U�3�A�a�8�	
r4c�(�UR5nUR[RURS/5 UR[RUR
S5 UR[RURS5 g)Nsb:)ryrtrr��	get_textsrprqr�s  r?�test_get_reserved�(VersionedFileTestMixIn.test_get_reserved�sc��
�]�]�_�����&�+�+�R�\�\�E�7�C����&�+�+�R�\�\�5�A����&�+�+�R�[�[�%�@r4c�v�[S5H�n0nURSU35nSn/n[U5H*nXF-nS/U-S/-nURXuU5 X�U'U/nM, URSUS/5 URUR	55 URSUR
S55 M� g)�?Add a text with an unchanged last line with no eol should work.�zcase-%sstep-%ds	prelude 
�linesno-eolN)�rangeryr9r��keys�assertEqualDiffrq)	r`�length�
version_linesr�rLr=�stepr�r�s	         r?�+test_add_unchanged_last_line_noeol_snapshot�BVersionedFileTestMixIn.test_add_unchanged_last_line_noeol_snapshot�s����B�i�F��M������x�0�1�B��F��G��f�
�� �-��'��4�/�G�9�<�����W�u�5�).�g�&�"�)��&�
�L�L��G�g�Y�7��L�L��+�+�-�.�� � ��"�+�+�i�*@�A� r4c�R�UR5nS/nS/n/n0n/n[S5HAnSU-nUS-(aUn	OUn	URX�U	S/S9 U/nURU5 X�U'MC UR	5 URU5 UR[
U55 g)N�line
r��sv%drr�r�)ryr�r9rT�checkr��reversed)
r`r�r�r�rmr�r=�ir�r�s
          r?�test_get_texts_eol_variation�3VersionedFileTestMixIn.test_get_texts_eol_variation�s���
�]�]�_��#���$�I�����
����q��A��q�j�G��1�u�&��)��
�L�L��5�	�{�L�S��i�G��O�O�G�$�%*�'�"�� 	���
�
���X��
���X�h�'�(r4c��URS5nURS/S/5 URSS/SS/S/S9 URSURS55 URS	5nURS
/S/5 URSS
/SS/5 URSS/SS/S/S9 URSURS55 g
)r��fulltext�noeolr�snoeol2snewline
)rrBrBr�snewline
line�deltar-sprelude
)rBrBrBN)ryr9r�rqr�s  r?�3test_add_lines_with_matching_blocks_noeol_last_line�JVersionedFileTestMixIn.test_add_lines_with_matching_blocks_noeol_last_line�s����]�]�:�
&��
���X�r�G�9�-�
����
�J�
�7�#�"+��		�	
�	
���-�r�{�{�9�/E�F�
�]�]�7�
#��
���W�b�7�)�,�
���X��y�<��*A�B�
����
�J�
�7�#�"+��		�	
�	
���-�r�{�{�9�/E�Fr4c��SSKJn URS5nURU5 URS5nUR	U5H�nURU/5SnUR
UURU/5UURU/5UU4/5 URURU5URU55 M� g)Nr��multiparent�foo�bar)�breezyr�ry�_setup_for_deltas�	topo_iter�make_mpdiffs�add_mpdiffs�get_parent_map�	get_sha1sr�rq)r`r�r��new_vfr��mpdiffs      r?�test_make_mpdiffs�(VersionedFileTestMixIn.test_make_mpdiffs�s���&�
�]�]�5�
!�����r�"����u�%��"�,�,�R�0�G��_�_�g�Y�/��2�F���� ��)�)�7�)�4�W�=����g�Y�/��8��	��	
�
� � ����W�!5�v���w�7O�P�1r4c���URS5nURSS/S/5 UR[R
URS/5 g![a gf=f)Nr�stextr~r�)ryr�r�rtrrr�r�s  r?�test_make_mpdiffs_with_ghosts�4VersionedFileTestMixIn.test_make_mpdiffs_with_ghosts�s_��
�]�]�5�
!��	��$�$�W�x�j�9�+�F�	
���&�3�3�R�_�_�x�j�Q��#�	��	�s�A�
A"�!A"c�4�URURS55 URS/S/5 URSS/S/5 URSS/SS/5 URSS/SS/5 URS	S/S
/5 URSS/S/5 URS/S/5 URS
SS/S/5 URSS/S/5 SnSnS/n0SS_SS_SS_SS_SS_SS_SS_SS_S S!_S"S#_S$S%_S&S'_S(S)_S*S+_S,S-_S.S/_S0S1_S2S3S4S5S6S7S8S9S:S;.	En[S<5H&nUS=U--nUS/-nURXr/U5 UnM( SnS>nS/n[S<5H&nUS=U--nUS/-nURXr/U5 UnM( U$)?N�baser-r�r�r��noeolsecond�noeolnotshared�phone�eol�phone
�eolline�	noeolbase�eolbeforefirstparent�noeoldup�chain1-rs(da6d3141cb4a5e6f464bf6e0518042ddc7bfd079rBs(45e21ea146a81ea44a821737acdb4f9791c8abe7rs(e1f11570edf3e2a070052366c582837a4fe4e9fars(26b4b8626da827088c514b8f9bbe4ebf181edda1r�s(e28a5510be25ba84d31121cff00956f9970ae6f6�s(d63ec0ce22e11dcf65a931b69255d3ac747a318d�s(2c2888d288cb5e1d98009d822fedfe6019c6a4ea�s(95c14da9cafbf828e3e74a6f016d87926ba234ab�s(779e9a0b28f9f832528d4b21e17e168c67697272�	s(1f8ff4e5c6ff78ac106fcfe6b1e8cb8740ff9a8f�
s(131a2ae712cf51ed62f143e3fbac3d4206c25a05�s(c5a9d6f520d2515e1ec401a8f8a67e6c3c89f199�s(31a2286267f24d8bedaa43355f8ad7129509ea85�
s(dc2a7fe80e8ec5cae920973973a8ee28b2da5e0a�s(2c4b1736566b8ca6051e668de68650686a3922f2�s(5912e4ecd9b0c07be4d013e7e2bdcf9323276cde�s(b0d2e18d3559a00580f6b49804c23fea500feab3s(8e1d43ad72f7562d7cb8f57ee584e20eb1a69fc7s(5cf64a3459ae28efa60239e44b20312d25b253f3s(1ebed371807ba5935958ad0884595126e8c4e823s(2aa62a8b06fb3b3b892a3292a068ade69d5ee0d3s(01edc447978004f6e4e962b417a4ae1955b6fe5ds(d8d8dc49c4bf0bab401e0298bb5ad827768618bbs(c21f62b1c482862983a8ffb2b0c64b3451876e3fs(c0593fe795e00dff6b3c0fe857a074364d5f04fcs(dd1a1cf2ba9cc225c3aff729953e6364bf1d1855)	���r��������%d�chain2-)�assertFalse�has_versionr9r�)r`r:�next_parent�	text_name�text�sha1s�depth�new_versions        r?r��(VersionedFileTestMixIn._setup_for_deltass���������v�.�/�	
���G�R�)��-�	���H�w�i�'��3�	
���N�X�J��G�0D�E�	���%��'7�)�X�9N�O�	���F�X�J���5�	���J��
�Y�K�8�	���L�"�w�i�0�
	
���+�l�H�-E��y�Q�	���K�(��g�Y�7����	��{��
�
�:�
�
�:�
�
�:�
�
�:�	
�

�:�
�
�:�

�
�:�
�
�:�
�
�:�
�
�:�
�
�;�
�
�;�
�
�;�
�
�;�
�
�;�
� 
�;�!
�"
�;�#
�$<�;�;�;�;�;�;�;�;�5
��8�2�Y�E�#�e�e�m�3�K��9�+�%�D�
�K�K��]�D�9�%�K�	�
���	��{���2�Y�E�#�e�e�m�3�K��9�+�%�D�
�K�K��]�D�9�%�K�	�
�r4c��UR5nUR[5UR/55 UR	S/SS/5 UR	SS/SS/5 UR	SS/SS/5 UR	SS/SS/5 UR	SSS/SS/5 UR[5UR/55 URS/5 UR[URSS	/5 UR[URS55[URS555 g)
Nrdrerfrgrhrk�r3srMsrX)ryro�set�get_ancestryr9rtr�r`r:s  r?�
test_ancestry�$VersionedFileTestMixIn.test_ancestryIs���M�M�O����������r� 2�3�	���E�2���/�0�	���E�E�7�V�V�$4�5�	���E�E�7�V�V�$4�5�	���E�E�7�V�V�$4�5�	���E�E�5�>�F�F�+;�<���������r� 2�3�	����w�����,�a�n�n�u�e�n�M�����Q�^�^�E�2�3�S�����9N�5O�Pr4c���SUlUR5nSUlUR[RUR
S//5 UR[RURS//5 g)N�before�afterr4)r]ryrtr�OutSideTransactionr9r�r$s  r?�test_mutate_after_finish�/VersionedFileTestMixIn.test_mutate_after_finishXsb��$����M�M�O��#������&�3�3�Q�[�[�#�r�2�N�����%�%�q�'>�'>��R��	
r4c��UR5nURS/S/5 [5nURSU5 UR	5R5H&nUR
URSU-55 M( g)N�0rer�)ryr9r�copy_to�get_factory�get_suffixesrn�has)r`r:�trIs    r?�test_copy_to�#VersionedFileTestMixIn.test_copy_toasj���M�M�O��	���D�"�v�h�'����	�	�	�%����&�&�(�5�5�7�F��O�O�A�E�E�%�&�.�1�2�8r4c��UR5 UR[UR5R	5[
55 grP)ryrnr�r0r1�listr_s r?�test_get_suffixes�(VersionedFileTestMixIn.test_get_suffixesis0���
�
�����
�4�#3�#3�#5�#B�#B�#D�d�K�Lr4c��UR5nURS/SS/5 URSS0URS/55 URSS/SS/5 URSS0URS/55 URSSS.URSS/55 URS/SS/5 URS	/SS/5 URS
/SQSS/5 URS
S0URS
/55 UR0URS55 URSSS.UR/S
Q55 g)Nrdrerfr)rg�rd)rdrgrkr!�m)rdrgrkr!�y)rdr=rg)ryr9ror�r$s  r?�test_get_parent_map�*VersionedFileTestMixIn.test_get_parent_mapnsE���M�M�O��	���E�2���/�0����%���a�&6�&6��w�&?�@�	���E�E�7�V�V�$4�5����%��*�A�,<�,<�e�W�,E�F�����H�5�q�7G�7G��PU��7W�X�	���E�2���/�0�	���E�2���/�0�	���D�6���8H�I����$� <�=�q�?O�?O�QU�PV�?W�X�����Q�-�-�d�3�4�����x�(�!�*:�*:�;O�*P�	
r4c�>�UR5nURS/SS/5 URSS/SS/5 URS5nURUSSS5 URUSSS5 UR	[
URS5 g)	NrdrerfrgrhrrBrl)ryr9r�rortr)r`r:r�s   r?�
test_annotate�$VersionedFileTestMixIn.test_annotate~s����M�M�O��	���E�2���/�0�	���E�E�7�V�V�$4�5��*�*�U�#��������A���.�������A���.����,�a�j�j�&�Ar4c�P�UR5nURSURS55 UR[URS5 UR[UR
S5 UR[UR5 UR5nURSURS55 UR[URS5 UR[UR
S5 UR[UR5 g)N�hello
�v1�v2)�get_file_corrupted_textrorqrtr&rpr��get_file_corrupted_checksum�r`�ws  r?�test_detection�%VersionedFileTestMixIn.test_detection�s���
�(�(�*������Q�Z�Z��%6�7����.��
�
�E�B����.����U�C����.����8��,�,�.������Q�Z�Z��%6�7����.��
�
�E�B����.����U�C����.����8r4c�,�[UR5e)z=Return a versioned file with corrupt text but valid metadata.)r�rGr_s r?rG�.VersionedFileTestMixIn.get_file_corrupted_text�s��!�$�">�">�?�?r4c�,�[UR5e)z(Open the versioned file from disk again.)r�rz�r`�names  r?rz�"VersionedFileTestMixIn.reopen_file�s��!�$�"2�"2�3�3r4c�^^^�"SS[R5mTR5mTRS/S/5 TRS/S/5 TRSS/S/5 TRS	S/SS
/5 TRSSS//SQ5 UUU4S
jnU"S	S//SQ5nTR	USS:�5 TR	USS:�5 U"S/SQ5nTR	USS:�5 TR	USS:�5 TR	USS:�5 TR	USS:�5 TR	USS:�5 g)Nc�$�\rSrSrSrSSjrSrg)�aVersionedFileTestMixIn.test_iter_lines_added_or_present_in_versions.<locals>.InstrumentedProgressi�c�P�[RRU5 /UlgrP�r�ProgressTask�__init__�updatesr_s r?rY�jVersionedFileTestMixIn.test_iter_lines_added_or_present_in_versions.<locals>.InstrumentedProgress.__init__�����%�%�.�.�t�4�!��r4Nc�>�URRXU45 grP�rZrT�r`�msg�current�totals    r?�update�hVersionedFileTestMixIn.test_iter_lines_added_or_present_in_versions.<locals>.InstrumentedProgress.update�������#�#�S�5�$9�:r4�rZ�NNN��__name__�
__module__�__qualname__�__firstlineno__rYrc�__static_attributes__r)r4r?�InstrumentedProgressrU����
"�
;r4rnr-r5�	lancestor�
lancestor
�	rancestor�
rancestor
�child�child
�
otherchild�r5rq�otherchild
c��>�0nT"5nTRXS9H!nURUS5 X$==S-
ss'M# UR/:waTRXR5 U$�N)�pbrrB)�'iter_lines_added_or_present_in_versions�
setdefaultrZro)rm�expectedr�r�linernr`r�s     ���r?�iter_with_versions�_VersionedFileTestMixIn.test_iter_lines_added_or_present_in_versions.<locals>.iter_with_versions�su����E�+�-�H��B�B��C���� � ��q�)���q� ��	�
���2�%�� � ��+;�+;�<��Lr4�)�Walking contentrr)r�rBr)r�rr)rurtr)rxrv�)r�rr)r�rBr)r�rr)r�rr)r�r�r)r�rr)r5r-)rqrp)rsrr)rrXryr9rn)r`r�r�rnr�s`  @@r?�,test_iter_lines_added_or_present_in_versions�CVersionedFileTestMixIn.test_iter_lines_added_or_present_in_versions�sd���	;�8�#8�#8�	;��]�]�_��
���W�b�9�+�.�
���\�2��'7�8�
���\�G�9�~�.>�?�
���X��~�	�:�/F�G�
����
�7�#�8�	
�	�#�
�}�%�
�
��	
����4�5��9�:�����>�?�!�C�D�#��
�

��	
����2�3�a�7�8�����<�=��A�B�����<�=��A�B�����4�5��9�:�����>�?�!�C�Dr4c���UR5nSnURS5nURSU//5 UR5nURS1URS55 URURU55 URUS1URS/55 URU/UR
S55 URU//5 URUS1URS/55 URSU40URS/55 URURU55 URUS1URS/55 URU/UR
S55 g![aF UR	[UR
S/5 UR	[URS5 gf=f)Nub¿se�utf8s	notbxbfserl)ry�encoder�r�rt�get_ancestry_with_ghosts�get_parents_with_ghostsrzror#rrr9r�rn)r`r��parent_id_unicode�parent_id_utf8s    r?�test_add_lines_with_ghosts�1VersionedFileTestMixIn.test_add_lines_with_ghosts�s���
�]�]�_��&��*�1�1�&�9��	��$�$�\�N�3C�R�H��
�
�
��	
���,������)F�G��������7�8����
�\�*�B�,G�,G���,W�	
�	
���.�)�2�+E�+E�l�+S�T�	���^�R��,����
�\�*�B�O�O�\�N�,K�	
�	
���
�N�,�-�r�/@�/@�,��/P�	
�	
������~�6�7����
�\�*�B�,G�,G���,W�	
�	
���.�)�2�+E�+E�l�+S�T��A#�	����#�R�%@�%@�6�(�
�
���1�2�3M�3M�v�V��
	�s�F�A
G$�#G$c�>�UR5nURS/SS/5 URSSS//SQ5 URS5nUR	SUS5 UR	S	US
5 UR	SUS5 g![a gf=f)
Nr-r��line_b
�references_ghostsa_ghost)r�r��line_c
)r-r�r)r-r�rB)r�r�r)ryr�r�r�ro)r`r�r�s   r?�,test_add_lines_with_ghosts_after_normal_revs�CVersionedFileTestMixIn.test_add_lines_with_ghosts_after_normal_revss���
�]�]�_��	��$�$�W�b�9�k�2J�K�	� � ��
�j�!�1�	
�
�+�+�1�2�����-�w�q�z�:����/����<����;�W�Q�Z�H��#�	��	�s�B�
B�Bc��UR5nUR5nU"SUSSSS9nU"SUSS9nUR[RUR
S//5 UR[RURS//5 g)	N�idi�TrJ)rx�access_mode�r)r�r-)�
get_transportr0rtr�
ReadOnlyErrorr9r�)r`r3�factoryr�s    r?�test_readonly_mode�)VersionedFileTestMixIn.test_readonly_mode4s������ ���"�"�$��
�T�1�e�D�c�
B��
�T�1�#�
.�����&�.�.����g�r�2�N����� � �"�":�":�G�R��	
r4c���UR5nURS/S/5 URSS/S/5 URS/S/5 URSSSS.UR/SQ55 g)Nr�rer�r�s(3f786850e387550fdab836ed7e6dc881de23001bs(86f7e437faa5a7fce15d1ddcb9eaeaea377667b8)r�r�r�)ryr9ror�r�s  r?�test_get_sha1s�%VersionedFileTestMixIn.test_get_sha1s>sp��
�]�]�_��
���T�2��x�(�
���T�D�6�F�8�,�
���T�2��v�&����A�A�A�
�

�L�L�+�,�
	
r4)r]N�r�)%rirjrkrl�__doc__rar{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r%r+r4r8r>rArKrGrzr�r�r�r�r�rmr)r4r?rZrZ�s����!�
�.#�J
�&G�2�(
�W�2W�<
�.A�B�2)�8G�8Q�(R�E�N
Q�
�3�M�

� B�9�*@�4�JE�X,U�\I�*
�
r4rZc�@�\rSrSrS
SjrSrSrSSjrSrSr	Sr
g	)�	TestWeaveiQc�H�[XR5SURS9$)NT�rx�	get_scope�r%r�rarPs  r?ry�TestWeave.get_fileRs%����$�$�&�t�t�?S�?S�
�	
r4c�X�[SUR5SURS9nURS/S/5 URSS/SS/5 UR	/SQUR
5 UR	S	S
/UR5 UR5 SUR
S'U$)
Nr�Tr�rErDrF�there
))�{rrD��}N)r�rBr�r�s(f572d396fae9206628714fb2ce00f72e94f2258fs(90f265c6e75f1c8f9ab76dcf85528352c5f215efsThere
r�)r%r�rar9ro�_weave�_sha1sr�rIs  r?rG�!TestWeave.get_file_corrupted_textWs�����4�%�%�'���@T�@T�
��	
���E�2�
�|�,�	���E�E�7�Z��$<�=�	
���V�
�H�H�	
�
	
���;�;�
�
�H�H�	
�	
���	�!�������r4c��UR5nSURS'URSURS55 SURS'U$)Nr�r�shello
there
rFs(f0f265c6e75f1c8f9ab76dcf85528352c5f215efrB)rGr�rorqr�rIs  r?rH�%TestWeave.get_file_corrupted_checksumrsL���(�(�*�� ���������*�A�J�J�u�,=�>�B�������r4c�F�[XR5X RS9$)Nr�r�)r`rQrxs   r?rz�TestWeave.reopen_file|s#����$�$�&�v�AU�AU�
�	
r4c�~�UR[R[SUR	5UR
S9 g)Nr�)r�)rtr	�
NoSuchFiler%r�rar_s r?�test_no_implicit_create�!TestWeave.test_no_implicit_create�s9������ � ������ ��*�*�	�	
r4c��[$rP�r%r_s r?r0�TestWeave.get_factory�����r4r)Nr�)r�F)rirjrkrlryrGrHrzr�r0rmr)r4r?r�r�Qs ��
�
�6�
�

�r4r�c�@^�\rSrSrU4SjrSrSrSrSrSr	U=r
$)�TestPlanMergeVersionedFilei�c�j>�[TU]5 [5n[SU5nU"UR	S55UlU"UR	S55Ul[R"S5Ul	URRRUR
UR/5 g)NTzroot-1zroot-2�root)�super�setUpr!rr��vf1�vf2r�_PlanMergeVersionedFile�
plan_merge_vf�fallback_versionedfiles�extend)r`�mapperr��	__class__s   �r?r�� TestPlanMergeVersionedFile.setUp�s����
��
�����#�D�&�1���4�-�-�h�7�8����4�-�-�h�7�8���*�B�B�6�J������2�2�9�9�4�8�8�T�X�X�:N�Or4c�L�URRS//5 UR[URRS//5 UR[URRSS/5 UR[URRS/S5 g)N)�rootr�)r�r�)r�r9rt�
ValueErrorr_s r?�test_add_lines�)TestPlanMergeVersionedFile.test_add_lines�s������$�$�%5�r�2�>������*�*�4�4�o�r�2�	
�	
�����*�*�4�4�6F��b�	
�	
�����*�*�4�4�6F��D�	
r4c�8�URRS/S/5 URRSS/S/5 URRS/S/5 URRSS/S/5 URRS	SS/S
/5 g)N�r��Ar��r��Br��r��Cr��r��Dr��r��E:�e)r�r9r�r�r_s r?�setup_abcde�&TestPlanMergeVersionedFile.setup_abcde�s��������?�B���7������?�_�,=��v�F������?�B���7������?�_�,=��v�F����$�$����@�4�&�	
r4c���UR5 URSS0URRS/55 URSS0URRS/55 URSS0URRS/55 UR0URRS/55 URSSSS.URR/S	Q55 g)
Nr�)r�r�)r�r�)r�r��r��F)r�r�r�)r�r�r�r�)r�ror�r�r_s r?�test_get_parents�+TestPlanMergeVersionedFile.test_get_parents�s����������
�0�1����-�-��.?�@�	
�	
���
�0�1����-�-��.?�@�	
�	
���
�A�B����-�-�/?�.@�A�	
�	
����T�/�/�>�>��?P�Q�R����!3�!3�"D�
�

���-�-�U�
�
		
r4c��^�TR5 U4SjnTRSU"S5RS55 TRSSRU"S5R	S555 TRSU"S5RS55 TRS	U"S
5RS55 TRSU"S5R
5 g)
Nc�V>�[TRRSU4/SS55$)Nr��	unorderedT)�nextr��get_record_stream)rIr`s �r?�
get_record�ETestPlanMergeVersionedFile.test_get_record_stream.<locals>.get_record�s3�����"�"�4�4��v�&�'��d���
r4r�r�r�r4�chunkedr�r�r�r��absent�F)r�ro�get_bytes_as�join�
iter_bytes_as�storage_kind)r`r�s` r?�test_get_record_stream�1TestPlanMergeVersionedFile.test_get_record_stream�s��������	�	
����z�$�/�<�<�Z�H�I�����s�x�x�
�4�(8�(F�(F�y�(Q�R�S�����z�$�/�<�<�Z�H�I�����z�%�0�=�=�j�I�J�����:�c�?�#?�#?�@r4)r�r�r�)rirjrkrlr�r�r�r�r�rm�
__classcell__�r�s@r?r�r��s$���P�

�
�
�4A�Ar4r�c�&�\rSrSrSrSrSrSrg)�TestReadonlyHttpMixini�c��g)NrBr)r_s r?ra�%TestReadonlyHttpMixin.get_transaction�s��r4c���UR5 UR5"S[R"UR	S555nUR/UR
55 g)Nr��.)ryr0r	�get_transport_from_url�get_readonly_urlrorm)r`�readonly_vfs  r?�test_readonly_http_works�.TestReadonlyHttpMixin.test_readonly_http_works�sT���
�
���&�&�(��9�3�3�D�4I�4I�#�4N�O�
��	
����[�1�1�3�4r4c���UR5nURS/S/5 URSS/SS/5 UR5"S[R"URS555nUR
SS/UR55 UR
SS/UR55 UR5HnURU5 M g)Nr�rer�rfr�r�)	ryr9r0r	r�r�rormrp)r`r�rr�s    r?�%test_readonly_http_works_with_feeling�;TestReadonlyHttpMixin.test_readonly_http_works_with_feeling�s���
�]�]�_��
���T�2��x�(�
���T�D�6�F�F�#3�4��&�&�(��9�3�3�D�4I�4I�#�4N�O�
��	
���$���r�{�{�}�5����$���{�';�';�'=�>�"�+�+�-�G��!�!�'�*�.r4r)N)rirjrkrlrarrrmr)r4r?r�r��s���5�+r4r�c� �\rSrSrSrSrSrg)�
TestWeaveHTTPi�c�J�[SUR5SURS9$)Nr�Tr�r�r_s r?ry�TestWeaveHTTP.get_file�s'����4�%�%�'���@T�@T�
�	
r4c��[$rPr�r_s r?r0�TestWeaveHTTP.get_factory�r�r4r)N)rirjrkrlryr0rmr)r4r?rr�s��
�
r4rc�v�\rSrSrSrSrSrSr/SQrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrg)�MergeCasesMixini�c
� �SnUR5nURS/[[XQ555 URSS/[[XR555 URSS/[[XS555 UR	U5 URS5 [UR
SS55nUH(up�U	(dMURUSSU	SS35 M* URS	5 [5n
U
RURU55 U
RS
5 URU
R55 [[XT55nURU
R5U5 g)Nc��US-$)Nr3r))�xs r?�addcrlf�(MergeCasesMixin.doMerge.<locals>.addcrlfs���u�9�r4�text0�text1�text2�merge plan:�12� | ���zmerge:r)ryr9r7r��log_contents�log�
plan_merger�
writelines�weave_merge�seek�getvaluero�	readlines)r`r��a�b�mprrJ�p�stater�mts           r?�doMerge�MergeCasesMixin.doMerge�s/��	�
�M�M�O��	���H�b�$�s�7�'9�":�;�	���H�x�j�$�s�7��*?�@�	���H�x�j�$�s�7��*?�@����!�����������h��1�2���K�E��t����E�"�:�S��c�r���4�5��	
�����
�Y��
�
�
�a�m�m�A�&�'�
����
���������
�#�g�"�
#����������,r4c�0�UR/S//S/5 g)Nsaa�r(r_s r?�
testOneInsert�MergeCasesMixin.testOneInserts�����R�%��"�u�g�.r4c�<�UR/SQ/SQ/SQ/SQ5 g)N��aaa�bbb�ccc�r0�xxxr1r2)r0r1�yyyr2�r0r4r1r5r2r+r_s r?�testSeparateInserts�#MergeCasesMixin.testSeparateInsertss�����$�,�,�4�		
r4c�<�UR/SQ/SQ/SQ/SQ5 g)Nr/r3r6r+r_s r?�testSameInsert�MergeCasesMixin.testSameInsert$s�����$�,�4�4�		
r4�r0r4r5r1c�L�URSS//SQ/SQUR5 g)Nr0r1r<)r0r4r1)r(�overlappedInsertExpectedr_s r?�testOverlappedInsert�$MergeCasesMixin.testOverlappedInsert.s%�����
�V��,�$��)�)�		
r4c�8�URS/S/SS//SQ5 g)Nr0r4r5�zzz)�<<<<<<< r4�=======r5rB�>>>>>>> r+r_s r?�testClashReplace� MergeCasesMixin.testClashReplace9s#�����
�H�
�H�
�V��J�		
r4c�:�URS/SS/SS//SQ5 g)Nr0r4r5rB)rCr4r0rDr5rBrEr+r_s r?�testNonClashInsert1�#MergeCasesMixin.testNonClashInsert1As&�����
�H�
�V��
�V��R�		
r4c�8�URS/S/SS/SS/5 g)Nr0r5rBr+r_s r?�testNonClashInsert2�#MergeCasesMixin.testNonClashInsert2Is"�����f�X��x�&�&�)9�F�F�;K�Lr4c��g)z�Clashing delete and modification.

If one side modifies a region and the other deletes it then
there should be a conflict with one side blank.
Nr+r_s r?�testDeleteAndModify�#MergeCasesMixin.testDeleteAndModifyLs��	r4c�N�UR5nURS/URS55 URSS/URS55 URSS/URS55 URS5 [	URSS55nUH(upxU(dMURUSSUSS35 M* URS	5 S
R
URU55n	URU	5 URX�5 g)NrTrrrrrrz
merge result:r4)	ryr9�
splitlinesrr7rr�rr�)
r`r�r"r#r~rJr%r&r�result_texts
          r?�_test_merge_from_strings�(MergeCasesMixin._test_merge_from_strings]s����M�M�O��	���H�b�$�/�/�$�"7�8�	���H�x�j�!�,�,�t�*<�=�	���H�x�j�!�,�,�t�*<�=����������h��1�2���K�E��t����E�"�:�S��c�r���4�5��	
����!��h�h�q�}�}�Q�/�0����������[�3r4c��SRUR5RS/55nURUS5 g)Nr4)znew-arDrD)r�ryrro)r`rJs  r?�test_weave_merge_conflicts�*MergeCasesMixin.test_weave_merge_conflictsls5�����$�-�-�/�5�5�7L�6M�N�O�������,r4c�8�SnSnSnSnURXX45 g)z)One side deletes, the other deletes more.sE            line 1
            line 2
            line 3
            s2            line 1
            line 2
            s            line 1
            sL            line 1
<<<<<<< 
            line 2
=======
>>>>>>> 
            N�rT�r`r�r"r#rJs     r?�test_deletion_extended�&MergeCasesMixin.test_deletion_extendedqs0����

��
����	
�%�%�d�q�9r4c�8�SnSnSnSnURXX45 g)z�Delete overlapping regions with no other conflict.

Arguably it'd be better to treat these as agreement, rather than
conflict, but for now conflict is safer.
s�            start context
            int a() {}
            int b() {}
            int c() {}
            end context
            sU            start context
            int a() {}
            end context
            sU            start context
            int c() {}
            end context
            s�            start context
<<<<<<< 
            int a() {}
=======
            int c() {}
>>>>>>> 
            end context
            NrZr[s     r?�test_deletion_overlap�%MergeCasesMixin.test_deletion_overlap�s0����
��

��
��	
�%�%�d�q�9r4c�8�SnSnSnSnURXX45 g)z.Agree to delete some lines, without conflicts.�n            start context
            base line 1
            base line 2
            end context
            sV            start context
            base line 1
            end context
            NrZr[s     r?�test_agreement_deletion�'MergeCasesMixin.test_agreement_deletion�s0����
��

��
��
	
�%�%�d�q�9r4c�8�SnSnSnSnURXX45 g)a_Specific case of merge where we can synchronize incorrectly.

A previous version of the weave merge concluded that the two versions
agreed on deleting line 2, and this could be a synchronization point.
Line 1 was then considered in isolation, and thought to be deleted on
both sides.

It's better to consider the whole thing as a disagreement region.
rbsy            start context
            base line 1
            a's replacement line 2
            end context
            sl            start context
            b replaces
            both lines
            end context
            s�            start context
<<<<<<< 
            base line 1
            a's replacement line 2
=======
            b replaces
            both lines
>>>>>>> 
            end context
            NrZr[s     r?�test_sync_on_deletion�%MergeCasesMixin.test_sync_on_deletion�s0����
��
��
��	
�%�%�d�q�9r4r)N)rirjrkrlr(r,r7r:r>r?rFrIrLrOrTrWr\r_rcrfrmr)r4r?r
r
�sX��-�4/�
�
� @��
�
�
�M�
�"
4�-�
:�. :�D:�2':r4r
c�,�\rSrSrSSjrSr/SQrSrg)�TestWeaveMergei�c�2�[XR5SS9$)NTrw)r%r�rPs  r?ry�TestWeaveMerge.get_file�s����1�1�3�D�A�Ar4c��URS5 [5n[X5 URUR55 g)Nz	weave is:)rrr'r )r`rJ�tmpfs   r?r�TestWeaveMerge.log_contents�s/��������y���A���������!r4)r0rCr4r5rDr4rEr1r)Nr�)rirjrkrlryrr>rmr)r4r?riri�s��B�"�	 �r4ric�N�\rSrSrSrS
SjrSrSrSrSr	Sr
S	rS
rSr
g)�TestContentFactoryAdaptionic�B�SS[R4SS[R4SS[R4SS[R4SS[R4SS[R4SS[R4SS[R4SS[R
4SS[R4SS[R4SS[R4/nUH?up#n[RRX#45nU"S5nURXd5 MA g)	zTest expected adapters exist.�
knit-delta-gzr�r�r��
knit-ft-gz�knit-annotated-delta-gz�knit-annotated-ft-gzN)�	_mod_knit�DeltaPlainToFullText�FTPlainToFullText�DeltaAnnotatedToUnannotated�DeltaAnnotatedToFullText�FTAnnotatedToUnannotated�FTAnnotatedToFullTextr�adapter_registry�get�assertIsInstance)r`�	scenarios�source�	requested�klass�adapter_factory�adapters       r?�test_select_adaptor�.TestContentFactoryAdaption.test_select_adaptors��
�j�)�*H�*H�I�
�g�y�'E�'E�F�
�i��)G�)G�H�
�:�y�'B�'B�C�
�7�I�$?�$?�@�
�9�i�&A�&A�B�)���5�5�
�
'�
�I�4V�4V�W�
#�\�9�3U�3U�V�
#�Z��1P�1P�Q�
#�W�i�.M�.M�N�
#�Y�	�0O�0O�P�!
�	�$)2�$�F�u�+�<�<�@�@�&�AT�U�O�%�d�+�G��!�!�'�1�)2r4c�Z�[S5nUR5n[X5"U5$)Nr)rr�r)r`�	annotatedr�r	s    r?�get_knit�#TestContentFactoryAdaption.get_knits*����'���&�&�(�	� ��3�I�>�>r4c���URS/SS5n[U5nURXr5nURS/SS5n[U5n	URX�5n
X�4$)z,Grab the interested adapted texts for tests.r*r�F�r2)r�r��	get_bytes)r`r:�ft_name�
ft_adapter�
delta_name�
delta_adapter�entriesr��ft_data�merged�
delta_datas           r?�helpGetBytes�'TestContentFactoryAdaption.helpGetBytes$sk���%�%�|�n�k�5�I���G�}���&�&�t�5���%�%�|�n�k�5�I���g���"�,�,�V�@�
��"�"r4c	�|�UR5n[USSS9 URUS[R"S5S[R
"S55up#UR
S[S[U5S	9R55 UR
S
[S[U5S	9R55 g)�5Test converting annotated knits to unannotated knits.rBF�r;rsNrrsLversion origin 1 b284f94827db1fa2970d9e2014f080413b547a7e
origin
end origin
�rb��mode�fileobjs]version merged 4 32c2e79763b3f90e8ccde37f9710b6629c25a796
1,2,3
left
right
merged
end merged
�
r�rXr�rvr{ryrorr�read�r`r:r�r�s    r?�test_deannotation_noeol�2TestContentFactoryAdaption.test_deannotation_noeol0s���
�M�M�O���!�Q�U�3�"�/�/�
���.�.�t�4���1�1�$�7�
���	
���
�
�$���(8�9�>�>�@�		
�	
���
8��$��
�(;�<�A�A�C�	
r4c	�~�UR5n[US5 URUS[R"S5S[R
"S55up#UR
S[S[U5S9R55 UR
S[S[U5S9R55 g)	r�rBrsNrrsLversion origin 1 00e364d235126be43292ab09cb4686cf703ddc17
origin
end origin
r�r�sXversion merged 3 ed8bce375198ea62444dc71952b22cfc2b09226d
2,2,2
right
merged
end merged
r�r�s    r?�test_deannotation�,TestContentFactoryAdaption.test_deannotationHs���
�M�M�O���!�Q��"�/�/�
���.�.�t�4���1�1�$�7�
���	
���
�
�$���(8�9�>�>�@�		
�	
���
2��$��
�(;�<�A�A�C�	
r4c	�p�UR5n[USSS9 [R"U5nUR	US[
R"S5S[
R"U55up4URSU5 URSU5 URSS	/S
S4/UR5 g)�<Test adapting annotated knits to full texts (for -> weaves).rBFr�r�Nr+�base
left
right
mergedr�r.r�T�
r�rXr� RecordingVersionedFilesDecoratorr�rvr|rzro�calls�r`r:�	logged_vfr�r�s     r?�!test_annotated_to_fulltext_no_eol�<TestContentFactoryAdaption.test_annotated_to_fulltext_no_eol`s���
�M�M�O���!�Q�U�3�"�B�B�1�E�	�"�/�/�
���+�+�D�1���.�.�y�9�
���	
����G�,����5�z�B����!�J�<��d�
C�D�i�o�o�	
r4c	�r�UR5n[US5 [R"U5nUR	US[
R"S5S[
R"U55up4URSU5 URSU5 URSS/SS	4/UR5 g)
r�rBr�N�origin
�base
left
right
merged
r�r.r�Tr�r�s     r?�test_annotated_to_fulltext�5TestContentFactoryAdaption.test_annotated_to_fulltextus���
�M�M�O���!�Q��"�B�B�1�E�	�"�/�/�
���+�+�D�1���.�.�y�9�
���	
����g�.����7��D����!�J�<��d�
C�D�i�o�o�	
r4c	�p�URSS9n[US5 [R"U5nUR	US[
R"S5S[
R"U55up4URSU5 URSU5 URSS	/S
S4/UR5 g)�hTest adapting unannotated knits to full texts.

This is used for -> weaves, and for -> annotated knits.
F�r�rBr�Nr�r�r�r.r�T�
r�rXrr�r�rvrxrwror�r�s     r?�test_unannotated_to_fulltext�7TestContentFactoryAdaption.test_unannotated_to_fulltext�s���
�M�M�E�M�*���!�Q��"�B�B�1�E�	�"�/�/�
���'�'��-���*�*�9�5�
���	
����g�.����7��D����!�J�<��d�
C�D�i�o�o�	
r4c	�n�URSS9n[USSS9 [R"U5nUR	US[
R"S5S[
R"U55up4URSU5 URSU5 URS	S
/SS4/UR5 g)
r�Fr�rBr�r�Nr+r�r�r.r�Tr�r�s     r?�#test_unannotated_to_fulltext_no_eol�>TestContentFactoryAdaption.test_unannotated_to_fulltext_no_eol�s���
�M�M�E�M�*���!�Q�U�3�"�B�B�1�E�	�"�/�/�
���'�'��-���*�*�9�5�
���	
����G�,����5�z�B����!�J�<��d�
C�D�i�o�o�	
r4r)N)T)rirjrkrlr�r�r�r�r�r�r�r�r�rmr)r4r?rprps/��2�6?�

#�
�0
�0
�*
�*
�0
r4rpc�0�\rSrSrSrSrSrSrSrSr	g)	�
TestKeyMapperi�z$Tests for various key mapping logic.c��[R"S5nURSURS55 URSURS55 g)N�	inventory)sfoo@ar)squux)rrror��r`r�s  r?�test_identity_mapper�"TestKeyMapper.test_identity_mapper�sD���-�-�k�:������f�j�j��&>�?�����f�j�j��&<�=r4c�6�[R"5nURSURS55 URSURS55 URSUR	S55 URSUR	S55 g)Nzfile-id��file-id�revision-idznew-id��new-idr��r��r�)rr!ror��unmapr�s  r?�test_prefix_mapper� TestKeyMapper.test_prefix_mapper�sv���+�+�-������F�J�J�/K�$L�M�����6�:�:�.I�#J�K��������Y�(?�@�����v�|�|�H�'=�>r4c�6�[R"5nURSURS55 URSURS55 URSUR	S55 URSUR	S55 g)Nz
9b/file-idr�z	45/new-idr�r�r�)r�HashPrefixMapperror�r�r�s  r?�test_hash_prefix_mapper�%TestKeyMapper.test_hash_prefix_mapper�sv���/�/�1������v�z�z�2N�'O�P�����f�j�j�1L�&M�N��������\�(B�C�����v�|�|�K�'@�Ar4c�x�[R"5nURSURS55 URSURS55 URSURS55 URSUR	S55 URSUR	S55 g)	Nz88/%2520)� r�zed/fil%2545-%2549d)�filE-Idr�z88/ne%2557-%2549d)�neW-Idr�)r�)r�)rr ror�r�r�s  r?�test_hash_escaped_mapper�&TestKeyMapper.test_hash_escaped_mapper�s����6�6�8������V�Z�Z�0F�%G�H����-�v�z�z�:V�/W�X����,�f�j�j�9T�.U�V��������5I�(J�K�����v�|�|�4G�'H�Ir4r)N)
rirjrkrlr�r�r�r�r�rmr)r4r?r�r��s��.�>�
?�B�Jr4r�c��\rSrSrSrSS\"\\"S55SSSS	.4S
S\"S\"S55SSSS	.4S\	\
"SSS5SSSS	.4S
\	\
"SSS5SSSS	.4S\	\
"SSS5SSSS	.4S\R\R"SSS5SSSS	.4/r
SS\"\\"55SSSS	.4SS\"S\"55SSSS	.4S\	\
"SSS5SSSS	.4S\R\R"SSS5SSSS	.4/r\
\-rSVSjrSrSrSrSrSrSrSrSrSrSrSWS jrS!rS"rS#r S$r!S%r"S&r#S'r$S(r%S)r&S*r'SXS+jr(S,r)S-r*S.r+S/r,S0r-S1r.S2r/S3r0S4r1S5r2S6r3S7r4S8r5S9r6S:r7S;r8S<r9S=r:S>r;S?r<S@r=SAr>SBr?SCr@SDrASErBSFrCSGrDSHrESIrFSJrGSKrHSLrISMrJSNrKSOrLSPrMSQrNSRrOSSrPSTrQSUrRg)Y�TestVersionedFilesi�z5Tests for the multiple-file variant of VersionedFile.zweave-namedNr�TrBF)�cleanupr�rrV�support_partial_insertionz
named-knit�	revisionsznamed-nograph-nodelta-knit-packznamed-graph-knit-packznamed-graph-nodelta-knit-packzgroupcompress-nographzweave-prefixrzannotated-knit-escapezplain-knit-packrc���URU5nUS:waUR"S5 URU5nURbUR	URU5 U$)Nr�)r��mkdirr�r��
addCleanup)r`�relpathr	rUs    r?�get_versionedfiles�%TestVersionedFiles.get_versionedfilesWsT���&�&�w�/�	��c�>��O�O�C� ����Y�'���<�<�#��O�O�D�L�L�%�0��r4c�4�URS:XaU4$SU4-$)z'Return a key for the object under test.rBrC�rV)r`rIs  r?�get_simple_key�!TestVersionedFiles.get_simple_key`s#���?�?�a���9���&��*�*r4c���URS5n[USS5c.[SRURR
55eURS5nUR
S5nURU/S/5 URU5 URX1RU/5;5 URX1R5RU/5;5 g)NrU�add_fallback_versioned_files�{} doesn't support fallbacks�fallbackr�r3)
r��getattrr�formatr�rir�r9r�rnr�r�without_fallbacks)r`r:�g�key_as    r?�+test_add_fallback_implies_without_fallbacks�>TestVersionedFiles.test_add_fallback_implies_without_fallbacksgs����#�#�G�,���1�4�d�;�C�#�.�5�5�a�k�k�6J�6J�K��
�
�#�#�J�/���#�#�D�)��	���E�2��w�'�	�&�&�q�)�����!1�!1�5�'�!:�:�;�����"5�"5�"7�"F�"F��w�"O�O�Pr4c��UR5nURS5nURS5nURS5 URS5 URU/SS/5 UR(aURX2/SS/5 OURU/SS/5 UR	5nURX$;5 URX4;5 /nUR
X#/SS	5H/nURURURS
545 M1 UR5 URUS4US4/U5 g)
Nrdrgrkrlrerfrhr�Tr�rj�b
c
)r�r�r9rr�rnr�rT�keyr��sortro)r`r:�key0�key1r��records�records       r?r��!TestVersionedFiles.test_add_linests"���#�#�%���"�"�5�)���"�"�5�)�����E�"����F�#�	���D�"�v�v�.�/��:�:�
�K�K��f�v�v�&6�7�
�K�K��b�6�6�"2�3��v�v�x�������%������%����)�)�4�,��T�J�F��N�N�F�J�J��(;�(;�J�(G�H�I�K��������4��+�d�I�->�?��Ir4c�l^�UR5mURS5nURS5nURS5 URS5 U4SjnU"U/SS/5 UR(a
U"X!//SQ5 OU"U/S	S
/5 TR5nUR	X5 UR	X$5 /nTRX/SS5H/nUR
URURS
545 M1 UR5 URUS4US4/U5 g)Nrdrgrkrlc�h>�[X[R"U5U5nTRU5$rP)rrr��add_content)r�r=�chunksr�r:s    �r?�
add_chunks�6TestVersionedFiles.test_add_chunks.<locals>.add_chunks�s0���+��g�1�1�&�9�6��G��=�=��)�)r4r�s
b
)r�r3rhrfrhr�Tr�rjr�)r�r�rr��assertInr�rTr�r�r�ro)r`r�r�rr�r�r�r:s       @r?�test_add_chunks�"TestVersionedFiles.test_add_chunks�s����#�#�%���"�"�5�)���"�"�5�)�����E�"����F�#�	*�	�4��d�H�-�.��:�:��t�V�%:�;��t�R�&�&�!1�2��v�v�x���
�
�d�!��
�
�d�!����)�)�4�,��T�J�F��N�N�F�J�J��(;�(;�J�(G�H�I�K��������4��+�d�I�->�?��Ir4c�\�UR5nURU5 URS:XaSnOSnURUS-5nUR	US-S4/U5 URUS-5nUR	US-S4/U5 URUS-5nUR
(a+UR	US-S4US	-S
4US-S4US-S
4/U5 O*UR	US-S4US-S
4US-S4US-S
4/U5 UR
[URUS-5 g)NrBr)rCr*r�r,r5r�r.r6r0r7smerged
)zmissing-key)r�rXrVr�rorrtr)r`rUrLr�s    r?rA� TestVersionedFiles.test_annotate�sg���'�'�)�����u�%��?�?�a���F� �F��.�.��,�!6�7�����6�L�0�+�>�?��I��.�.��*�!4�5�����6�J�.�	�:�;�W�E��.�.��,�!6�7���:�:�����j�(�)�4��j�(�)�4��k�)�:�6��l�*�K�8�	��
�
����l�*�I�6��l�*�I�6��l�*�J�7��l�*�K�8�	��
�	
���,�e�n�n�f�GW�>W�Xr4c�$�UR5 grP�r�r_s r?�test_check_no_parameters�+TestVersionedFiles.test_check_no_parameters�s�����!r4c��[RR5nURUR5 UR5nUR
US9 g)z@A progress bar can be supplied because check can be a generator.)�progress_barN)r
�
ui_factory�nested_progress_barr��finishedr�r�)r`r{rUs   r?� test_check_progressbar_parameter�3TestVersionedFiles.test_check_progressbar_parameter�s@��
�]�]�
.�
.�
0��������$��'�'�)��
�����$r4c�$�UR5nURU5 UR5nURUS9n[	5nURXURURU5SS9 UR[	U5U5 g)N)r�T)�require_fulltext)	r�rXr�r�r"�capture_stream�addr�ro)r`rUr�r��seens     r?�&test_check_with_keys_becomes_generator�9TestVersionedFiles.test_check_with_keys_becomes_generator�s����'�'�)�����u�%��z�z�|���+�+�4�+�(���u������D�H�H�e�&:�&:�4�&@�SW�	�	
�	
����T��D�)r4c�D�UR5nUR5 grP)r��clear_cache�r`rUs  r?�test_clear_cache�#TestVersionedFiles.test_clear_cache�s���'�'�)��
���r4c�$�UR5 g)z:Each parameterised test can be constructed on a transport.Nrr_s r?�test_construct�!TestVersionedFiles.test_construct�s�����!r4c	�P�[UURUUR(+UUS9$)N)r;rKr<rQ)rXrVr)r`rUr;r<rQs     r?rX�$TestVersionedFiles.get_diamond_files�s-��!���O�O�%��
�
�N���

�	
r4c
�|�UR5nS/4nSSS/4nSSS/4n/nX4U4HjupxU(a'URURU5/U5un	 n
O&URURU5/U5un	 n
URU	5 Ml [	XcXE45H�un	upxURUS-5nUR[URU/X�S9 UR[URU/X�S9 [URU/S	S
55nURSUR5 M� g)
r�r�r�r�r�r�r�r�r�r�Tr�N)r�r9r�rTr�rtrr�r�ror�)
r`r9r�r�r�r�r�r�r�r�r��new_keyr�s
             r?�_add_content_nostoresha�*TestVersionedFiles._add_content_nostoresha�sU��
�
$�
$�
&���B�Z�
���8� 4�5��!�H�f�#5�6����)�;L�M�N�G���L�L��)<�)<�W�)E�r�5�Q�	��Q���L�L��)<�)<�W�)E�r�5�Q�	��Q���K�K���N�&)��~�A�&
�!�C�!�'��)�)�'�D�.�9�G��������w��E�
�
�
�������w��E�
�
��"�.�.��y�+�t�L�M�F����X�v�':�':�;�&
r4c�"�URSS9 g)NTr8)r(r_s r?r��,TestVersionedFiles.test_add_lines_nostoreshas���$�$�t�$�4r4c�N�UR5nURU5n/nUH2nURS[U55 UR	USS5 M4 UR
S:XaUR/SQU5 gUR
S:XaUR/SQU5 gg)NrrrB���(00e364d235126be43292ab09cb4686cf703ddc17r��(51c64a6f4fc375daf0d24aafbabe4d91b6f4bb44r��(a8478686da38e370e32e42e8a0c220e33ee9132fr��(9ef09dfa9d86780bdec9219a22560c6ece8e0ef1r��(ed8bce375198ea62444dc71952b22cfc2b09226dr�
r.r.r0r0r2r2r4r4r6r6)r�rXrorrrTrV�r`rU�adds�resultsrs     r?�test_add_lines_return�(TestVersionedFiles.test_add_lines_returns����'�'�)���%�%�e�,�����C����Q��C��)��N�N�3�r��7�#���?�?�a�������	
��_�_��
!������
�"r4c���UR5nURUSS9n/nUH2nURS[U55 UR	USS5 M4 UR
S:Xa7UR/SQU5 UR1SkUR
55 gUR
S:Xa7UR/SQU5 UR1S	kUR
55 gg)
NT)rQrrrBr->��-sha1:00e364d235126be43292ab09cb4686cf703ddc17��-sha1:51c64a6f4fc375daf0d24aafbabe4d91b6f4bb44��-sha1:9ef09dfa9d86780bdec9219a22560c6ece8e0ef1��-sha1:a8478686da38e370e32e42e8a0c220e33ee9132f��-sha1:ed8bce375198ea62444dc71952b22cfc2b09226dr8>
�rDr@�rDrB�rDrD�rDrF�rDrH�rFr@�rFrB�rFrD�rFrF�rFrH)r�rXrorrrTrVr�r9s     r?�'test_add_lines_no_key_generates_chk_key�:TestVersionedFiles.test_add_lines_no_key_generates_chk_key8s����'�'�)���%�%�e�D�%�9�����C����Q��C��)��N�N�3�r��7�#���?�?�a�������	
�
�����
�
��	
��_�_��
!������
� 
�����
�
��
�#"r4c
���UR5nURS5nURU//5 URS[	URU/SS55R
S55 URS5nURX0RU/5/5 URS[	URU/SS55R
S55 g)zEmpty files can be stored.r�r4r�Tr�r�N�r�r�r9ror�r�r�rM�r`r:r��key_bs    r?�test_empty_lines�#TestVersionedFiles.test_empty_linesxs����#�#�%���#�#�D�)��	���E�2�r�"�������$�$�e�W�k�4�@�A�N�N��
�	
��#�#�D�)��	���E�+�+�U�G�4�b�9�������$�$�e�W�k�4�@�A�N�N��
�	
r4c
���UR5nURS5nURU/S/5 URS[	URU/SS55R
S55 URS5nURX0RU/5S/5 URS[	URU/SS55R
S55 g)Nr�r3r�Tr�r�rVrWs    r?�test_newline_only�$TestVersionedFiles.test_newline_only�s����#�#�%���#�#�D�)��	���E�2��w�'�������$�$�e�W�k�4�@�A�N�N��
�	
��#�#�D�)��	���E�+�+�U�G�4�u�g�>�������$�$�e�W�k�4�@�A�N�N��
�	
r4c��UR5nUR(d[S5eURS5nURS5nURS5nUR	U/S/5 UR	X2/S/5 UR	XBU/S/5 URU/5nUR
U[R5 URX#U/[UR555 g)N�'ancestry info only relevant with graph.r�r�r�r3)r�rrr�r9�get_known_graph_ancestryr�
_mod_graph�
KnownGraphror7�	topo_sort)r`r:r�rX�key_c�kgs      r?�test_get_known_graph_ancestry�0TestVersionedFiles.test_get_known_graph_ancestry�s����#�#�%���z�z�#�$M�N�N��#�#�D�)���#�#�D�)���#�#�D�)��	
���E�2��w�'�	���E�7�U�G�,�	���E�5�>�E�7�3�
�
'�
'���
0�����b�*�"7�"7�8����%��.��R�\�\�^�0D�Er4c�t�URS5nUR(d[S5e[USS5c.[SR	UR
R55eURS5nURS5nURS5nURS5nURU/S	/5 URU5 URX2/S	/5 URXBU/S	/5 URU/5nURX#U/[UR555 g)
NrUr_r�r�r�r�r�r�r3)r�rrr�r�r�rir�r9r�r`ror7rc)r`r:r�rXrdr�res       r?�test_known_graph_with_fallbacks�2TestVersionedFiles.test_known_graph_with_fallbacks�s���#�#�G�,���z�z�#�$M�N�N��1�4�d�;�C�#�.�5�5�a�k�k�6J�6J�K��
��#�#�D�)���#�#�D�)���#�#�D�)��
�#�#�J�/��	���E�2��w�'�	�&�&�q�)�	���E�7�U�G�,�	���E�5�>�E�7�3�
�
'�
'���
0�����%��.��R�\�\�^�0D�Er4c��UR5nUR/SS5nUR/[U55 g)z/An empty stream can be requested without error.r�FN)r�r�ror7)r`r:r�s   r?�test_get_record_stream_empty�/TestVersionedFiles.test_get_record_stream_empty�s8���#�#�%���%�%�b�+�u�=������T�'�]�+r4c�.�URU//SQ5 g)z1Assert that storage_kind is a valid storage_kind.)r�zknit-annotated-ftzknit-annotated-deltazknit-ftz
knit-deltar�r�rurtrsrrzknit-delta-closurezknit-delta-closure-refzgroupcompress-blockzgroupcompress-block-refN)�assertSubset)r`r�s  r?�assertValidStorageKind�)TestVersionedFiles.assertValidStorageKind�s�����
�N�
�	
r4c���UH�nU"UR5 URUR5 URbCUR	URUR/5URUR5 UR	XFRUR5 URURUR5[5 U(dM�URS5 M� g)zCapture a stream for testing.Nr�)
r�rpr��sha1ror�r=rr��bytes)r`r:r��on_seenr=rr�s       r?r�!TestVersionedFiles.capture_stream�s����G��G�K�K� ��'�'��(<�(<�=��|�|�'�� � ����g�k�k�]�!;�G�K�K�!H�'�,�,�W����W�[�[�1�7�?�?�C��!�!�'�"6�"6�w�7K�7K�"L�e�T����$�$�Z�0�r4c�6�UR5nURU5 UR5up#URU5nUR	USS5n[5nUR
XURU5 UR[U5U5 g)�9Each item in a stream has to provide a regular interface.r�FN)	r�rX�get_keys_and_sort_orderr�r�r"rrro)r`rUr�r��
parent_mapr�rs       r?� test_get_record_stream_interface�3TestVersionedFiles.test_get_record_stream_interface�s����'�'�)�����u�%��.�.�0����)�)�$�/�
��)�)�$��U�C���u�����E�D�H�H�j�A�����T��D�)r4c	�b�URS:Xa/SQnSSSSS.nX4$/SQnSSSSSSSSS.nX4$)z4Get diamond test keys list, and their sort ordering.rB�r�r.r0r,rr��rDr2�rDr/�rDr1�rDr-�rFr2�rFr/�rFr1�rFr-r��r`r��
sort_orders   r?ry�*TestVersionedFiles.get_keys_and_sort_order��`���?�?�a��F�D�()�q�q�VW�X�J�,���)	�D�()�%&�&'�%&�'(�%&�&'�%&�	�J���r4c	�b�URS:Xa/SQnSSSSS.nX4$/SQnSSSSSSSSS.nX4$)	zBGet diamond test keys list, and their groupcompress sort ordering.rBr~rrrrr�rr�r�s   r?�%get_keys_and_groupcompress_sort_order�8TestVersionedFiles.get_keys_and_groupcompress_sort_orderr�r4c��UR5nURU5 UR5up#URU5nUR	USS5n/nURXURU5 URX6U5 g)rx�topologicalFN)r�rXryr�r�rrT�assertStreamOrder�r`rUr�r�rzr�rs       r?�(test_get_record_stream_interface_ordered�;TestVersionedFiles.test_get_record_stream_interface_ordered6s~���'�'�)�����u�%��7�7�9����)�)�$�/�
��)�)�$�
�u�E�������E�D�K�K��D����z��6r4c�N�UR5nURU5 UR5up#URU5nUR	USS5n/nUGH3nURUR5 URUR5 URUR/SURUR/5UR/5 URXGRUR5 URS5nURU[ 5 URS5n	UR#USR%U	55 UR'S5n	UR#USR%U	55 GM6 UR)X6U5 g)z+Each item must be accessible as a fulltext.r�TNr�r�r4)r�rXryr�r�rTr�rpr�rorsr�ror=r�rrtr�r�r�r�)
r`rUr�r�rzr�rr��ft_bytes�
chunked_bytess
          r?�;test_get_record_stream_interface_ordered_with_delta_closure�NTestVersionedFiles.test_get_record_stream_interface_ordered_with_delta_closureAs]���'�'�)�����u�%��7�7�9����)�)�$�/�
��)�)�$�
�t�D�����G��K�K����$��'�'��(<�(<�=���������u������}�'E�g�k�k�'R� S�
�
���Z���4�g�o�o�F��+�+�J�7�H��!�!�(�E�2�#�0�0��;�M�� � ��3�8�8�M�+B�C�#�1�1�)�<�M�� � ��3�8�8�M�+B�C��	
���z��6r4c��UR5nURU5 UR5up#URU5nUR	USS5n/nURXURU5 URX6U5 g)rxrFN)r�rXr�r�r�rrTr�r�s       r?�.test_get_record_stream_interface_groupcompress�ATestVersionedFiles.test_get_record_stream_interface_groupcompressZs~���'�'�)�����u�%��E�E�G����)�)�$�/�
��)�)�$���G�������E�D�K�K��D����z��6r4c�x�UR[[U55[U55 URS:XaSS0nOSSS.nUR(d%UR[U5[U55 gUH7nXnURXdUSS:�SR
XR55 XdUSS'M9 g)NrBr)r)rCrErz)Out of order in sorted stream: {!r}, {!r})rorrr"rVrrnr�)r`r�rr��lowsr��sort_poss       r?r��$TestVersionedFiles.assertStreamOrderes�������S��Y���T��3��?�?�a����7�D�!"��3�D��z�z����S��Y��D�	�2���%�?������S��"�X��.�?�F�F�s�Q��"*�S��"�X��
r4c��UR5nURU5 URS:Xa/SQnO/SQnURU5nUR	USS5n[5nUGHnUR
UR5 URUR5 URbCURURUR/5URUR5 URX6RUR5 UR[UR S5 UR#UR!UR5[$5 GM UR[U5U5 g)z?Asking for a storage kind that the stream cannot supply raises.rBr~rr�FNr�)r�rXrVr�r�r"rr�rpr�rsror�r=rtr"r�rrt)r`rUr�rzr�rr�s       r?�2test_get_record_stream_unknown_storage_kind_raises�ETestVersionedFiles.test_get_record_stream_unknown_storage_kind_raisesvs9���'�'�)�����u�%��?�?�a��F�D�	�D��)�)�$�/�
��)�)�$��U�C���u���G��H�H�W�[�[�!��'�'��(<�(<�=��|�|�'�� � ��O�O�W�[�[�M�2�7�;�;�?�����
���Z���4�g�o�o�F����7��9M�9M�x�X��!�!�'�"6�"6�w�7K�7K�"L�e�T��	
����T��D�)r4c�.�UR5nURU5 URS:Xa/SQnO/SQnURU5nUR	USS5nURXX45 UR	USS5nURXX45 g)NrB)r�r.r0)�absentr,)r�r�r�)rDr�r�r�r�r�)rFr�r�)r�r�r�Fr�)r�rXrVr�r��assertAbsentRecord)r`rUr�rzr�s     r?�1test_get_record_stream_missing_records_are_absent�DTestVersionedFiles.test_get_record_stream_missing_records_are_absent�s����'�'�)�����u�%��?�?�a��T�D��D��)�)�$�/�
��)�)�$��U�C������Z�A��)�)�$�
�u�E������Z�Ar4c��URX!RS55 URUSRURS555 g)z'Assert that record has the bytes bytes.r�r4r�N)ror�r�)r`r�rts   r?�assertRecordHasContent�)TestVersionedFiles.assertRecordHasContent�s?������ 3� 3�J� ?�@���������)<�)<�Y�)G� H�Ir4c��UR5nURS5nURUSSS/5 URU/SS5n[	U5nUR
S;aUR
US5 gURUR
5/n[R"U5R5nUn/nUH�nURU5 URUR
UR
5 URURUR5 URURUR
5URUR
55 M� URS	[U55 g)
Nrlr)�my text
�contentr�F�r�r��my text
contentrB)r�r�r9r�r�r�r�r�r�NetworkRecordStreamr�rTror=rr)	r`rUr��streamr�rt�network_stream�
source_recordr�s	         r?�;test_get_record_stream_native_formats_are_wire_ready_one_ft�NTestVersionedFiles.test_get_record_stream_native_formats_are_wire_ready_one_ft�sJ���'�'�)���!�!�&�)��
����R�,�
�!;�<��(�(�#���U�C���f������"9�9�
�'�'��0C�D��(�(��)<�)<�=�>�E�*�>�>�u�E�J�J�L�N�"�M��G�(�����v�&�� � ��!;�!;�V�=P�=P�Q�� � ��!6�!6����G�� � �!�.�.�}�/I�/I�J��'�'��(;�(;�<��	)�
���Q��G��-r4c#�B# �[X25H�upEURU5 URURUR5 URURUR5 URUR
UR
5 Uv� M� g7f)z�Assert that streams expected and stream have the same records.

:param records: A list to collect the seen records.
:return: A generator of the records in stream.
N)r�rTror�r�r=)r`r�r~r�r��
ref_records      r?�assertStreamMetaEqual�(TestVersionedFiles.assertStreamMetaEqual�sx���#&�f�"7��F��N�N�6�"����Z�^�^�V�Z�Z�8����Z�4�4�f�6I�6I�J����Z�/�/����@��L�#8�s�BBc#��# �UH]nURS;a-US==S-
ss'URXBUR5 M@URUR5v� M_ g7f)aHConvert a stream to a bytes iterator.

:param skipped_records: A list with one element to increment when a
    record is skipped.
:param full_texts: A dict from key->fulltext representation, for
    checking chunked or fulltext stored records.
:param stream: A record_stream.
:return: An iterator over the bytes of each record.
r�rrBN)r�r�r�r�)r`�skipped_records�
full_textsr�r�s     r?�stream_to_bytes_or_skip_counter�2TestVersionedFiles.stream_to_bytes_or_skip_counter�s^����F��"�"�&=�=���"�a�'�"��+�+�F�v�z�z�4J�K��)�)�&�*=�*=�>�>�
�s�A%A'c��UR5nURS5nURS5nURS5nURUSSS/5 UR(aU4nOSnURXESS/5 UR	X4/S	S
5nUR	X4/S	S
5nS/nUSUS
0n	URX�U5n
[R"U
5R5n/nURURX�U55 URS[U5US-5 [U5(aURX5 gg)N�target�ft�deltar)r�r��
different
�content
r�Frr��different
content
r)r�r�r9rr�r�rr�r��insert_record_streamr�rorr�assertIdenticalVersionedFile�
r`rU�target_filesr��	key_delta�
delta_parents�local�refr�r��byte_streamr�r�s
             r?�=test_get_record_stream_native_formats_are_wire_ready_ft_delta�PTestVersionedFiles.test_get_record_stream_native_formats_are_wire_ready_ft_delta�sV���'�'�)���.�.�x�8���!�!�%�(���'�'��1�	�
����R�,�
�!;�<��:�:� �F�M��M�
���	�>�<�2P�Q��'�'��(8�+�u�M���%�%�s�&6��U�K���#���$��.�
�
��:�:���
��'�:�:�;�G�L�L�N����	�)�)��&�&�w�^�D�	
�	
����C��L�?�1�+=�=�>��w�<�<��-�-�e�B�r4c���UR5nURS5nURS5nURS5nURUSSS/5 UR(aU4nOSnURXESS/5 UR	URU/S	S
55 URU/S	S
5nURU/S	S
5nS/nUS0n	UR
X�U5n
[R"U
5R5n/nUR	URX�U55 URS
[U5US-5 [U5(aURX5 gg)Nr�r�r�r)r�r�r�r�r�Frr�rB)r�r�r9rr�r�r�rr�r�r�rorrr�r�s
             r?�:test_get_record_stream_native_formats_are_wire_ready_delta�MTestVersionedFiles.test_get_record_stream_native_formats_are_wire_ready_delta	st���'�'�)���.�.�x�8���!�!�%�(���'�'��1�	�
����R�,�
�!;�<��:�:� �F�M��M�
���	�>�<�2P�Q�	�)�)��#�#�S�E�;��>�	
��'�'���[�%�H���%�%�y�k�;��F���#���.�
�
��:�:���
��'�:�:�;�G�L�L�N����	�)�)��&�&�w�^�D�	
�	
����C��L�?�1�+=�=�>��w�<�<��-�-�e�B�r4c�f�UR5nURS5nURS5nURUSSS/5 UR(aU4nOSnURX4SS/5 UR	U/SS	5nUR	U/SS	5nS
/nUS0nURXxU5n	[R"U	5R5n
/nURX�U
5H!nURX�UR5 M# URS[U5US
-5 g)
Nr�r�r)r�r�r�r�r�Trr�rB)r�r�r9rr�r�rr�r�r�r�r�rorr)
r`rUr�r�r�r�r�r�r�r�r�r�r�s
             r?�8test_get_record_stream_wire_ready_delta_closure_included�KTestVersionedFiles.test_get_record_stream_wire_ready_delta_closure_included=	s3���'�'�)���!�!�%�(���'�'��1�	�
����R�,�
�!;�<��:�:� �F�M��M�
���	�>�<�2P�Q��'�'���[�$�G���%�%�y�k�;��E���#���.�
�
��:�:���
��'�:�:�;�G�L�L�N�����0�0��~�N�F��'�'��6�:�:�0F�G�O�	
����C��L�?�1�+=�=�>r4c���[5nUGHKnURUR5 URSS:XaVURSUR5 URSUR
5 URSUR5 M�URUR5 UR
bDURUR/5URnURXvR
5 URX6RUR5 URURUR5[5 GMN UR[U5U5 g)z=Helper for test_get_record_stream_missing_records_are_absent.rr�r�N)r"rr�ror�rsr=rpr�rr�rt)r`rUr�r=r�rr�rss        r?r��%TestVersionedFiles.assertAbsentRecord\	s���u���G��H�H�W�[�[�!��{�{�2��)�+�� � ��7�+?�+?�@�� � ��w�|�|�4�� � ��w���7��+�+�G�,@�,@�A��<�<�+� �?�?�G�K�K�=�9�'�+�+�F�D��$�$�T�<�<�8�� � ����!5�w���G��%�%�g�&:�&:�7�;O�;O�&P�RW�X��	
����T��D�)r4c���UR5nURU5 UR5up#URU5n[	U5nUR
S:XaUR
SS5 OUR
SS5 URUSS5n[5nURU[R"U5URU5 UR[U5U5 g)z2Requested missing records can be filter trivially.rBr)�extra)r�r�r�FN)r�rXryr�r7rV�insertr�r"rr�
filter_absentrro)r`rUr�r�rz�present_keysr�rs        r?�test_filter_absent_records�-TestVersionedFiles.test_filter_absent_recordsn	s����'�'�)�����u�%��.�.�0����)�)�$�/�
��D�z���?�?�a���K�K��;�'��K�K��/�0��)�)�$��U�C���u������=�.�.�w�7����:�	
�	
����\�*�D�1r4c�L�URS:Xa[S5$[5$)z?Get a mapper suitable for the key length of the test interface.rBr�)rVrr r_s r?�
get_mapper�TestVersionedFiles.get_mapper�	s"���?�?�a��!�(�+�+�*�,�,r4c�*�UR(aU$g)z2Get parents, taking self.graph into consideration.Nr)r`r=s  r?rM�TestVersionedFiles.get_parents�	s���:�:��N�r4c�4�UR5nURU5 URS5nURS5nURS5nURS5nURS5nUR5R	U5upxURU4/U5 URS/U5 UR5R	U5upxURU4/U5 UR5R	U5upxUR(aURU4U4U4U4/U5 OURU4U4U4U4/U5 UR[UR5RURS55 g)Nr+r-r/r1r2r�smissing-key)	r�rXr��
get_annotatorr�rorrtr)	r`rU�
origin_key�base_key�left_key�	right_key�
merged_keyr�r�s	         r?�test_get_annotator�%TestVersionedFiles.test_get_annotator�	s����'�'�)�����u�%��(�(��3�
��&�&�w�/���&�&�w�/���'�'��1�	��(�(��3�
��,�,�.�7�7�
�C������:�-��'�2����+���.��,�,�.�7�7��A������8�+���0��,�,�.�7�7�
�C����:�:�����K��K��L��M�	��
�
����M��M��M��M�	��
�	
�������!�*�*�����/�	
r4c���UR5nURS:Xa]SURS54SURS54SURS54SURS54SURS	54/nO\S
URS54SURS54S
URS54SURS54SURS54/nUH:up4URX4/5 UR	X40URU/55 M< UR	0UR/55 [
U5nUR	XQRUR555 [UR55nURS:XaURSS5 OURSS5 UR	XQRU55 g)NrBr;r)�rg)r;�rk�r!)r<)r;r�r�r��rDrd�rDrg)r��rDrk�rDr!)rDr<)r�r�r�r���missing)r�r�)
r�rVrMr9ror��dictr�r7r�)r`rU�parent_detailsr�r=�all_parentsr�s       r?r>�&TestVersionedFiles.test_get_parent_map�	s����'�'�)���?�?�a���4�+�+�B�/�0��4�+�+�K�8�9��4�+�+�B�/�0��4�+�+�B�/�0��$�*�*�+S�T�U��N�#�D�$4�$4�R�$8�9�"�D�$4�$4�5I�$J�K�"�D�$4�$4�R�$8�9�"�D�$4�$4�R�$8�9�$��$�$���
��N�"+�L�C��O�O�C�"�-����c�^�U�-A�-A�3�%�-H�I�+�
	
����U�1�1�"�5�6��>�*������&:�&:�;�;K�;K�;M�&N�O��K�$�$�&�'���?�?�a���K�K��=�)��K�K��3�4�����&:�&:�4�&@�Ar4c���UR5nURU5 URS:Xa/SQnO/SQnURUSSUSSUSSUS	S
USS0UR	U55 g)
NrB)r,r*r.r�r0)r��rFr+r�r�r�rr1r/rr3rr7r�r5)r�rXrVror�)r`rUr�s   r?r��!TestVersionedFiles.test_get_sha1s�	s����'�'�)�����u�%��?�?�a��T�D��D�	
����Q��D��Q��D��Q��D��Q��D��Q��D�
�
�O�O�D�!�		
r4c�F�UR5nUR/5 g)z-Inserting an empty record stream should work.N)r�r�rs  r?�test_insert_record_stream_empty�2TestVersionedFiles.test_insert_record_stream_empty
s���'�'�)��
�"�"�2�&r4c��UR[UR55[UR555 URUR55nUR(a/URX1RUR555 O+UR5HupEURSU5 M UR5Hln[
URU/SS55RS5n[
URU/SS55RS5nURXx5 Mn g)z2Assert that left and right have the same contents.Nr�Tr�)	ror"r�r�r�itemsr�r�r�)	r`r~�actual�actual_parents�_keyr=r��actual_text�
expected_texts	         r?r��/TestVersionedFiles.assertIdenticalVersionedFile

s������V�[�[�]�+�S�����-A�B��.�.�v�{�{�}�=���:�:����^�-D�-D�X�]�]�_�-U�V�!/�!5�!5�!7�
��� � ��w�/�"8��;�;�=�C���(�(�#���T�B���l�:�&�
�!��*�*�C�5�+�t�D���l�:�&�
�
���[�8�!r4c�Z�UR5nUR5nURS5nURS5 [	[
U5"U5nUR
USS9 URUR5SS5nURU5 URXA5 g�z-Any file should accept a stream of fulltexts.r�r�Fr�r�N�r�r�r�r�r$r%rXr�r�r�r��r`rUr��source_transportr�r�s      r?�#test_insert_record_stream_fulltexts�6TestVersionedFiles.test_insert_record_stream_fulltexts
����'�'�)�����"���-�-�h�7�����s�#�-�i��@�AQ�R�����v�E��:��)�)�&�+�+�-���N��
�"�"�6�*��)�)�&�8r4c�Z�UR5nUR5nURS5nURS5 [	[
U5"U5nUR
USS9 URUR5SS5nURU5 URXA5 grr
rs      r?�)test_insert_record_stream_fulltexts_noeol�<TestVersionedFiles.test_insert_record_stream_fulltexts_noeol)
rr4c�T�UR5nUR5nURS5nURS5 [	SU5"U5nURU5 UR
UR5SS5nURU5 URXA5 g)�1Any file should accept a stream from plain knits.r�r�Tr�FN�
r�r�r�r�rrXr�r�r�r�rs      r?�)test_insert_record_stream_annotated_knits�<TestVersionedFiles.test_insert_record_stream_annotated_knits6
s����'�'�)�����"���-�-�h�7�����s�#�"�4��0�1A�B�����v�&��)�)�&�+�+�-���N��
�"�"�6�*��)�)�&�8r4c�R�UR5nUR5nURS5nURS5 [	SU5"U5nURUSS9 UR
UR5SS5nURU5 URXA5 g)rr�r�TFr�r�Nrrs      r?�/test_insert_record_stream_annotated_knits_noeol�BTestVersionedFiles.test_insert_record_stream_annotated_knits_noeolB
s����'�'�)�����"���-�-�h�7�����s�#�"�4��0�1A�B�����v�E��:��)�)�&�+�+�-���N��
�"�"�6�*��)�)�&�8r4c�T�UR5nUR5nURS5nURS5 [	SU5"U5nURU5 UR
UR5SS5nURU5 URXA5 g)rr�r�Fr�Nrrs      r?�%test_insert_record_stream_plain_knits�8TestVersionedFiles.test_insert_record_stream_plain_knitsN
s����'�'�)�����"���-�-�h�7�����s�#�"�5�&�1�2B�C�����v�&��)�)�&�+�+�-���N��
�"�"�6�*��)�)�&�8r4c�R�UR5nUR5nURS5nURS5 [	SU5"U5nURUSS9 UR
UR5SS5nURU5 URXA5 g)rr�r�Fr�r�Nrrs      r?�+test_insert_record_stream_plain_knits_noeol�>TestVersionedFiles.test_insert_record_stream_plain_knits_noeolZ
s����'�'�)�����"���-�-�h�7�����s�#�"�5�&�1�2B�C�����v�E��:��)�)�&�+�+�-���N��
�"�"�6�*��)�)�&�8r4c��UR5nURS5nURU5 URUSS9 URUR5SS5nUR	U5 URX!5 g)z2Inserting keys already in a file should not error.r�T)r<r�FN)r�rXr�r�r�r��r`rUr�r�s    r?�'test_insert_record_stream_existing_keys�:TestVersionedFiles.test_insert_record_stream_existing_keysf
sw���'�'�)���(�(��2�����v�&����u���5��)�)�&�+�+�-���N��
�"�"�6�*��)�)�&�8r4c���UR5nURS5nURSUR-/SS5nUR[R
URU5 g)z:Inserting a stream with absent keys should raise an error.r�r�r�FN)r�r�rVrtrrr�r%s    r?�&test_insert_record_stream_missing_keys�9TestVersionedFiles.test_insert_record_stream_missing_keysq
sd���'�'�)���(�(��2���)�)�
�T�_�_�
,�-�}�e�
��	
���&�3�3�U�5O�5O�QW�Xr4c���UR5nURS5nURU5 URS:XaS/nSS/nSS/nOSS	/n/S
Qn/SQnURUSS
5nURUSS
5nURUSS
5n[R
"XgU5n	UR
U	5 URX!5 g![a UR5 gf=f)�0An out of order stream can either error or work.r�rBr*r�r.r0r,)rDr+r�)r�r�r�r�)r�r�r�r�r�Fr�N)
r�rXrVr��	itertools�chainr�r�rr�)
r`rUr��origin_keys�end_keys�
start_keys�origin_entries�end_entries�
start_entriesr�s
          r?�&test_insert_record_stream_out_of_order�9TestVersionedFiles.test_insert_record_stream_out_of_orderz
s����'�'�)���(�(��2�����v�&��?�?�a��'�.�K�$�j�1�H�%�z�2�J�0�2G�H�K��H�$�J�$ �1�1�+�{�E�R���.�.�x���N���0�0��]�E�R�
��/�/�.�}�M��	=��&�&�w�/�

�-�-�f�<��	"�	��K�K�M�	�s�,C�C,�+C,c�h�UR(d[S5eURS5nSn/n[S5Vs/sHnSU-PM
 nnSn[[	U55HbnXgUS-nSU-4n	UR
S	:XaS
U	-n	UR
SU-S-5 URX�U5 UR
U	5 U	4nMd /n
[U5H&n	U
R
URU	/S
S55 M( [RRU
SS5nUR5nURU5 [UR55n
U
R!US5 UR#[5U
5 gs snf![$a UR'5 gf=f)r,r_r�r)i�s
same same %d
sabcdefghijklmnopqrstuvwxyzrBskey-r)sprefixscontent for r3r�FNrr)rrr�r�rrrVrTr9r�r�r-r.�
from_iterabler�r"�#get_missing_compression_parent_keys�discardrorr�)r`r�r=r��n�content�lettersr��letterr��streams�deltasrU�missings              r?�8test_insert_record_stream_long_parent_chain_out_of_order�KTestVersionedFiles.test_insert_record_stream_long_parent_chain_out_of_order�
s����z�z�#�$M�N�N��(�(��2������49�#�J�?�J�q�%��)�J��?�/���s�7�|�$�A���Q��'�F��V�#�%�C����!�#�"�S�(���N�N�?�V�3�e�;�<����S�7�3��K�K����f�G�%����D�>�C��N�N�6�3�3�S�E�;��N�O�"����.�.�w�s��|�<���'�'�)��
	-��&�&�v�.��%�C�C�E�F�G��O�O�D��G�$����S�U�G�,��9@��("�	��K�K�M�	�s�F�6F�F1�0F1c��UR5nURS5nURS5 [SU5"U5n[	X0R
SSSS9 U$)zdGet a source that can produce a stream with knit delta records,
regardless of this test's scenario.
r�r�FT)r;rKr<)r�r�r�rrXrV)r`r�rr�s    r?�get_knit_delta_source�(TestVersionedFiles.get_knit_delta_source�
s^�����"���-�-�h�7�����s�#�"�5�&�1�2B�C����O�O�$��QV�	
��
r4c��UR5nURS5URS5/nURUSS5nUR5nUR(a�UR/[
UR555 URU5 UR5nURURS51[U55 UR[U5[URU555 gUR[RURU5 UR5 g)z�Insertion where a needed basis is not included notifies the caller
of the missing basis.  In the meantime a record missing its basis is
not added.
r+r2r�Fr/N)rEr�r�r�r�ror7r9r�r"r�rtrrr�)r`r�r�r�rU�
missing_basess      r?�;test_insert_record_stream_delta_missing_basis_no_corruption�NTestVersionedFiles.test_insert_record_stream_delta_missing_basis_no_corruption�
s
��
�+�+�-���#�#�I�.��0C�0C�I�0N�O���*�*�4��e�D���'�'�)���)�)����R��e�&O�&O�&Q�!R�S��&�&�w�/�!�E�E�G�M����d�1�1�'�:�;�S��=O�P����S��Y��E�,@�,@��,F�(G�H�����)�)�5�+E�+E�w�
�
�K�K�Mr4c�>�UR(d[S5eUR5nURUR	S5UR	S5/SS5nUR5nUR
U5 UR5nURUR	S51[U55 UR	S5nURU/[URU/5R555 URUSS5nUR
U5 UR/[UR555 URU/[URU/5R555 UR5 g)	a?Insertion where a needed basis is not included notifies the caller
of the missing basis.  That basis can be added in a second
insert_record_stream call that does not need to repeat records present
in the previous stream.  The record(s) that required that basis are
fully inserted once their basis is no longer missing.
z:versioned file scenario does not support partial insertionr+r2r�Fr/TN)r�rrEr�r�r�r�r9ror"r7r�r�r�)r`r�r�rUrHr��missing_entriess       r?�@test_insert_record_stream_delta_missing_basis_can_be_added_later�STestVersionedFiles.test_insert_record_stream_delta_missing_basis_can_be_added_later�
se���-�-�#�L��
��+�+�-���*�*�
�
 �
 ��
+�T�-@�-@��-K�L���
��
�'�'�)��
�"�"�7�+��A�A�C�
����$�-�-�g�6�7��]�9K�L��(�(��3�
����*��t�E�,@�,@�*��,N�,S�,S�,U�'V�W� �2�2�=�+�t�T��
�"�"�?�3�����T�%�"K�"K�"M�N�O����*��t�E�,@�,@�*��,N�,S�,S�,U�'V�W�
���
r4c	�`^^^�"SS[R5mTR5mTRTR	S5SS/5 TRTR	S5SS/5 TRTR	S5TRTR	S5/5S	/5 TRTR	S
5TRTR	S5/5SS/5 TRTR	S5TRTR	S5TR	S5/5/S
Q5 UUU4SjnU"TR	S
5TR	S5//SQ5nTR
USTR	S
54S:�5 TR
USTR	S54S:�5 U"TR5/SQ5nTR
USTR	S54S:�5 TR
USTR	S54S:�5 TR
US	TR	S54S:�5 TR
USTR	S
54S:�5 TR
USTR	S54S:�5 g)Nc�$�\rSrSrSrSSjrSrg)�YTestVersionedFiles.test_iter_lines_added_or_present_in_keys.<locals>.InstrumentedProgressi%c�P�[RRU5 /UlgrPrWr_s r?rY�bTestVersionedFiles.test_iter_lines_added_or_present_in_keys.<locals>.InstrumentedProgress.__init__&r\r4Nc�>�URRXU45 grPr^r_s    r?rc�`TestVersionedFiles.test_iter_lines_added_or_present_in_keys.<locals>.InstrumentedProgress.update*rer4rfrgrhr)r4r?rnrQ%ror4rnr-r)r5rprqrrrsrtrurvrwc��>�0nT"5nTRXS9H!nURUS5 X$==S-
ss'M# UR/:waTRXR5 U$rz)�#iter_lines_added_or_present_in_keysr}rZro)r�r~r�rrrnrUr`s     ���r?�iter_with_keys�STestVersionedFiles.test_iter_lines_added_or_present_in_keys.<locals>.iter_with_keysGsn����E�+�-�H��A�A�$�A�T��� � ��q�)���q� ��U����2�%�� � ��+;�+;�<��Lr4r�rrxr�)rrXr�r9r�rMrnr�)r`rXr�rnrUs`  @@r?�(test_iter_lines_added_or_present_in_keys�;TestVersionedFiles.test_iter_lines_added_or_present_in_keyss����	;�8�#8�#8�	;��'�'�)��
����+�+�G�4�b�9�+�F�
����+�+�L�9�2��?O�P�
�������-����d�1�1�'�:�;�<�
��	
�	�������)����d�1�1�,�?�@�A�
�
�#�	
�	������
�.�����$�$�\�2�D�4G�4G��4P�Q�
�
9�	
�
	��
�
 �
 ��
*�D�,?�,?�
�,N�O�
�
��	
����z�4�+>�+>�x�+H�I�J�Q�N�O�����?�D�$7�$7�
�$F�G�H�1�L�	
���J�J�L�
�

��	
����y�$�*=�*=�g�*F�G�H�1�L�M�����~�t�/B�/B�<�/P�Q�R�UV�V�W�����~�t�/B�/B�<�/P�Q�R�UV�V�W�����z�4�+>�+>�x�+H�I�J�Q�N�O�����?�D�$7�$7�
�$F�G�H�1�L�	
r4c��SSKJn URS5nURUR	S5/S/5 URUR	S5URUR	S5/5S/5 URUR	S5URUR	S5/5SS/5 URUR	S	5URUR	S5/5SS
/5 URUR	S5URUR	S5/5S/5 URUR	S
5URUR	S5/5S/5 URUR	S5/S/5 URUR	S5URUR	S5UR	S5/5S/5 URUR	S5URUR	S5/5S/5 UR	S5nSnS/n[
S5HDnUR	USU--5nUS/-nURXpRU/5U5 UnMF UR	S5nSnS/n[
S5HDnUR	USU--5nUS/-nURXpRU/5U5 UnMF URS5nURX"R55H�n	URU	/5Sn
URU	/5U	=(d /nURX�URU	/5U	U
4/5 UR[URU	/SS55R!S5[URU	/SS55R!S55 M� g)Nrr�r�r-r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr�r�Tr�)r�r�r�r9r�rMr��topo_iter_keysr�r�r�r�r�r�r�r�r�)r`r�rUrrrrrr�r�r�r=s            r?r��$TestVersionedFiles.test_make_mpdiffsws���&��'�'��1��	����+�+�G�4�b�9�+�F�
�������)����d�1�1�'�:�;�<�
�I�	
�	�������/����d�1�1�(�;�<�=�
�� �	
�	������ 1�2����d�1�1�.�A�B�C�
��!�	
�	�������'����d�1�1�(�;�<�=�
�L�	
�	������
�+����d�1�1�(�;�<�=�
�K�	
�	����+�+�L�9�2��y�I�
	������ 7�8�����$�$�\�2�D�4G�4G��4Q�R�
��I�	
�	�������,����d�1�1�(�;�<�=�
�I�	
�
�)�)�'�2���	��{���2�Y�E��-�-�i�%�%�-�.G�H�K��9�+�%�D��O�O�K�)9�)9�;�-�)H�$�O�%�K�	�
�)�)�'�2���	��{���2�Y�E��-�-�i�%�%�-�.G�H�K��9�+�%�D��O�O�K�)9�)9�;�-�)H�$�O�%�K�	�
�(�(��2���-�-�e�Z�Z�\�B�C��'�'���.�q�1�F��*�*�C�5�1�#�6�<�"�G�����u����u�/E�c�/J�F� S�T�U�� � ��U�,�,�c�U�K��F�G�T�T����V�-�-�s�e�[�$�G�H�U�U���	
�	Cr4c�*�UR5nUR[5[UR555 URS:XaSnOSnURUS/5 URU1[UR555 g)NrB)rl)rlr�r))r�ror"r�rVr9)r`rUr�s   r?�	test_keys�TestVersionedFiles.test_keys�sv���'�'�)��������E�J�J�L� 1�2��?�?�a���C��C�	����R��$����#���E�J�J�L� 1�2r4r))rU)TFF)F)Srirjrkrlr�r$r%rrrrr�cleanup_pack_group�len_one_scenariosr!r �len_two_scenariosr�r�r�r�r�rrArrrrr"rXr(r�r<rSrYr\rfrirlrprr{ryr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rMr�r>r�rr�rrrrrr"r&r)r5rBrErIrMrZr�r`rmr)r4r?r�r��s2��?�
��7��~�k�:����-2�
�	
�
��,�U�N�;�4O�P���-2�
�		
�
.�,�,�U�E�1�=���-2�
�		
�
$�,�,�T�4��;���-1�
�		
�
,�,�,�T�5�!�<���-2�
�		
�
$�(�;�;�(�:�:�5�%��K���-2�
�		
�k?��D
��7�	�<�>�R���-2�
�		
�
$��,�T�3J�3L�M���-2�
�		
�
�,�,�T�4��;���-1�
�		
�
�(�;�;�(�:�:�4���J���-2�
�		
�?)��V"�$5�5�I��+�Q�J�(J�6$Y�L"�%�*��"�
AF�

�<�85�#�J>�@
�(
�&F�&F�0,�
�.
1�	*� �8 �8	7�7�2	7�*�"!*�FB�2J�
.�4
�?�$!C�F&C�P?�>*�$2�*-��+
�Z,B�\
�2'�
9�$9�9�
9�
9�
9�
9�	9�Y�9=�v%-�N��*�BV
�pU�n
3r4r�c�n^�\rSrSrSrSrU4SjrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrU=r$)�VirtualVersionedFilesTestsi�z:Basic tests for the VirtualVersionedFiles implementations.c�`�0nUH%nX0R;dMURUX#'M' U$rP)�_parent_map)r`r��ret�ks    r?�_get_parent_map�*VirtualVersionedFilesTests._get_parent_map�s6�����A��$�$�$��)�)�!�,�����
r4c�>�[TU]5 0Ul0Ul[	UR
URR5UlgrP)r�r��_linesrhr#rkr~�texts)r`r�s �r?r�� VirtualVersionedFilesTests.setUp�s7���
��
��������*�4�+?�+?������Q��
r4c�^�UR[URRS//5 g)Nrl)rtr�ror9r_s r?r��)VirtualVersionedFilesTests.test_add_lines�s$�����-�t�z�z�/C�/C�V�R�QS�Tr4c�Z�UR[URR/5 grP)rtr�ror�r_s r?�test_add_mpdiffs�+VirtualVersionedFilesTests.test_add_mpdiffs�s�����-�t�z�z�/E�/E�r�Jr4c�8�URR5 grP)ror�r_s r?�test_check_noerrors�.VirtualVersionedFilesTests.test_check_noerrors�s���
�
���r4c�Z�UR[URR/5 grP)rtr�ror�r_s r?�test_insert_record_stream�4VirtualVersionedFilesTests.test_insert_record_stream�s �����-�t�z�z�/N�/N�PR�Sr4c�\�UR0URRS/55 g)N)sNONEXISTENT)roror�r_s r?�test_get_sha1s_nonexistent�5VirtualVersionedFilesTests.test_get_sha1s_nonexistent�s%������T�Z�Z�1�1�3D�2E�F�Gr4c���SS/URS'URS[R"URS50URRS/55 g)Ns	dataline1s	dataline2�key)r�)rnrorr�ror�r_s r?r��)VirtualVersionedFilesTests.test_get_sha1s�sS��+�\�:����F�����
��+�+�D�K�K��,?�@�A��J�J� � �)��-�	
r4c�t�SS0UlURSS0URRSS/55 g)N�G)r�r�)r�)�r��r�)�L)rhroror�r_s r?r>�.VirtualVersionedFilesTests.test_get_parent_maps<�� �,�/������
�(�)�4�:�:�+D�+D�g�w�EW�+X�	
r4c�8�SS/URS'URRS/SS5n[U5nUR	SUR
5 UR	SUR
S	55 UR	SS/UR
S55 g)
N�FOO�BARr�r�r�Tr�sFOOBARr�)rnror�r�ror�r��r`�itr�s   r?r��1VirtualVersionedFilesTests.test_get_record_stream
s���#�V�,����D��
�Z�Z�
)�
)�7�)�[�$�
G���b�������F�$7�$7�8�����F�$7�$7�
�$C�D����&�&�)�6�+>�+>�y�+I�Jr4c��URRS/SS5n[U5nURSUR5 g)Nr�r�Tr�)ror�r�ror�r�s   r?�test_get_record_stream_absent�8VirtualVersionedFilesTests.test_get_record_stream_absents;��
�Z�Z�
)�
)�7�)�[�$�
G���b�������6�#6�#6�7r4c���SS/URS'S/URS'S/URS'URRSS	/5nUR[	/S
Q5[	U55 g)Nr�r�r��HEYr�sAlbertar�r�r�))r�r�)r�r�)r�r�)rnrorWro�sorted)r`r�s  r?rZ�CVirtualVersionedFilesTests.test_iter_lines_added_or_present_in_keyssk��#�V�,����D��#�H����D��'�L����D��
�Z�Z�
;�
;�W�g�<N�
O������C�D�f�R�j�	
r4)rnrhro)rirjrkrlr�rkr�r�rtrwrzr}r�r>r�r�rZrmr�r�s@r?rfrf�sM���D��R�U�K��T�H�
�
�K�8�

�
r4rfc�2�\rSrSrSrSrSrSrSrSr	g)	�#TestOrderingVersionedFilesDecoratori!c���URS5nUR5 URSS/SS9 URS//SS9 URS//SS9 URS//SS9 UR5 UR	5nUR5 UR
UR5 URRn[R"XA5$)N�test)r)�s	TREE_ROOT�	directoryNr�)�revision_idr�r�r�)�make_branch_builder�start_series�build_snapshot�
finish_series�
get_branch�	lock_readr��unlock�
repository�inventoriesr�OrderingVersionedFilesDecorator)r`�key_priority�builderr#r�s     r?�get_ordering_vf�3TestOrderingVersionedFilesDecorator.get_ordering_vf"s����*�*�6�2����������A�B�PT�	�	
�	����v�r�t��<�����v�r�t��<�����v�r�t��<�������� ��	���
�������!�
�\�\�
%�
%���<�<�R�N�Nr4c�^�UR05nUR/UR5 grP)r�ror�r�s  r?�test_get_empty�2TestOrderingVersionedFilesDecorator.test_get_empty2s&��
�
!�
!�"�
%������R�X�X�&r4c��URSSSSS.5n/SQnURUSS5Vs/sHo3RPM nnUR/SQU5 URS	USS4/UR5 gs snf)
Nrrr�rB�r�r��r��r��r�r�r�r�r�Fr��r�r�r�ror��r`r��request_keysr�r�s     r?�"test_get_record_stream_topological�FTestOrderingVersionedFilesDecorator.test_get_record_stream_topological6s���
�
!�
!�A��A�PQ�"R�
S��;��!�3�3�L�-�QV�W�X�W�!���W��X����=�t�D����!�<���
F�G����	
��	Y��A=c��URSSSSS.5n/SQnURUSS5Vs/sHo3RPM nnUR/S	QU5 URS
USS4/UR5 gs snf)Nrrr�rBr�r�r�F)r�r�r�r�r�r�r�s     r?�test_get_record_stream_ordered�BTestOrderingVersionedFilesDecorator.test_get_record_stream_orderedAs���
�
!�
!�A��A�PQ�"R�
S��;��!�3�3�L�+�u�U�V�U�!���U��V����=�t�D����!�<��e�
D�E�r�x�x�	
��	Wr�c��URSSS.5n/SQnURUSS5Vs/sHo3RPM nnUR/SQU5 URSUSS4/UR5 gs snf)	NrrB)r�r�r�r�F)r�r�r�r�r�r�r�s     r?�%test_get_record_stream_implicit_order�ITestOrderingVersionedFilesDecorator.test_get_record_stream_implicit_orderLs��
�
!�
!�A��":�
;��;��!�3�3�L�+�u�U�V�U�!���U��V�	
���=�t�D����!�<��e�
D�E�r�x�x�	
��Ws�A;r)N)
rirjrkrlr�r�r�r�r�rmr)r4r?r�r�!s��O� '�	
�	
�

r4r�)TF)TFFF)=r-�gzipr�iorr�rrrr	r
rrar
r�testsrrrr�tests.http_utilsr�tests.scenariosr�transport.memoryrrrrvrrrrrrrr r!r"r#r$�weaver%r&�	weavefiler'�
load_testsr@rXrZr�r�r�rr
rirpr�r�rfr�r)r4r?�<module>r�s!��0���8�8�#�@���6�9�/�� �-�J�J�	�	�	�4�#�
'�
��>RW�T�n]

�]

�@:�+�-C�:�zGA�!<�GA�T+�+�8�)�+@��l:�l:�^�0�/��,u
�!<�u
�pJ�/�J�D~3�4�~3�B0@
��@
�F5
�*E�5
r4

Youez - 2016 - github.com/yon3zu
LinuXploit