403Webshell
Server IP : 50.21.180.56  /  Your IP : 216.73.216.193
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_remote.cpython-313.pyc
�

p��g���l
�SrSSKrSSKrSSKrSSKrSSKJr SSKrSSK	J
r
JrJrJ
r
JrJrJr SSK	Jr SSK
Jr SSKJrJr SS	KJr SS
KJr SSKJr SSKJrJrJr S
SK	J r J!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, S
SK&J-r-J.r.J/r/J0r0J1r1J2r2J3r3 S
SK4J5r5J6r6 S
SK7J8r8 S
SK9J:r:J;r;J<r< \r="SS\R|5r?"SS5r@"SS\85rA"SS\5R�5rC"SS\R�5rE"SS \R�5rG"S!S"\R�5rH"S#S$\R�5rI"S%S&\G5rJ"S'S(\G5rK"S)S*\G5rL"S+S,\G5rM"S-S.\G5rN"S/S0\G5rO"S1S2\G5rP"S3S4\G5rQ"S5S6\G5rR"S7S8\G5rS"S9S:\G5rT"S;S<\G5rU"S=S>5rV"S?S@5rW"SASB\G5rX"SCSD\X5rY"SESF\Y5rZ"SGSH\Y5r["SISJ\Y5r\"SKSL\Y5r]"SMSN\Y5r^"SOSP\Y5r_"SQSR\Y5r`"SSST\Y5ra"SUSV\G5rb"SWSX\Y5rc"SYSZ\Y5rd"S[S\\Y5re"S]S^\Y5rf"S_S`\Y5rg"SaSb\Y5rh"ScSd\X5ri"SeSf\R�5rj"SgSh\R�5rk"SiSj\R�5rm"SkSl\G5rnSmro"SnSo\R�5rp"SpSq\n5rq"SrSs\n5rr"StSu\n5rs"SvSw\n5rt"SxSy\n5ru"SzS{\n5rv"S|S}\n5rw"S~S\n5rx"S�S�\n5ry"S�S�\n5rz"S�S�\R|5r{"S�S�\n5r|"S�S�\n5r}"S�S�\n5r~"S�S�\n5r"S�S�\n5r�"S�S�\n5r�"S�S�\n5r�"S�S�\n5r�"S�S�\n5r�"S�S�\n5r�"S�S�\n5r�"S�S�\n5r�"S�S�\n5r�"S�S�\n5r�"S�S�\�5r�"S�S�\�5r�"S�S�\n5r�"S�S�\R|5r�"S�S�5r�"S�S�5r�"S�S�\n5r�"S�S�\R�5r�"S�S�\�5r�"S�S�\�5r�"S�S�\R|5r�"S�S�\R|5r�"S�S�\R|5r�"S�S�\Y5r�"S�S�\n5r�"S�S�\n5r�"S�S�\n5r�"S�S�\n5r�"S�S�\Y5r�"S�S�\R�5r�g)�aVTests for remote bzrdir/branch/repo/etc.

These are proxy objects which act on remote objects by sending messages
through a smart client.  The proxies are to be created when attempting to open
the object given a transport that supports smartserver rpc operations.

These tests correspond to tests.test_smart, which exercises the server side.
�N)�BytesIO�)�branch�config�
controldir�errors�
repository�tests�treebuilder)�	transport)�Branch)�
NULL_REVISION�Revision)�test_server)�load_tests_apply_scenarios)�MemoryTransport)�RemoteSSHTransport�RemoteTCPTransport�RemoteTransport�)	�RemoteBzrProber�bzrdir�groupcompress_repo�	inventory�inventory_delta�
knitpack_repo�remote�
versionedfile�	vf_search)�BzrDir�BzrDirFormat)�chk_bencode_serializer)�RemoteBranch�RemoteBranchFormat�RemoteBzrDir�RemoteBzrDirFormat�RemoteRepository�RemoteRepositoryFormat�UnknownErrorFromSmartServer)�medium�request)�_SmartClient)�!SmartServerRepositoryGetParentMap�#SmartServerRepositoryGetStream_1_19�_stream_to_byte_streamc�^�\rSrSrSS\R
04SS\R04/rU4SjrSr	Sr
SrS	rS
r
SrSrS
rSrSrSrSrU=r$)�BasicRemoteObjectTests�KzHPSS-v2�transport_serverzHPSS-v3c��>�[TU]5 UR5Ul[R
"S5UlURURR5 g)N�.)	�super�setUp�
get_transportrr �create_standalone_workingtree�local_wt�
addCleanup�
disconnect��self�	__class__s ��>/usr/lib/python3/dist-packages/breezy/bzr/tests/test_remote.pyr7�BasicRemoteObjectTests.setUpTsD���
��
���+�+�-����<�<�S�A��
�������1�1�2�c��[R"UR[55nUR	U[
5 g�N)rr%rr&�assertIsInstancer �r>�bs  r@�test_create_remote_bzrdir�0BasicRemoteObjectTests.test_create_remote_bzrdir[s,��������0B�0D�E�����a��(rBc��[R"UR[55nUR	5nURU[5 grD)rr%rr&�open_branchrEr
)r>rGrs   r@�test_open_remote_branch�.BasicRemoteObjectTests.test_open_remote_branch_s7��������0B�0D�E����������f�f�-rBc�8�[R"UR5nUR5nSR	5nURUR
U55 URRSUS9 URUR
U55 g)Nu
È23123123ztest commit)�message�rev_id)
r �open_from_transportr�open_repository�encode�assertFalse�has_revisionr:�commit�
assertTrue)r>rG�repo�revids    r@�test_remote_repository�-BasicRemoteObjectTests.test_remote_repositoryesy���&�&�t�~�~�6��� � �"���%�%�'������*�*�5�1�2��
�
���]�5��A�����)�)�%�0�1rBc���[R"UR5nUR[[
RR5 URU[5 g)z2Should open a RemoteBzrDir over a RemoteTransport.N)
r!�find_formatr�assertInrr�ControlDirFormat�_probersrEr&)r>�fmts  r@�test_find_correct_format�/BasicRemoteObjectTests.test_find_correct_formatmsA���&�&�t�~�~�6���
�
�o�z�'B�'B�'K�'K�L����c�#5�6rBc��[R"UR5nURUR5nUR	U[
5 grD)r!r]r�openrEr )r>ra�ds   r@�test_open_detected_smart_format�6BasicRemoteObjectTests.test_open_detected_smart_formatss8���&�&�t�~�~�6���H�H�T�^�^�$�����a��(rBc��[R"UR5R5nUR	[U5S5 g)Nz
RemoteBranch()r rQrrK�assertStartsWith�strrFs  r@�test_remote_branch_repr�.BasicRemoteObjectTests.test_remote_branch_reprxs3���&�&�t�~�~�6�B�B�D�����c�!�f�o�6rBc�z�[R"UR5nUR[	U5S5 g)Nz
RemoteBzrDir()r rQrrjrkrFs  r@�test_remote_bzrdir_repr�.BasicRemoteObjectTests.test_remote_bzrdir_repr|s*���&�&�t�~�~�6�����c�!�f�o�6rBc���URnURSSS9 [R"UR	S55R5nUR
URR55 URSSS9 [R"UR	S55R5nURURR55 g�N�unstackablez	pack-0.92��format�	stackable�1.9)
r�make_branchr rQ�clonerKrT�_format�supports_stackingrW)r>�trGs   r@�+test_remote_branch_format_supports_stacking�BBasicRemoteObjectTests.test_remote_branch_format_supports_stacking�s����N�N������{��;��&�&�q�w�w�}�'=�>�J�J�L��������4�4�6�7�����U��3��&�&�q�w�w�{�';�<�H�H�J������	�	�3�3�5�6rBc��URnURSSS9nUR5nURURR
5 [R"URS55R5nURURR
5 URSSS9nUR5nURURR
5 [R"URS55R5nURURR
5 grr)r�make_controldir�create_repositoryrTrz�supports_external_lookupsr rQryrRrW)r>r|�bd�rs    r@�4test_remote_repo_format_supports_external_references�KBasicRemoteObjectTests.test_remote_repo_format_supports_external_references�s����N�N��
�
!�
!�-��
!�
D��� � �"��������<�<�=��&�&�q�w�w�}�'=�>�N�N�P��������<�<�=�
�
!�
!�+�e�
!�
<��� � �"������	�	�;�;�<��&�&�q�w�w�{�';�<�L�L�N������	�	�;�;�<rBc�8�URSSS9nUR"S5 UR"5nURSUR"S55 UR"S5 UR"5nURSUR"S55 g)NrrwrtT�append_revisions_onlyF)rx�set_append_revisions_only�get_config_stack�assertEqual�get)r>rrs   r@�,test_remote_branch_set_append_revisions_only�CBasicRemoteObjectTests.test_remote_branch_set_append_revisions_only�s����!�!�(�5�!�9���(�(��.��(�(�*������v�z�z�*A�B�C��(�(��/��(�(�*�������
�
�+B� C�DrBc�z�URSSS9nUR[RURS5 g)Nr�knitrtT)rx�assertRaisesr�UpgradeRequiredr��r>rs  r@�9test_remote_branch_set_append_revisions_only_upgrade_reqd�PBasicRemoteObjectTests.test_remote_branch_set_append_revisions_only_upgrade_reqd�s8���!�!�(�6�!�:������"�"�F�$D�$D�d�	
rB)r:r)�__name__�
__module__�__qualname__�__firstlineno__r�"SmartTCPServer_for_testing_v2_only�SmartTCPServer_for_testing�	scenariosr7rHrLrZrbrgrlror}r�r�r��__static_attributes__�
__classcell__�r?s@r@r1r1Ksz���
�
��!O�!O�P�	
�
�'��)O�)O�P�Q��I�3�)�.�2�7�)�
7�7�7�=�E�
�
rBr1c�4�\rSrSrSrSrS	SjrSrSrSr	g)
�FakeProtocol�zDLookalike SmartClientRequestProtocolOne allowing body reading tests.c�*�XlSUlX lgrD)�body�_body_buffer�_fake_client)r>r��fake_clients   r@�__init__�FakeProtocol.__init__�s���	� ���'�rBc�*�URc[UR5UlURRU5nURR	5[URR
55:XaSURlU$�NF)	r�rr��read�tell�len�getvaluer��expecting_body)r>�count�bytess   r@�read_body_bytes�FakeProtocol.read_body_bytes�ss�����$� '��	�	� 2�D���!�!�&�&�u�-�����!�!�#�s�4�+<�+<�+E�+E�+G�'H�H�/4�D���,��rBc�&�SURlgr�)r�r��r>s r@�cancel_read_body�FakeProtocol.cancel_read_body�s��+0����(rBc��UR$rD)r�r�s r@�read_streamed_body�FakeProtocol.read_streamed_body�s���y�y�rB)r�r�r�N)���)
r�r�r�r��__doc__r�r�r�r�r��rBr@r�r��s��N�(�
�1�rBr�c�v�\rSrSrSrSSjrSSjrSrSrSr	S	r
S
rSrSr
S
rSrSrSrSrSrg)�
FakeClient�z,Lookalike for _SmartClient allowing testing.c��/Ul/UlSUlSUl[R
"U[
URU55 g)zCreate a FakeClient.FN)�	responses�_callsr��_expected_callsr,r��
FakeMedium)r>�fake_medium_bases  r@r��FakeClient.__init__�s>��������#���
 $������d�J�t�{�{�<L�$M�NrBNc��URc/UlURRX45 URRX4U45 grD)r��appendr�)r>�	call_name�	call_args�
response_type�
response_args�
response_bodys      r@�add_expected_call�FakeClient.add_expected_call�sF�����'�#%�D� ����#�#�Y�$:�;������}�]�K�LrBc�@�URRSUS45 g�N�success�r�r��r>�argss  r@�add_success_response�FakeClient.add_success_response�s�������z�4��6�7rBc��URRSX!45 URbURRS5 ggr�)r�r�r�)r>r�r�s   r@�add_success_response_with_body�)FakeClient.add_success_response_with_body�s>�������z�4�6�7����+�� � �'�'��-�,rBc�>�URRSU45 g)N�errorr�r�s  r@�add_error_response�FakeClient.add_error_response�s�������x��.�/rBc�>�URRSU45 g)N�unknownr�)r>�verbs  r@�add_unknown_method_response�&FakeClient.add_unknown_method_response�s�������z�4�0�1rBc�t�UR(a'[SRXRS55eg)Nz*{!r} finished but was still expecting {!r}r)r��AssertionErrorrur�s r@�
finished_test�FakeClient.finished_test�s9����� �<�C�C��.�.�q�1���
� rBc� �URRS5nUSS:Xa[
R"US5eUSS:Xa[
R"US5eU$![a n[SR	U55UeSnAff=f)Nrz!{!r} didn't expect any more callsr��r�)r��pop�
IndexErrorr�rur�UnknownSmartMethod�ErrorFromSmartServer)r>�response_tuple�es   r@�_get_next_response�FakeClient._get_next_response�s���	�!�^�^�/�/��2�N�
�!��
�*��+�+�N�1�,=�>�>�
�A�
�(�
*��-�-�n�Q�.?�@�@�����	� �3�:�:�4�@���
��	�s�A#�#
B
�-B�B
c	�&�URcgURRS5nUcgXS:wdX#S:wa$[SR	UUSUSUU55eg![a"n[SR	UUU55UeSnAff=f)Nrz2{!r} didn't expect any more calls but got {!r}{!r}r�z'{!r} expected {!r}{!r} but got {!r}{!r})r�r�r�r�ru)r>�methodr��	next_callr�s     r@�_check_call�FakeClient._check_call�s������'��		��,�,�0�0��3�I�����q�\�!�T�q�\�%9� �9�@�@���a�L��a�L�����
�&:���	� �D�K�K�������

��	�s�A$�$
B�.B�Bc��URX5 URRSX45 UR5S$)N�callr�)r�r�r�r�)r>r�r�s   r@r��FakeClient.calls;������&������F�F�1�2��&�&�(��+�+rBc��URX5 URRSX45 UR5nSUlUS[USU54$)N�call_expecting_bodyTr�r�r�r�r�r�r�r�)r>r�r��results    r@r��FakeClient.call_expecting_bodysX������&������1�6�@�A��(�(�*��"����a�y�,�v�a�y�$�7�7�7rBc��URX5 URRSXU45 UR5nUS[	USU54$)N�call_with_body_bytesr�r)r�r�r�r�r��r>r�r�r�r�s     r@r�FakeClient.call_with_body_bytessR������&������2�F�$�G�H��(�(�*���a�y�,�v�a�y�$�7�7�7rBc��URX5 URRSXU45 UR5nSUlUS[USU54$)N�#call_with_body_bytes_expecting_bodyTr�rr�rs     r@r�.FakeClient.call_with_body_bytes_expecting_body%s[������&������A�6�QU�V�W��(�(�*��"����a�y�,�v�a�y�$�7�7�7rBc���[U5nURUSUSS5 URRSUSUSSU45 UR	5nSnUSU4$)Nrr��call_with_body_stream)�listr�r�r�r�)r>r��streamr��response_handlers     r@r	� FakeClient.call_with_body_stream,ss���f�������a��$�q�r�(�+������3�T�!�W�d�1�2�h��O�P��(�(�*�� ���a�y�*�*�*rB)r�r�r�r�)z	fake baserD)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr	r�r�rBr@r�r��sT��6�
O�QU�M�8�.�
0�2����6,�
8�8�8�
+rBr�c� �\rSrSrSrSrSrg)r�i9c�N�[RRX5 XlgrD)r*�SmartClientMediumr��
_client_calls)r>�client_calls�bases   r@r��FakeMedium.__init__:s��� � �)�)�$�5�)�rBc�:�URRS5 g)N�zdisconnect medium)rr�r�s r@r<�FakeMedium.disconnect>s�����!�!�"8�9rB)rN)r�r�r�r�r�r<r�r�rBr@r�r�9s��*�:rBr�c��\rSrSrSrSrg)�
TestVfsHasiBc��[S5nURS5 [SUS9nSnURU5nUR	SSURS544/UR5 URU5 g)	N�/�yeszbzr://localhost/��_clientu/hellØr�shas�utf-8)r�r�r�hasr�rSr�rW)r>�clientr�filenamer�s     r@�test_unicode_path�TestVfsHas.test_unicode_pathCst���C����#�#��	
�$�$6��G�	� �����x�(�����6�6�H�O�O�G�,D�+F�G�H�&�-�-�X�����rBr�N)r�r�r�r�r#r�r�rBr@rrBs��	 rBrc�&�\rSrSrSrSrSrSrg)�
TestRemoteiOc�j�[RRS5"5nUR5$�N�default)r�format_registryr��get_branch_format�r>�reference_bzrdir_formats  r@r+�TestRemote.get_branch_formatPs+��",�"<�"<�"@�"@��"K�"M��&�8�8�:�:rBc�b�[RRS5"5nUR$r()rr*r��repository_formatr,s  r@�get_repo_format�TestRemote.get_repo_formatTs(��",�"<�"<�"@�"@��"K�"M��&�8�8�8rBc�$�UR5 g)z?Assert that all of a FakeClient's expected calls have occurred.N)r�)r>r�s  r@�assertFinished�TestRemote.assertFinishedXs���!�!�#rBr�N)r�r�r�r�r+r1r4r�r�rBr@r&r&Os��;�9�$rBr&c�0�\rSrSrSrSrSrSrSrSr	g)	�,Test_ClientMedium_remote_path_from_transporti]zDTests for the behaviour of client_medium.remote_path_from_transport.c��[R"U5n[R"U5nUR	U5nURX5 g)z�Assert that the result of
SmartClientMedium.remote_path_from_transport is the expected value for
a given client_base and transport_base.
N)r*r�_mod_transportr8�remote_path_from_transportr�)r>�expected�client_base�transport_base�
client_mediumr|r�s       r@�assertRemotePath�=Test_ClientMedium_remote_path_from_transport.assertRemotePath`sB��
�0�0��=�
��(�(��8���9�9�!�<������*rBc�P�URSSS5 URSSS5 g)z�SmartClientMedium.remote_path_from_transport calculates a URL for
the given transport relative to the root of the client base URL.
�xyz/zbzr://host/pathzbzr://host/xyzz	path/xyz/zbzr://host/path/xyzN)r?r�s r@�test_remote_path_from_transport�LTest_ClientMedium_remote_path_from_transport.test_remote_path_from_transportjs,��	
���f�&7�9I�J����k�+<�>S�TrBc��[R"U5nUR5nURU5nUR	U5nURX5 g)z�Assert that the result of
HttpTransportBase.remote_path_from_transport is the expected value for
a given transport_base and relpath of that transport.  (Note that
HttpTransportBase is a subclass of SmartClientMedium).
N)r9r8�get_smart_mediumryr:r�)r>r;r=�relpath�base_transportr>�cloned_transportr�s        r@�assertRemotePathHTTP�ATest_ClientMedium_remote_path_from_transport.assertRemotePathHTTPqsR��(�5�5�n�E��&�7�7�9�
�)�/�/��8���9�9�:J�K������*rBc�n�SH/nURSUS-S5 URSUS-S5 M1 g)z�Remote paths for HTTP transports are calculated differently to other
transports.  They are just relative to the client base, not the root
directory of the host.
)zhttp:zhttps:z	bzr+http:z
bzr+https:z../xyz/z//host/pathrBN)rJ)r>�schemes  r@�$test_remote_path_from_transport_http�QTest_ClientMedium_remote_path_from_transport.test_remote_path_from_transport_http}s>��
E�F��%�%�i��-�1G��S��%�%�f�f�}�.D�f�M�ErBr�N)
r�r�r�r�r�r?rCrJrNr�r�rBr@r7r7]s��N�+�U�
+�NrBr7c�$�\rSrSrSrSrSrSrg)�$Test_ClientMedium_remote_is_at_leasti�z<Tests for the behaviour of client_medium.remote_is_at_least.c�p�[R"S5nURURS55 g)zCA fresh medium assumes that the remote side supports all
versions.
�
dummy base)�crTN)r*rrT�_is_remote_before�r>r>s  r@�test_initially_unlimited�=Test_ClientMedium_remote_is_at_least.test_initially_unlimited�s-���0�0��>�
�����8�8��B�CrBc��[R"S5nURS5 URUR	S55 URUR	S55 URS5 URUR	S55 UR
UR5S5 URS5 URUR5S5 URUR	S55 g)zKCalling _remember_remote_is_before ratchets down the known remote
version.
rS�r��)r���_remember_remote_is_before)r��	N)	r*rr]rWrUrT�assertNotContainsRe�get_log�assertContainsRerVs  r@�test__remember_remote_is_before�DTest_ClientMedium_remote_is_at_least.test__remember_remote_is_before�s����0�0��>�
�	�0�0��8����
�7�7��?�@�����8�8��@�A��0�0��8����
�7�7��?�@�	
� � �����1M�N��0�0��8����d�l�l�n�.J�K����
�7�7��?�@rBr�N)r�r�r�r�r�rWrbr�r�rBr@rQrQ�s��F�D�ArBrQc�,�\rSrSrSrSrSrSrSrg)�TestBzrDirCloningMetaDiri�c�\�UR5 URS5nUR5 SnURU5 UR	5 [URVs/sH o3RRU:XdMUPM" sn5nURSU5 gs snf)Nr5�BzrDir.cloning_metadirr�)
� setup_smart_server_with_call_logr��reset_smart_call_log�disable_verb�cloning_metadirr��
hpss_callsr�r�r��r>�a_dirr�r��
call_counts     r@�test_backwards_compat�.TestBzrDirCloningMetaDir.test_backwards_compat�s����-�-�/��$�$�S�)���!�!�#�(�����$��
�����4�?�?�W�?�4�i�i�>N�>N�RV�>V�$�?�W�X�
�����J�'��Xs�(B)�	B)c	��URS5nURS5nURR5n[	UR
5nUR
SSSS54 UR
SSS	S
URS5RS5454 [U[5US9nUR5nUR[R[U55 URURUR5 URUR UR 5 UR#U5 g)
N�quack�
referencedrg��quack/�Falser�)sBranchReference�BzrDir.open_branchV3�rvr�srefrr)r8rxrrkr�rr��get_urlrSr%r&r�r�BzrDirMetaFormat1�type�_repository_format�_branch_formatr4)r>rrtr;r!�a_controldirr�s       r@�test_branch_reference�.TestBzrDirCloningMetaDir.test_branch_reference�s���&�&�w�/�	��%�%�l�3�
��(�(�8�8�:���I�N�N�+���$�$�)�%��%�	
�	
�
�$�$�'�������l�3�:�:�7�C�D�	
�	
�$�I�/A�/C�V�T���-�-�/������1�1�4��<�@�����4�4�f�6O�6O�P�����0�0�&�2G�2G�H����F�#rBc�V�URS5nURS5nURS5 [UR5n[
RRS5"5nUR5nURSSSUSS454 [U[5US	9nUR5nUR[R[!U55 URSUR"5 URSUR$5 UR'U5 g)
Nr5rsr)rgrur�rB��branchrBr)r8ryr�r�rrr*r��network_namer�r%r&rkr�rr{r|r}r~r4�r>rr!r-�control_namerr�s       r@�test_current_server�,TestBzrDirCloningMetaDir.test_current_server�s���&�&�s�+�	��O�O�G�,�	����W�%��I�N�N�+��",�"<�"<�"@�"@��"K�"M��.�;�;�=���$�$�)�%���s�$4�5�	
�	
�$�I�/A�/C�V�T���-�-�/��	
����1�1�4��<�@�����v�8�8�9�����v�4�4�5����F�#rBc�J�URS5nURS5nURR5 [	UR
5nUR
SSSS54 [U[5US9nUR[RUR5 g)Nrsrtrgrur�)r�r�r�r)r8rxrrkr�rr�r%r&r�r�UnknownFormatError)r>rrtr!rs     r@�test_unknown�%TestBzrDirCloningMetaDir.test_unknown�s����&�&�w�/�	��%�%�l�3�
����-�-�/��I�N�N�+���$�$�)�%��:�	
�	
�$�I�/A�/C�V�T�����&�3�3�\�5Q�5Q�RrBr�N)	r�r�r�r�rpr�r�r�r�r�rBr@rere�s��(�$�:$�2SrBrec� �\rSrSrSrSrSrg)�TestBzrDirCheckoutMetaDiri�c�F�[5n[UR5n[RRS5"5nUR
5nURSSSUSS45 URS5 URS5n[U[5US9nUR5nUR[R[!U55 URSUR"5 URSUR$5 UR'U5 g)Nr)�BzrDir.checkout_metadirryr�rBrsr)rr�rrr*r�r�r��mkdirryr%r&�checkout_metadirr�rr{r|r}r~r4r�s       r@�test__get_checkout_format�3TestBzrDirCheckoutMetaDir.test__get_checkout_format�s���#�%�	��I�N�N�+��",�"<�"<�"@�"@��"K�"M��.�;�;�=��� � �&���
�3��$�		
�	���� ��O�O�G�,�	�#�I�/A�/C�V�T���.�.�0��	
����1�1�4��<�@�����v�8�8�9�����v�4�4�5����F�#rBc�J�[5n[UR5nURSSSS5 UR	S5 URS5n[
U[5US9nUR[RUR5 URU5 g)Nr�ryr�)sdontknowrBrBrsr)
rr�rr�r�ryr%r&r�rr�r�r4�r>rr!rs    r@�test_unknown_format�-TestBzrDirCheckoutMetaDir.test_unknown_formats���#�%�	��I�N�N�+��� � �&���#�		
�	���� ��O�O�G�,�	�#�I�/A�/C�V�T�����&�3�3�\�5R�5R�S����F�#rBr�N)r�r�r�r�r�r�r�r�rBr@r�r��s��$�,
$rBr�c��\rSrSrSrSrg)�TestBzrDirGetBranchesic	�8�[5n[UR5n[RRS5"5nUR
5R5nUR[R"SU4SU4S.5S5 URSSSSSURR55 URS5 URSSSSSURR55 URS5 URS	5 URS	5n[U[!5US
9nUR#5nUR%SS1['UR)555 UR%/S
QUR*5 g)Nr)r�)�foorBr��okrB�no�
NotStackedrsr��foo))r�sBzrDir.get_branchesry�r��BzrDir.find_repositoryV3ry�r��Branch.get_stacked_on_urlryr�r�)rr�rrr*r�r+r�r��bencoder�r0r�r�ryr%r&�get_branchesr��set�keysr�)r>rr!r-�branch_namerr�s       r@�test_get_branches�'TestBzrDirGetBranches.test_get_branches so��#�%�	��I�N�N�+��",�"<�"<�"@�"@��"K�"M��-�?�?�A�N�N�P���-�-��O�O�#�[�1��K�8P�Q�
�
�		
�	�#�#������#�5�5�B�B�D�
	
�	�!�!�-�0��#�#������#�5�5�B�B�D�
	
�	�!�!�-�0����� ��O�O�G�,�	�#�I�/A�/C�V�T���*�*�,�����"�e��c�&�+�+�-�&8�9����
�
�M�M�		
rBr�N)r�r�r�r�r�r�r�rBr@r�r�s��+
rBr�c��\rSrSrSrSrg)�TestBzrDirDestroyBranchiNc��URS5nURS5 [UR5nUR	SSSS54 [U[
5US9nUR5 URU5 g)NrsrtsBzrDir.destroy_branchryr��r�r)	r8rxr�rr�r%r&�destroy_branchr4r�s    r@�test_destroy_default�,TestBzrDirDestroyBranch.test_destroy_defaultOsx���&�&�w�/�	�����&��I�N�N�+���$�$�(�,�
�H�
�	
�
$�I�/A�/C�V�T���#�#�%����F�#rBr�N)r�r�r�r�r�r�r�rBr@r�r�Ns��$rBr�c� �\rSrSrSrSrSrg)�TestBzrDirHasWorkingTreei]c��URS5n[UR5nURSSSS54 [	U[5US9nUR
UR55 URU5 g)Nrs�BzrDir.has_workingtreeryr��rr)	r8r�rr�r%r&rW�has_workingtreer4r�s    r@�test_has_workingtree�-TestBzrDirHasWorkingTree.test_has_workingtree^ss���&�&�w�/�	��I�N�N�+���$�$�)�<��Y�
�	
�
$�I�/A�/C�V�T������4�4�6�7����F�#rBc��URS5n[UR5nURSSSS54 [	U[5US9nUR
UR55 URU5 g)Nrsr�ryr��r�r)	r8r�rr�r%r&rTr�r4r�s    r@�test_no_workingtree�,TestBzrDirHasWorkingTree.test_no_workingtreejsu���&�&�w�/�	��I�N�N�+���$�$�)�<��X�
�	
�
$�I�/A�/C�V�T������5�5�7�8����F�#rBr�N)r�r�r�r�r�r�r�r�rBr@r�r�]s��
$�
$rBr�c��\rSrSrSrSrg)�TestBzrDirDestroyRepositoryiwc���URS5n[UR5nURSSSS54 [	U[5US9nUR
5 URU5 g)NrssBzrDir.destroy_repositoryryr�r�r)r8r�rr�r%r&�destroy_repositoryr4r�s    r@�test_destroy_repository�3TestBzrDirDestroyRepository.test_destroy_repositoryxsj���&�&�w�/�	��I�N�N�+���$�$�,�l�J��
�	
�
$�I�/A�/C�V�T���'�'�)����F�#rBr�N)r�r�r�r�r�r�r�rBr@r�r�ws��
$rBr�c�<�\rSrSrS
SjrSrSrSrSrSr	Sr
g	)�TestBzrDirOpeni�c��[5nURU5 URU5n[UR5nX24$rD)rr�ryr�r)r>�pathrr!s    r@�make_fake_client_and_transport�-TestBzrDirOpen.make_fake_client_and_transport�s;��#�%�	�������O�O�D�)�	��I�N�N�+��� � rBc	���UR5upURSSSS5 UR[R[
U[
5USS9 URU5 g)N�BzrDir.open_2.1ryr�r�T�r�_force_probe)r�r�r�r�NotBranchErrorr%r&r4�r>r!rs   r@�test_absent�TestBzrDirOpen.test_absent�sf�� �?�?�A���� � �!3�\�:�x�X�����!�!���� ���
	�	
�	
���F�#rBc�X�UR5upURSSSS5 [U[5USS9nUR	U[5 URUR
55 UR[RUR5 URU5 g)Nr�ryr�)rr�Tr�)r�r�r%r&rErTr�r�r�
NoWorkingTree�open_workingtreer4�r>r!rr�s    r@� test_present_without_workingtree�/TestBzrDirOpen.test_present_without_workingtree�s��� �?�?�A���� � ���j�/�	
���)�+�V�$�
��	
���b�,�/�����+�+�-�.����&�.�.��0C�0C�D����F�#rBc�X�UR5upURSSSS5 [U[5USS9nUR	U[5 URUR
55 UR[RUR5 URU5 g)Nr�ryr�)rrTr�)r�r�r%r&rErWr�r�r�NotLocalUrlr�r4r�s    r@�test_present_with_workingtree�,TestBzrDirOpen.test_present_with_workingtree�s��� �?�?�A���� � ���j�:J�	
���)�+�V�$�
��	
���b�,�/�����*�*�,�-����&�,�,�b�.A�.A�B����F�#rBc���UR5upURSSSS5 URSSSS5 [U[5USS	9nUR	U[5 URU5 g)
Nr�ryr��r��BzrDir.openr�r�Tr�)r�r�r%r&rEr4r�s    r@rp�$TestBzrDirOpen.test_backwards_compat�sx�� �?�?�A���� � ���j�:O�	
�	� � ���z�9�U�
��)�+�V�$�
��	
���b�,�/����F�#rBc�(^^�UR5umnTRmUU4SjnUTlTRSSSS5 TRSSSS5 [U[	5TS	S
9nURU[5 UR
T5 g)Nc�>�STRlTRRS5 TTlTRX5 g)NrrZ)�_medium�_protocol_versionr]r�)r�r�r!�orig_check_calls  ��r@�
check_call�@TestBzrDirOpen.test_backwards_compat_hpss_v2.<locals>.check_call�s7���/0�F�N�N�,��N�N�5�5�f�=�!0�F�����v�,rBr�ryr�r�r�r�r�Tr�)r�r�r�r%r&rEr4)r>rr�r�r!r�s    @@r@�test_backwards_compat_hpss_v2�,TestBzrDirOpen.test_backwards_compat_hpss_v2�s���� �?�?�A���	�
!�,�,��	-�(���� � ���j�:O�	
�	� � ���z�9�U�
��)�+�V�$�
��	
���b�,�/����F�#rBr�N)rs)r�r�r�r�r�r�r�r�rpr�r�r�rBr@r�r��s ��!�$�$�$�
$�$rBr�c�H�\rSrSrSrSrSrSrSrSSjr	Sr
S	rS
rg)
�TestBzrDirOpenBranchi�c��UR5 URS5 [R"UR	S55nUR5 SnUR
U5 UR5 [URVs/sH o3RRU:XdMUPM" sn5nURSU5 gs snf)Nr5rxr�)
rhrxr rerzrirjrKr�rlr�r�r�rms     r@rp�*TestBzrDirOpenBranch.test_backwards_compat�s����-�-�/���������D�L�L��-�.���!�!�#�&�����$��
�����4�?�?�W�?�4�i�i�>N�>N�RV�>V�$�?�W�X�
�����J�'��Xs�
C�.Cc�V�UR5nUR5nUR5R5n[5nUR	S5 URS5n[
UR5nURSSSSU45 URSSSSSS	S	S	U45 URS
SSS5 [U[5US
9nUR"5nURU[5 URXgR5 UR!U5 g)Nrsrxryr�r�r�r�rBr�r�r��r�r)r1r�r+rr�ryr�rr�r%r&rKrEr#r�rr4)r>�reference_formatr��branch_network_namerr!rr�s        r@�test_branch_present�(TestBzrDirOpenBranch.test_branch_present�s���/�/�1��'�4�4�6��"�4�4�6�C�C�E��#�%�	����� ��O�O�G�,�	��I�N�N�+��� � �#���
�+�,�		
�	� � �'���
�C���u�l�;�		
�	� � �(�,��BR�	
��i�);�)=�v�N���#�#�%�����f�l�3�����!2�!2�3����F�#rBc�\�[5nURS5 URS5n[UR5nURS5 [
U[5US9nUR[RUR5 URS/UR5 g)Nrs�nobranchr)r�rxry)rr�ryr�rr�r%r&r�rr�rKr�r�)r>rr!rs    r@�test_branch_missing�(TestBzrDirOpenBranch.test_branch_missings���#�%�	����� ��O�O�G�,�	��I�N�N�+���!�!�+�.��i�);�)=�v�N�����&�/�/��1C�1C�D����
<�=�v�}�}�	
rBc�*^�/mSU4Sjjn[5n[UR5n[U[	5US9nXlUR
SUR"55 UR
S/T5 UR
/UR5 g)Nc�(>�TRS5 g)N�Called�a-branch)r�)�name�possible_transports�callss  �r@rK�?TestBzrDirOpenBranch.test__get_tree_branch.<locals>.open_branchs����L�L��"�rBr)Nr�r�)NN)	rr�rr%r&rKr��_get_tree_branchr�)r>rKrr!rrs     @r@�test__get_tree_branch�*TestBzrDirOpenBranch.test__get_tree_branchs�����	�$�%�	��I�N�N�+���i�);�)=�v�N��(�����+�V�-D�-D�-F�G����(��U�+�����V�]�]�+rBc��[S5n[UR5nUR5nUR	5nUR5R	5nUR
SSSSU45 UR
SSSSSS	S	S	U45 UR
S
SSS5 [U[5US
9nUR"5 URU5 g)Nzbzr://localhost/~hello/rx)s~hello/r�r�r�r�rBr�r�r�r�r)rr�rr1r�r+r�r%r&rKr4)r>rr!r�r�r�rs       r@�test_url_quoting_of_path�-TestBzrDirOpenBranch.test_url_quoting_of_path"s���'�'@�A�	��I�N�N�+���/�/�1��'�4�4�6��"�4�4�6�C�C�E��� � �#���
�+�,�		
�	� � �'���
�C���u�l�;�		
�	� � �(�-��CS�	
��i�);�)=�v�N���������F�#rBc��UR5nUR5n[5nURS5 UR	S5nU(aSnOSnU(aSnOSn[UR5n	U	RSSXxX55 [U[5U	S9n
U
R"5nURS/U	R5 URU[5 URX�R5 URXR R"5 URX+R R$5 g)Nrsrr�r�rBrr�)r1r�rr�ryr�rr�r%r&rRr�r�rEr'rrz�rich_root_data�supports_tree_reference)r>�	rich_root�subtrees�external_lookupr�r�r�
rich_response�subtree_responser!rr�s            r@�check_open_repository�*TestBzrDirOpenBranch.check_open_repository=s���/�/�1��'�4�4�6��#�%�	����� ��O�O�G�,�	��"�M�!�M��%��$���I�N�N�+���#�#��3�
��	
��i�);�)=�v�N���'�'�)�����
@�A�6�=�=�	
�	
���f�&6�7�����!2�!2�3�����N�N�$A�$A�B�����>�>�#I�#I�JrBc��URSS5 URSS5 URSS5 URSS5 URSSS5 g)NTFr)rr�s r@�+test_open_repository_sets_format_attributes�@TestBzrDirOpenBranch.test_open_repository_sets_format_attributesYsT���"�"�4��.��"�"�5�$�/��"�"�4��/��"�"�5�%�0��"�"�5�%��8rBc�r�UR[R[R[55 g)zJRemoteBzrDirFormat should fail to probe if the server version is too
old.
N)r�rr�r�probe_transport�OldServerTransportr�s r@�test_old_server�$TestBzrDirOpenBranch.test_old_server`s)��	
����!�!�?�#B�#B�DV�DX�	
rBr�Nr�)
r�r�r�r�rpr�r�rrrrrr�r�rBr@r�r��s+��	(�$�:

�,�&$�6K�89�
rBr�c�&�\rSrSrSrSrSrSrg)�TestBzrDirCreateBranchiic�n�UR5 URS5nUR5 URS5 URR5 [
URVs/sH!nURRS:XdMUPM# sn5nURSU5 gs snf)Nr5�BzrDir.create_branchr�)rh�make_repositoryrirjr�
create_branchr�rlr�r�r�)r>rXr��create_branch_call_counts    r@rp�,TestBzrDirCreateBranch.test_backwards_compatjs����-�-�/��#�#�C�(���!�!�#����1�2����%�%�'�#&�!�O�O�
�+�D��9�9�#�#�'>�>��+�
�$
� �	
����4�5��

s�0B2�B2c�j�URS5nURS5nURS5 [UR5n[
RRS5"5nUR5nUR5nURnUR5nURSSU4SSUSS	S	S
U45 [U[5US9nUR5n	URU	[ R"5 U	R$n
UR'XZR55 g)Nr5rsr)rrvr�r�rBr�rr)r8ryrr�rrr*r�r+r�r0r�r%r&rrErr#rzr�)r>rr!r-r�r��reference_repo_fmt�reference_repo_namerrrus           r@r��*TestBzrDirCreateBranch.test_current_serverys���&�&�s�+�	��O�O�G�,�	����W�%��I�N�N�+��",�"<�"<�"@�"@��"K�"M��2�D�D�F��'�4�4�6��4�F�F��0�=�=�?��� � �#�
��%��
�L�#�u�e�V�=P�Q�		
�$�I�/A�/C�V�T���+�+�-�����f�f�&9�&9�:���������':�':�'<�=rBc��[RUlURS5nUR	S5n[UR5nURS5n[RRS5"5nUR5nUR5nURnUR5nURSSU4SSUSS	S	S
U45 [U[!5US9n	U	R#US9n
UR%U
[&R(5 U
R*nUR-XkR55 g
)zoBug 726584: create_branch(..., repository=repo) should work
regardless of what the smart medium's base URL is.
r5rsr)rsextra/quack/r�r�rBr�rr�r	N)rr�r3r8rr�rryrr*r�r+r�r0r�r%r&rrErr#rzr�)r>rrXr!r-r�r�r#r$rrrus            r@�(test_already_open_repo_and_reused_medium�?TestBzrDirCreateBranch.test_already_open_repo_and_reused_medium�s,��!,� F� F����&�&�s�+�	��#�#�G�,���I�N�N�+���O�O�G�,�	�",�"<�"<�"@�"@��"K�"M��2�D�D�F��'�4�4�6��4�F�F��0�=�=�?��� � �#�
�l�+��
�L�#�u�e�V�=P�Q�		
�$�I�/A�/C�V�T���+�+�t�+�<�����f�f�&9�&9�:���������':�':�'<�=rB�r3N)r�r�r�r�rpr�r(r�r�rBr@rris��
6�>�0>rBrc� �\rSrSrSrSrSrg)�TestBzrDirCreateRepositoryi�c�\�UR5 URS5nUR5 URS5 UR"5 [URVs/sH!nURRS:XdMUPM# sn5nURSU5 gs snf)Nr5�BzrDir.create_repositoryr�)
rhr�rirjr�r�rlr�r�r�)r>rr��create_repo_call_counts    r@rp�0TestBzrDirCreateRepository.test_backwards_compat�s����-�-�/��%�%�c�*���!�!�#����5�6�� � �"�!$�!�O�O�
�+�D��9�9�#�#�'B�B��+�
�"
��	
����2�3��

s�'B)�	B)c
���URS5nURS5nURS5 [UR5n[
RRS5"5nURnUR5nURSSSSSSSU45 [U[5US	9nUR5nURU[R 5 UR"nUR%UR&5 UR%UR(5 UR%UR*5 UR-XXR55 g)
Nr5rsr)r.)rvs6Bazaar repository format 2a (needs bzr 1.16 or later)
rwr�r�rr)r8ryr�r�rrr*r�r0r�r�r%r&r�rErr'rzrWr	r
r�r�)	r>rr!r-r�r�rrXrus	         r@r��.TestBzrDirCreateRepository.test_current_server�s'���&�&�s�+�	��O�O�G�,�	����W�%��I�N�N�+��",�"<�"<�"@�"@��"K�"M��2�D�D��'�4�4�6��� � �'�
�

�
�F�F�F�L�9�		
�$�I�/A�/C�V�T���-�-�/�����d�F�$;�$;�<���������-�-�.�����6�6�7�����8�8�9�����':�':�'<�=rBr�N)r�r�r�r�rpr�r�r�rBr@r,r,�s��
4�>rBr,c�&�\rSrSrSrSrSrSrg)�TestBzrDirOpenRepositoryi�c��UR5nUR5nSnURU5 [U5nUR	S5 UR	S5 URSSSS5 UR
SS5 URSS	S
5 UR
UR5S5 URSS	S
5 [US-SUS
9n[U[5US9nUR"5nUR/SQUR5 URX'RR55 g)N�bzr://example.com/r��BzrDir.find_repositoryV2r�rBr��#Bazaar-NG meta directory, format 1
�stat�0�65535�quack/F�r*rr)r��r�r7ry)r�sBzrDir.find_repositoryry�r��get)s/quack/.bzr/branch-format�r�r9)s/quack/.bzr�r�r@)s/quack/.bzr/repository/format�r�r9)s/quack/.bzr/repository�r1r��
permit_urlr�r�r�r��get_format_stringrr%r&rRr�r�rz�r>r�r��
server_urlr!�remote_transportrrXs        r@�test_backwards_compat_1_2_3�4TestBzrDirOpenRepository.test_backwards_compat_1_2_3�s8���/�/�1��'�4�4�6��)�
����
�#��J�'���*�*�+F�G��*�*�+F�G��#�#�E�3��u�=�	�-�-�3�U�	
�	�#�#�G�T�8�<��-�-��.�.�0�%�	
�	�#�#�G�T�8�<�*���!�%��
���.�0B�0D�f�U���%�%�'�����
�
�M�M�	
�	
����|�|�'@�'@�'B�CrBc�n�UR5nUR5nSnURU5 [U5nUR	S5 URSSSSS5 UR
SS5 URSSS	5 UR
UR5S5 URSSS	5 [US
-SUS9n[U[5US
9nUR"5nUR/SQUR5 URX'RR55 g)Nr6r�r�rBr�r8r9r:r;r<Fr=r)r�r>r?rArBrCrDrGs        r@�test_backwards_compat_2�0TestBzrDirOpenRepository.test_backwards_compat_2s+���/�/�1��'�4�4�6��)�
����
�#��J�'���*�*�+F�G��#�#�E�3��u�e�D�	�-�-�3�U�	
�	�#�#�G�T�8�<��-�-��.�.�0�%�	
�	�#�#�G�T�8�<�*���!�%��
���.�0B�0D�f�U���%�%�'�����
�
�M�M�
	
�	
����|�|�'@�'@�'B�CrBc���UR5nUR5n[5nURS5 UR	S5n[UR5nURSSSSSU5 [U[5US9nUR"5nURS/UR5 URX&RR55 g)Nrsr�rBr�rr�)r1r�rr�ryr�rr�r%r&rRr�r�rz)r>r�r�rr!rrXs       r@r��,TestBzrDirOpenRepository.test_current_server,s����/�/�1��'�4�4�6��#�%�	����� ��O�O�G�,�	��I�N�N�+���#�#�E�3��u�e�\�R��i�);�)=�v�N���%�%�'�����
@�A�6�=�=�	
�	
����|�|�'@�'@�'B�CrBr�N)r�r�r�r�rJrMr�r�r�rBr@r4r4�s��&D�P$D�L
DrBr4c�&�\rSrSrSrSrSrSrg)�TestBzrDirFormatInitializeExi<c
�<�[5n[R"5R5nUR	5n[UR5nURSUSSSSSSSSS4
SS5 URUSUSSSSSSSS5 URU5 g)	z(Simple test for typical successful call.�BzrDirFormat.initialize_ex_1.16�pathrwrBr�)�.r�r�rsrepo fmtsrepo bzrdir fmts
bzrdir fmtrwrBrBsrepo lock tokenFN)
r&r!�get_default_formatr�r8r�rr��_initialize_on_transport_ex_rpcr4)r>ra�default_format_namerr!s     r@�test_success�)TestBzrDirFormatInitializeEx.test_success=s��� �"��*�=�=�?�L�L�N���&�&�(�	��I�N�N�+��� � �.�#����������
�
�
�	
�@	�+�+������������	
�	
���F�#rBc���[5n[R"5R5nUR	5n[UR5nURSUSSSSSSSSS4
SS5 UR[RURUSUSSSSSSSS5
nURS	UR5 URS
UR5 URU5 g)zhError responses are translated, e.g. 'PermissionDenied' raises the
corresponding error from the client.
rTrUrwrBr�)�PermissionDeniedrUs
extra infoFNr�z: extra info)r&r!rWr�r8r�rr�r�r�PermissionDeniedrXr�r��extrar4)r>rarYrr!�errs      r@�
test_error�'TestBzrDirFormatInitializeEx.test_errorrs���!�"��*�=�=�?�L�L�N���&�&�(�	��I�N�N�+��� � �.�#����������
�
�9�	
�(����#�#��/�/������������
��	
�������*��������3����F�#rBc��URS5nURS5n[5nUR[R
URUSS9 g)z'Integration test for error translation.r�zno-such-pathF)�
create_prefixN)�make_smart_serverryr&r�r9�
NoSuchFile�initialize_on_transport_ex)r>rras   r@�test_error_from_real_server�8TestBzrDirFormatInitializeEx.test_error_from_real_server�sS���*�*�5�1�	��O�O�N�3�	� �"������%�%��*�*���		�	
rBr�N)r�r�r�r�rZrarhr�r�rBr@rRrR<s��3$�j-$�^

rBrRc�$�\rSrSrSrSrSrSrg)�OldSmartClienti�zzA fake smart client for test_old_version that just returns a version one
response to the 'hello' (query version) command.
c��[S5n[5n[R"X5n[R"U5$)Nsok1
)rr*�SmartSimplePipesClientMedium�SmartClientStreamMediumRequest)r>�
input_file�output_filer>s    r@�get_request�OldSmartClient.get_request�s4���\�*�
��i���;�;�J�T�
��4�4�]�C�CrBc��g)Nr�r�r�s r@�protocol_version�OldSmartClient.protocol_version�s��rBr�N)r�r�r�r�r�rqrtr�r�rBr@rkrk�s���D�rBrkc�$�\rSrSrSrSrSrSrg)ri�zeA fake transport for test_old_server that reports it's smart server
protocol version as version one.
c��SUlg)Nzfake:�rr�s r@r��OldServerTransport.__init__�s	����	rBc��[5$rD)rkr�s r@�get_smart_client�#OldServerTransport.get_smart_client�s����rBrxN)r�r�r�r�r�r�r{r�r�rBr@rr�s���� rBrc��\rSrSrSrSrg)�RemoteBzrDirTestCasei�c�(�[U[5US9$)z2Make a RemotebzrDir using 'client' as the _client.r)r%r&)r>rr!s   r@�make_remote_bzrdir�'RemoteBzrDirTestCase.make_remote_bzrdir�s���I�'9�';�V�L�LrBr�N)r�r�r�r�r�r�r�rBr@r~r~�s��MrBr~c� �\rSrSrSrSrSrg)�RemoteBranchTestCasei�c��SUlSUlSUlSUlSURlSURlSURlg)z0Trick a RemoteBranch into thinking it is locked.�wr�branch token�
repo tokenN)�
_lock_mode�_lock_count�_lock_token�_repo_lock_tokenr	r�s  r@�lock_remote_branch�'RemoteBranchTestCase.lock_remote_branch�sL��������,���"/���'*����$�()����%�(5����%rBc��URUS5n[USUS9nUR5n[UR	5S9n[X4X&S9$)z�Make a RemoteBranch using 'client' as its _SmartClient.

A RemoteBzrDir and RemoteRepository will also be created to fill out
the RemoteBranch, albeit with stub values for some of their attributes.
FNr)r�)rru)r�r'r+r$r�r#)r>rr!rrX�
branch_formatrus       r@�make_remote_branch�'RemoteBranchTestCase.make_remote_branch�sR���(�(��E�:�����f�=���.�.�0�
�#��1K�1K�1M�N���F�&�H�HrBr�N)r�r�r�r�r�r�r�r�rBr@r�r��s
��6�
IrBr�c��\rSrSrSrSrg)�TestBranchBreakLocki�c�<�[5n[UR5nURSSSS5 URSSSS5 UR	S5 URS5nUR
X5nUR"5 URU5 g)	Nr�ryr�r�sBranch.break_lockr�r�rs)	rr�rr�r�ryr��
break_lockr4�r>rr!rs    r@�test_break_lock�#TestBranchBreakLock.test_break_lock�s���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � � �,�
�H�	
�	���� ��O�O�G�,�	��(�(��;���������F�#rBr�N�r�r�r�r�r�r�r�rBr@r�r��s��
$rBr�c� �\rSrSrSrSrSrg)�TestBranchGetPhysicalLockStatusi�c�`�[5n[UR5nURSSSS5 URSSSS5 UR	S5 URS5nUR
X5nUR"5nURU5 URS	U5 g)
Nr�ryr�r��Branch.get_physical_lock_statusr�r�rsT�
rr�rr�r�ryr��get_physical_lock_statusr4r��r>rr!rr�s     r@�!test_get_physical_lock_status_yes�ATestBranchGetPhysicalLockStatus.test_get_physical_lock_status_yes�s���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �.��j�)�	
�	���� ��O�O�G�,�	��(�(��;���0�0�2�����F�#�����v�&rBc�`�[5n[UR5nURSSSS5 URSSSS5 UR	S5 URS5nUR
X5nUR"5nURU5 URS	U5 g)
Nr�ryr�r�r�r�r�rsFr�r�s     r@� test_get_physical_lock_status_no�@TestBranchGetPhysicalLockStatus.test_get_physical_lock_status_nos���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �.��j�(�	
�	���� ��O�O�G�,�	��(�(��;���0�0�2�����F�#������'rBr�N�r�r�r�r�r�r�r�r�rBr@r�r��s��'� (rBr�c�&�\rSrSrSrSrSrSrg)�TestBranchGetParentic�`�[5n[UR5nURSSSS5 URSSSS5 UR	S5 URS5nUR
X5nUR"5nURU5 URSU5 g)	Nr�ryr�r��Branch.get_parentr��rBrs)
rr�rr�r�ryr��
get_parentr4r�r�s     r@�test_no_parent�"TestBranchGetParent.test_no_parents���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �!5�|�Z�QW�X����� ��O�O�G�,�	��(�(��;���"�"�$�����F�#�����v�&rBc�p�[5n[UR5nURSSSS5 URSSSS5 UR	S5 URS5nUR
X5nUR"5nURURS	5RU5 g)
Nr���kwaak/r�r�r�r�)s../foo/�kwaakz../foo)	rr�rr�r�ryr�r�r�r�s     r@�test_parent_relative�(TestBranchGetParent.test_parent_relative-s���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � � �,�
�M�	
�	���� ��O�O�G�,�	��(�(��;���"�"�$���������2�7�7��@rBc�`�[5n[UR5nURSSSS5 URSSSS5 UR	S5 URS5nUR
X5nUR"5nURS	U5 URU5 g)
Nr�r�r�r�r�r�)shttp://foo/r��http://foo/)
rr�rr�r�ryr�r�r�r4r�s     r@�test_parent_absolute�(TestBranchGetParent.test_parent_absolute<s���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � � �,�
�<M�	
�	���� ��O�O�G�,�	��(�(��;���"�"�$�������/����F�#rBr�N)r�r�r�r�r�r�r�r�r�rBr@r�r�s��
'�
A�$rBr�c�&�\rSrSrSrSrSrSrg)�TestBranchSetParentLocationiMc�Z�[5n[UR5nURSSSS5 URSSSS5 UR	S	5 URS	5nUR
X5nS
UlSUlUR"S5 URU5 g)Nr�ryr�r��Branch.set_parent_location)rv�b�rrBr�r�rsr�r��rr�rr�r�ryr�r�r��_set_parent_locationr4r�s    r@r��*TestBranchSetParentLocation.test_no_parentNs���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �)�+G��UW�	
�	���� ��O�O�G�,�	��(�(��;��!���"&����#�#�D�)����F�#rBc�Z�[5n[UR5nURSSSS5 URSSSS5 UR	S	5 URS	5nUR
X5nS
UlSUlUR"S5 URU5 g)
Nr�r�r�r�r�)r�r�r�r�r�r�r�r�r�r�r�r�s    r@�test_parent�'TestBranchSetParentLocation.test_parent`s���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �)�+���		
�	���� ��O�O�G�,�	��(�(��;��!���"&����#�#�E�*����F�#rBc���UR5 URS5nUR5 SnURU5 UR"S5 URSUR5 g)Nr5r�r��)rhrxrirj�
set_parent�assertLengthrl�r>rr�s   r@rp�1TestBranchSetParentLocation.test_backwards_compatts_���-�-�/��!�!�#�&���!�!�#�,�����$�����-�(����"�d�o�o�.rBr�N)r�r�r�r�r�r�rpr�r�rBr@r�r�Ms��$�$$�(/rBr�c� �\rSrSrSrSrSrg)�TestBranchGetTagsBytesi~c�p�UR5 URS5nUR5 SnURU5 URR5 [
URVs/sH o3RRU:XdMUPM" sn5nURSU5 gs snf)Nr5�Branch.get_tags_bytesr�)rhrxrirj�tags�get_tag_dictr�rlr�r�r�)r>rr�r�ros     r@rp�,TestBranchGetTagsBytes.test_backwards_compats����-�-�/��!�!�#�&���!�!�#�'�����$����� � �"��4�?�?�W�?�4�i�i�>N�>N�RV�>V�$�?�W�X�
�����J�'��Xs�2B3�B3c�r�[5n[UR5nURSSSS5 URSSSS5 UR	S5 URS5nUR
X5nURR5nURU5 UR0U5 g)	Nr�ryr�r�r�r�r�rs)rr�rr�r�ryr�r�r�r4r�r�s     r@�test_trivial�#TestBranchGetTagsBytes.test_trivial�s���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �$�l�J��	
�	���� ��O�O�G�,�	��(�(��;�����)�)�+�����F�#�����V�$rBr�N)r�r�r�r�rpr�r�r�rBr@r�r�~s��(�%rBr�c� �\rSrSrSrSrSrg)�TestBranchSetTagsBytesi�c��[5n[UR5nURSSSS5 URSSSS5 UR	S	5 URS	5nUR
X5nURU5 UR"S
5 URU5 URS
URSS5 g)Nr�ryr�r��Branch.set_tags_bytes�rvr�r�r�)r�rs�
tags bytesr�)rr�rr�r�ryr�r��_set_tags_bytesr4r�r�r�s    r@r��#TestBranchSetTagsBytes.test_trivial�s���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �$�7���		
�	���� ��O�O�G�,�	��(�(��;������'����}�-����F�#������
�
�b�(9�"�(=�>rBc���[5n[UR5nURSSSS5 URSSSS5 UR	S	5 URS	5nUR
X5nURU5 "S
S5nU"5nXSlUR"S5 UR"S5 URU5 URS
/S-UR5 g)Nr�ryr�r�r�r�r�)r�rsc� �\rSrSrSrSrSrg)�HTestBranchSetTagsBytes.test_backwards_compatible.<locals>.StubRealBranchi�c��/UlgrD�rr�s r@r��QTestBranchSetTagsBytes.test_backwards_compatible.<locals>.StubRealBranch.__init__��	����
rBc�>�URRSU45 g)N�set_tags_bytes�rr�)r>r�s  r@r��XTestBranchSetTagsBytes.test_backwards_compatible.<locals>.StubRealBranch._set_tags_bytes�s���
�
�!�!�#3�U�";�<rBr�N)r�r�r�r�r�r�r�r�rBr@�StubRealBranchr��s��
 �
=rBr�r�)r�r�r)
rr�rr�r�ryr�r��_real_branchr�r4r�r�r>rr!rr��real_branchs      r@�test_backwards_compatible�0TestBranchSetTagsBytes.test_backwards_compatible�s���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �$�7��'�		
�	���� ��O�O�G�,�	��(�(��;������'�	=�	=�%�&��)�����}�-�	���}�-����F�#����;�<�q�@�+�BS�BS�TrBr�N)r�r�r�r�r�r�r�r�rBr@r�r��s
��?�(UrBr�c�8�\rSrSrSrSrSrSrSrSr	Sr
g	)
�TestBranchHeadsToFetchi�c��[5n[UR5nURSSSS5 URSSSS5 URSSSS	S
5 UR	S5 URS5nUR
X5nUR"5nURU5 URS1[54U5 g)
Nr�ryr�r��Branch.last_revision_infor��r��1�rev-tip�Branch.get_config_filer�rBrsr�)rr�rr�r�ryr��heads_to_fetchr4r�r�r�s     r@�0test_uses_last_revision_info_and_tags_by_default�GTestBranchHeadsToFetch.test_uses_last_revision_info_and_tags_by_default�s���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �(���%�		
�	� � �%�|�Z��3�	
�	���� ��O�O�G�,�	��(�(��;���&�&�(�����F�#����:�,���.��7rBc��[5n[UR5nURSSSS5 URSSSS5 URSSSS	S
5 URSSSS5 UR	S
5 URS
5nUR
X5nUR"5nURU5 URS1SS14U5 g)Nr�ryr�r�r�r�r�r�r�sbranch.fetch_tags = Truer�)s"d5:tag-17:rev-foo5:tag-27:rev-barersr��rev-foosrev-bar)
rr�rr�r�ryr�r�r4r�r�s     r@�.test_uses_last_revision_info_and_tags_when_set�ETestBranchHeadsToFetch.test_uses_last_revision_info_and_tags_when_set�s���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �(���%�		
�	� � �%����'�	
�	� � �$���4�		
�	���� ��O�O�G�,�	��(�(��;���&�&�(�����F�#����:�,��Z�(@�A�6�JrBc��[5n[UR5nURSSSS5 URSSSS/SS	/45 UR	S
5 URS
5nUR
X5nSURlUR"5nURU5 URS1SS	14U5 g)Nr�ryr�r��Branch.heads_to_fetchr��tipstagged-1stagged-2rsc��gr�r�r�rBr@�<lambda>�bTestBranchHeadsToFetch.test_uses_rpc_for_formats_with_non_default_heads_to_fetch.<locals>.<lambda>s��5rB)rr�rr�r�ryr�rz�!_use_default_local_heads_to_fetchr�r4r�r�s     r@�9test_uses_rpc_for_formats_with_non_default_heads_to_fetch�PTestBranchHeadsToFetch.test_uses_rpc_for_formats_with_non_default_heads_to_fetch
s���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �$����X��[�1�2�		
�	���� ��O�O�G�,�	��(�(��;��;H����8��&�&�(�����F�#����6�(�[�+�$>�?��HrBc�<�UR5 URS5nUR5 URSS/SS9 UR	5 UR5nURRSS5 URRSS5 U$)	Nr���add)r�sroot-id�	directoryr�r���revision_idztag-1�rev-1ztag-2�rev-2)rh�make_branch_builder�start_series�build_snapshot�
finish_series�
get_branchr��set_tag)r>�builderrs   r@�make_branch_with_tags�,TestBranchHeadsToFetch.make_branch_with_tagss����-�-�/��*�*�5�1����������=�>�F�	�	
�	�����#�#�%�������G�X�.������G�X�.��
rBc���UR5nUR5RSS5 URUR	5R
5 SnUR
U5 UR5 UR5nURS1SS14U5 URSS/URVs/sHoDRRPM sn5 gs snf)	N�branch.fetch_tagsTr�r�rr
r�r��
rr�r�r;�	lock_read�unlockrjrir�r�rlr�r��r>�brr�r�r�s     r@r��0TestBranchHeadsToFetch.test_backwards_compatible-s���
�
'�
'�
)��
����!�!�"5�t�<��������-�-�.�'�����$���!�!�#��"�"�$�����6�(�X�x�$8�9�6�B����
)�+C�D�*.�/�/�:�/�$�Y�Y�
�
�/�:�	
��:s�C'
c���UR5nUR5RSS5 URUR	5R
5 SnUR
U5 UR5 UR5nURS1[54U5 URS/URVs/sHoDRRPM sn5 gs snf)NrFr�r�r�rrs     r@�!test_backwards_compatible_no_tags�8TestBranchHeadsToFetch.test_backwards_compatible_no_tags<s���
�
'�
'�
)��
����!�!�"5�u�=��������-�-�.�'�����$���!�!�#��"�"�$�����6�(�C�E�*�F�3����
)�*�*.�/�/�:�/�$�Y�Y�
�
�/�:�	
��:s�C,
r�N)r�r�r�r�r�r�rrr�r r�r�rBr@r�r��s#��8�, K�DI�(
�

�

rBr�c� �\rSrSrSrSrSrg)�TestBranchLastRevisionInfoiLc�l�[5n[UR5nURSSSS5 URSSSS5 UR	S5 URS5nUR
X5nUR"5nURU5 URS	[4U5 g)
Nr�ryr�r�r�r��r�r:�null:rsr)rr�rr�r�ryr��last_revision_infor4r�rr�s     r@�test_empty_branch�,TestBranchLastRevisionInfo.test_empty_branchMs���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �(���#�		
�	���� ��O�O�G�,�	��(�(��;���*�*�,�����F�#����!�]�+�V�4rBc�h�SR5n[5n[UR5nUR	SSSS5 UR	SSSSS	U45 URS
5 UR
S
5nURX#5nUR"5nURSU4U5 g)N�Èr�r�r�r�r�r�r��2r�r)
rSrr�rr�r�ryr�r'r�)r>rYrr!rr�s      r@�test_non_empty_branch�0TestBranchLastRevisionInfo.test_non_empty_branchas����
�
���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �(�,�
�U�D�RW�DX�	
�	���� ��O�O�G�,�	��(�(��;���*�*�,�����!�U��V�,rBr�N)r�r�r�r�r(r-r�r�rBr@r#r#Ls��5�(-rBr#c�*�\rSrSrSrSrSrSrSrg)�TestBranch_get_stacked_on_urlisz$Test Branch._get_stacked_on_url rpc.c	�d�URSSS9nURSSS9 URS5nURU5 URRn[UR5nURSSSSURS	545 URSSSSURS	545 [U[5US
9n[R"5nURRUl[!U[#XV5US
9nUR$"5nUR'X(5 g)N�stackedrwrtrr��sstacked/r�r�rr)rx�get_vfs_only_url�set_stacked_on_urlr�root_transportr�rr�rSr%r&rr(r	rz�_custom_formatr#r'�get_stacked_on_urlr�)	r>�stacked_branch�vfs_urlrr!r�repo_fmtrr�s	         r@�test_get_stacked_on_invalid_url�=TestBranch_get_stacked_on_url.test_get_stacked_on_invalid_urlvs&���)�)�)�E�)�B��������.��'�'��/���)�)�'�2�"�-�-�<�<�	��I�N�N�+��� � �(���
�G�N�N�7�+�,�		
�	� � �(���
�G�N�N�7�+�,�		
��i�);�)=�v�N���0�0�2��"0�";�";�"C�"C�����$�V�6��
���*�*�,������)rBc�f�URSSS9 URSSS9nURS5 [UR55nUR	5R5nUR
SSSS	U45 UR
S
SSSSS
S
SURRR545 UR
SSSS5 UR
SSSS5 [URS5[5US9nUR"5nUR"5nURSU5 URU5 URS[!URR"55 URS[!URR$R"55 g)Nrz1.6rtr2�../baserxr3r�r�r�r�rBr�rr�r�)r�rr�)rxr5r�rzr+r�r�r	rzr%r8r&rKr8r�r4r��_fallback_repositories�_real_repository)r>r9r!r�rrr�s       r@r��7TestBranch_get_stacked_on_url.test_backwards_compatible�s���������.��)�)�)�E�)�B���)�)�)�4��D�L�L�N�+��"�4�4�6�C�C�E��� � �#���
�+�,�		
�	� � �'���������)�)�1�1�>�>�@�

�		
�	� � �(���+�		
�	� � �(���+�		
�����y�)�+=�+?��
���#�#�%���*�*�,������F�+����F�#�	
����C�� 1� 1� H� H�I�J����
�s�6�$�$�5�5�L�L�M�	
rBc�@�URS5 URS5nURS5 UR5nUR5n[	UR55nUR
5R5nURSSSSU45 URSSSS	S
SSSU45 URS
SSS5 URS
SSS5 [URS5[5US9nUR"5nUR"5nURSU5 URU5 URS[UR R"55 URSUR R$5 g)Nrr2r?rxr3r�r�r�r�rBrr�r�)r�s../baserr�)rxr5r1r�r�rzr+r�r%r8r&rKr8r�r4r�r	r@rA)	r>r9r�r�r!r�rrr�s	         r@�test_get_stacked_on_real_branch�=TestBranch_get_stacked_on_url.test_get_stacked_on_real_branch�s������� ��)�)�)�4���)�)�)�4��/�/�1��'�4�4�6���D�L�L�N�+��"�4�4�6�C�C�E��� � �#���
�+�,�		
�	� � �'���
�C�����=�		
�	� � �(����		
�	� � �(����		
�����y�)�+=�+?��
���#�#�%���*�*�,������F�+����F�#�����C�� 1� 1� H� H�I�J�����v�0�0�A�A�BrBr�N)	r�r�r�r�r�r<r�rDr�r�rBr@r0r0ss��.�!*�F5
�n+CrBr0c�,�\rSrSrSrSrSrSrSrg)�TestBranchSetLastRevisioni�c�&�[5nURS5 URS5n[UR5nURSSSS5 URSSSS	5 URS
SSS5 URSS
SS5 URSSSS5 UR
X5nUR"5 UR"[5nUR"5 URSU5 URU5 g)Nrr���branch/r�r��Branch.lock_write�rJrBrBr��r�r�r�r�r%�Branch.set_last_revision)rJr�r�r&r��
Branch.unlock�rJr�r�)
rr�ryr�rr�r��
lock_write�_set_last_revisionrrr�r4r�s     r@�test_set_empty�(TestBranchSetLastRevision.test_set_empty�s��$�%�	�����!��O�O�H�-�	��I�N�N�+��� � �(�-��CS�	
�	� � � �"��3�		
�	� � �(���#�		
�	� � �'�
�
��
	
�	� � ��8���		
��(�(��;�������*�*�=�9���
�
������v�&����F�#rBc��[5nURS5 URS5n[UR5nURSSSS5 URSSSS	5 URS
SSS5 S/n[R"S
RU55nURUS5 URSSSS5 URSSSS5 URX5nUR"5 UR"S5nUR"5 URSU5 URU5 g)Nrr�rIr�r�rKrLr�rMr�r%�rev-id2�
r�rN)rJr�r�rVr�rOrP)rr�ryr�rr��bz2�compress�joinr�r�rQrRrr�r4)r>rr!�lines�encoded_bodyrr�s       r@�test_set_nonempty�+TestBranchSetLastRevision.test_set_nonempty.sC��$�%�	�����!��O�O�H�-�	��I�N�N�+��� � �(�-��CS�	
�	� � � �"��3�		
�	� � �(���#�		
�����|�|�E�J�J�u�$5�6���-�-�l�E�B�� � �'�
�
��
	
�	� � ��8���		
��(�(��;�������*�*�:�6���
�
������v�&����F�#rBc��[5nURS5 URS5n[UR5nURSSSS5 URSSSS	5 URS
SSS5 S/n[R"S
RU55nURUS5 URSSSS5 URSSSS5 URX5nUR"5 UR[RURS5 UR "5 UR#U5 g)Nrr�rIr�r�rKrLr�rMr�r%�rev-idrWr�rN�rJr�r�r`)�NoSuchRevisionr`rOrPr�)rr�ryr�rr�rXrYrZr�r�rQr�r�NoSuchRevisionrRrr4)r>rr!r[r\rs      r@�test_no_such_revision�/TestBranchSetLastRevision.test_no_such_revisionas?��#�%�	�����!��O�O�H�-�	��I�N�N�+��� � �(�-��CS�	
�	� � � �"��3�		
�	� � �(���#�		
�����|�|�E�J�J�u�$5�6���-�-�l�E�B�� � �'�
�
�*�
	
�	� � ��8���		
��(�(��;���������&�/�/��1J�1J�I�V��
�
�����F�#rBc�@�[5nURS5 URS5n[UR5nSnURS5nUR
SSSS5 UR
SS	S
S5 UR
SSS
S
5 S/n[R"SRU55nURUS5 UR
SSSSU45 UR
SSS
S5 URX5nUR"5 UR[RUR S5nUR#UR$[&5 UR)X8R$5 UR*"5 UR-U5 g)�NTipChangeRejected responses cause a TipChangeRejected exception to
be raised.
rurejection message‽�utf8r�rIr�r�rKrLr�rMr�r%r`rWr�rNra�TipChangeRejectedrOrPr�N)rr�ryr�rrSr�rXrYrZr�r�rQr�r�TipChangeRejectedrRrE�msgrkr�rr4)	r>rr!�rejection_msg_unicode�rejection_msg_utf8r[r\rr`s	         r@�test_tip_change_rejected�2TestBranchSetLastRevision.test_tip_change_rejected�s���$�%�	�����!��O�O�H�-�	��I�N�N�+�� B��2�9�9�&�A��� � �(�-��CS�	
�	� � � �"��3�		
�	� � �(���#�		
�����|�|�E�J�J�u�$5�6���-�-�l�E�B�� � �'�
�
�
!�#5�6�
	
�	� � ��8���		
��(�(��;����������$�$�f�&?�&?��
��
	
���c�g�g�s�+����.���8��
�
�����F�#rBr�N)	r�r�r�r�rSr]rdrnr�r�rBr@rGrG�s��-$�^1$�f0$�d9$rBrGc�2�\rSrSrSrSrSrSrSrSr	g)	�TestBranchSetLastRevisionInfoi�c��[5nURS5 URS5n[UR5nURS5 UR
SSS5 UR
SSS5 UR
S5 UR
S5 URX5nUR"5 /Ul	UR"SS	5nURS
S/UR5 URSU5 g)Nrr�r�r�r�r:r&���
a-revision-id)r�r�rI)r��Branch.set_last_revision_info�rJr�r�s1234rt)rr�ryr�rr�r�r�rQr��set_last_revision_infor�r�s     r@�test_set_last_revision_info�9TestBranchSetLastRevisionInfo.test_set_last_revision_info�s���$�%�	�����!��O�O�H�-�	��I�N�N�+���!�!�-�0��#�#�E�?�M�J��#�#�E�4��:��#�#�E�*��#�#�E�*��(�(��;��������
��.�.�t�5E�F�����E�
�

�
�M�M�	
�"	
����v�&rBc���[5nURS5 URS5n[UR5nURS5 UR
SSS5 URSS5 UR
S5 URX5nUR"5 /Ul	UR[RURSS5 UR"5 g)	Nrr�r�r�r�rb�revid�{)rr�ryr�rr�r�r�rQr�r�rrcrwrr�s    r@rd�3TestBranchSetLastRevisionInfo.test_no_such_revision�s���#�%�	�����!��O�O�H�-�	��I�N�N�+���!�!�-�0��#�#�E�?�M�J��!�!�"3�X�>��#�#�E�*��(�(��;��������
�����!�!�6�#@�#@�#�x�	
�	�
�
�rBc���[5nURS5 URS5n[UR5nURSSSS5 URSSSS5 URS	S
SS	5 UR
X5n"SS
5nU"5nXSlURU5 UR"SS5 URS/UR5 URU5 g)z�If the server does not support the Branch.set_last_revision_info
verb (which is new in 1.4), then the client falls back to VFS methods.
rr�rIr�r�r�r�r%rurvr�c�&�\rSrSrSrSrSrSrg)�RTestBranchSetLastRevisionInfo.test_backwards_compatibility.<locals>.StubRealBranchi;c��/UlgrDr�r�s r@r��[TestBranchSetLastRevisionInfo.test_backwards_compatibility.<locals>.StubRealBranch.__init__<r�rBc�>�URRSX45 g)Nrwr�)r>�revnors   r@rw�iTestBranchSetLastRevisionInfo.test_backwards_compatibility.<locals>.StubRealBranch.set_last_revision_info?s���
�
�!�!�#;�U�"P�QrBc��grDr�r�s r@�_clear_cached_state�fTestBranchSetLastRevisionInfo.test_backwards_compatibility.<locals>.StubRealBranch._clear_cached_stateBs��rBr�N)r�r�r�r�r�rwr�r�r�rBr@r�r�;s��
 �
R�
rBr�rsrt)rwrsrtN)
rr�ryr�rr�r�r�r�rwr�rr4r�s      r@�test_backwards_compatibility�:TestBranchSetLastRevisionInfo.test_backwards_compatibilitys��$�%�	�����!��O�O�H�-�	��I�N�N�+��� � �(�-��CS�	
�	� � �(���#�		
�	� � �,�
�
�,�	
��(�(��;��	�	�%�&��)������'�	�%�%�d�,<�=����
?�@�+�BS�BS�	
�	
���F�#rBc��[5nURS5 URS5n[UR5nURS5 UR
SSS5 URS5 UR
S5 URX5nUR"5 /Ul	UR[URSS5nURS	UR5 UR"5 g)
Nrr�r�r�r��UnexpectedErrorr|r{)r�)rr�ryr�rr�r�r�rQr�r�r)rwr��error_tupler�r>rr!rr`s     r@�test_unexpected_error�3TestBranchSetLastRevisionInfo.test_unexpected_errorPs���$�%�	�����!��O�O�H�-�	��I�N�N�+���!�!�-�0��#�#�E�?�M�J��!�!�"4�5��#�#�E�*��(�(��;��������
����'��)F�)F��X�
��	
���.����@��
�
�rBc�,�[5nURS5 URS5n[UR5nURS5 UR
SSS5 URSS5 UR
S5 URX5nUR"5 URUR5 /UlUR[RURSS	5nUR!S
UR"5 g)rgrr�r�r�r�risrejection messager|r{zrejection messageN)rr�ryr�rr�r�r�rQr;rr�r�rrjrwr�rkr�s     r@rn�6TestBranchSetLastRevisionInfo.test_tip_change_rejectedls���$�%�	�����!��O�O�H�-�	��I�N�N�+���!�!�-�0��#�#�E�?�M�J��!�!�"6�8L�M��#�#�E�*��(�(��;����������
�
�&���
�����$�$�f�&C�&C�S�(�
��	
���,�c�g�g�6rBr�N)
r�r�r�r�rxrdr�r�rnr�r�rBr@rqrq�s��('�T�2;$�z�87rBrqc�>�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)�TestBranchGetSetConfigi�c��[5nURSSSS5 URSS5 [5nUR	X!5nUR
"5nUR"5 URSS/UR5 g)	Nr���
memory:///r�r��# config file bodyr��r�r�r��r�r�r�)	r�r�r�rr��
get_config�has_explicit_nicknamer�r��r>r!rrrs     r@�test_get_branch_conf�+TestBranchGetSetConfig.test_get_branch_conf�s������� � �(����		
�	�-�-�.C�U�K�#�%�	��(�(��;���"�"�$���$�$�&����H�T�
�
�M�M�	
rBc��[5nURSSSS5 URSS5 [5nUR	X!5nUR
"5nUR
SUR"S55 g)	Nr�r�r�r�sa = 1
b = 2
c = 3
r��2rG)r�r�r�rr�r�r��get_user_optionr�s     r@�test_get_multi_line_branch_conf�6TestBranchGetSetConfig.test_get_multi_line_branch_conf�sy������ � �(����		
�	�-�-�.F��N�#�%�	��(�(��;���"�"�$������f�4�4�S�9�:rBc��[5nURSSSS5 URSSSS5 URS	S
SS5 URSS
SS5 [5nURX!5nUR"5 UR
"5nUR"SS5 UR"5 URU5 g)Nr�r�r�r�rK�r�rBrBr�rM�Branch.set_config_option)r�r�r�r�sbarrBr�rO�r�r�r�r�r��bar�	r�r�rr�rQ�_get_config�
set_optionrr4r�s     r@�test_set_option�&TestBranchGetSetConfig.test_set_option�s������� � �(����		
�	� � � �%��3�		
�	� � �'�P���		
�	� � ��;���		
�$�%�	��(�(��;�������#�#�%�����%��'��
�
�����F�#rBc	��[5nURSSSS5 URSSSS5 S	nURS
SSS
USS4SS5 URSSSS5 [5nURX15nUR"5 UR
"5nUR"SSS.S5 UR"5 URU5 g)Nr�r�r�r�rKr�r�rMsd5:ascii1:a11:unicode ⌚3:‽e�Branch.set_config_option_dictr�r�r�r�rBr�rOr�r��a�‽��asciiuunicode ⌚r�r�)r>r!�encoded_dict_valuerrrs      r@�test_set_option_with_dict�0TestBranchGetSetConfig.test_set_option_with_dict�s������� � �(����		
�	� � � �%��3�		
�R��� � �,����"���

�
��	
�	� � ��;���		
�$�%�	��(�(��;�������#�#�%�����C�>O�P�RW�X��
�
�����F�#rBc��[5nURSSSS5 URSSSS5 URS	S
SS5 URSS
SS5 [5nURX!5nUR"5 UR
"5nUR"SS5 UR"5 URU5 g)Nr�r�r�r�rKr�r�rMr�)r�r�r��Truer�rBr�rOr�r�Tr�r�r�s     r@�test_set_option_with_bool�0TestBranchGetSetConfig.test_set_option_with_bool�s������� � �(����		
�	� � � �%��3�		
�	� � �'�Q���		
�	� � ��;���		
�$�%�	��(�(��;�������#�#�%�����$��&��
�
�����F�#rBc��UR5 URS5nSnURU5 UR"5 UR	UR
5 UR
5 UR"5RSS5 URSUR5 URSUR"5RS55 g)Nr5r��valuer���
rhrxrjrQr;rrir�r�r�rlr��
get_optionr�s   r@� test_backwards_compat_set_option�7TestBranchGetSetConfig.test_backwards_compat_set_option!	s����-�-�/��!�!�#�&��*�����$����������
�
�&��!�!�#�����'�'���8����"�d�o�o�.�����&�"4�"4�"6�"A�"A�&�"I�JrBc���UR5 URS5nSnURU5 UR"5 UR	UR
5 UR
5 UR"5nSSS.nUR"US5 URSUR5 URXAR"5RS55 g)Nr5r�r�r�r�r�r�r�)r>rr�r�
value_dicts     r@�*test_backwards_compat_set_option_with_dict�ATestBranchGetSetConfig.test_backwards_compat_set_option_with_dict-	s����-�-�/��!�!�#�&��/�����$����������
�
�&��!�!�#��#�#�%��"�9J�K�
����*�f�-����"�d�o�o�.�����%7�%7�%9�%D�%D�V�%L�MrBr�N)r�r�r�r�r�r�r�r�r�r�r�r�r�rBr@r�r��s*��
�,;�" $�D($�T $�D
K�NrBr�c� �\rSrSrSrSrSrg)�TestBranchGetPutConfigStorei<	c�@�[5nURSSSS5 URSS5 [5nUR	X!5nUR
"5nUR"S5 UR"S5 URS	S
/UR5 g)Nr�r�r�r�r�r��email�
log_formatr�r�)	r�r�r�rr�r�r�r�r�r�s     r@r��0TestBranchGetPutConfigStore.test_get_branch_conf=	s������� � �(����		
�	�-�-�.C�U�K�#�%�	��(�(��;���(�(�*���
�
�7���
�
�<� ����H�T�
�
�M�M�	
rBc�,�[5nURSSSS5 URSSSS5 URS	SSS
S5 URS	SSS
S5 URSS
SS
5 URSS
SS
5 [5nURX!5nUR"5 UR
"5nUR"SS5 UR"5 URU5 UR/SQUR5 g)Nr�r�r�r�rKr�r�rMr�r�s	# line 1
�Branch.put_config_filer�rOr�zThe Dude <lebowski@example.com>)r�)r�rKr�r�r�)rr�r�s1# line 1
email = The Dude <lebowski@example.com>
)r�rOr�)r�r�rr�rQr�r�rr4r�r�r�s     r@�test_set_branch_conf�0TestBranchGetPutConfigStore.test_set_branch_confT	s+������ � �(����		
�	� � � �%��3�		
�	� � �%�����	
�	� � �%�����	
�	� � �%�;���		
�	� � ��;���		
�$�%�	��(�(��;�������(�(�*���
�
�7�=�>��
�
�����F�#����
�"
�M�M�%	
rBr�N)r�r�r�r�r�r�r�r�rBr@r�r�<	s
��
�.B
rBr�c��\rSrSrSrSrg)�TestBranchLockWritei�	c�n�[5n[UR5nURSSSS5 URSSSS5 UR	S5 URS5nUR
X5nUR[RUR5 URU5 g)	Nr�ryr�r�rK)rvrBrB��UnlockableTransportrs)rr�rr�r�ryr�r�r�UnlockableTransportrQr4r�s    r@�test_lock_write_unlockable�.TestBranchLockWrite.test_lock_write_unlockable�	s���#�%�	��I�N�N�+��� � �(����		
�	� � � �!��%�		
�	���� ��O�O�G�,�	��(�(��;�����&�4�4�f�6G�6G�H����F�#rBr�N)r�r�r�r�r�r�r�rBr@r�r��	s��$rBr�c�,�\rSrSrSrSrSrSrSrg)�TestBranchRevisionIdToRevnoi�	c���[5n[UR5nURSSSS5 URSSSS5 URSS	SS
5 UR	S5 URS5nUR
X5nURSUR"S
55 UR[RURS5 URU5 g)Nr�ryr�r��Branch.revision_id_to_revno�rvr&r��r�r:�rvr��rbr�rsrr&r�)
rr�rr�r�ryr�r��revision_id_to_revnor�rrcr4r�s    r@�test_simple�'TestBranchRevisionIdToRevno.test_simple�	s���#�%�	��I�N�N�+��� � �(����		
�	� � �*�!��
�		
�	� � �*�#��
�		
�	���� ��O�O�G�,�	��(�(��;������F�7�7��A�B�����!�!�6�#>�#>�
�	
�	
���F�#rBc���[5n[UR5nURSSSS5 URSSSS5 URSS	SS
5 UR	S5 URS5nUR
X5nURSUR"S
55 UR[RURS5 URU5 g)Nr�ryr�r�r�r�r�r�r�r�rs�rr&r�)
rr�rr�r�ryr�r��revision_id_to_dotted_revnor�rrcr4r�s    r@�test_dotted�'TestBranchRevisionIdToRevno.test_dotted�	s���#�%�	��I�N�N�+��� � �(����		
�	� � �*�!��
�		
�	� � �*�#��
�		
�	���� ��O�O�G�,�	��(�(��;������v�A�A�(�K�L�����!�!�6�#E�#E�z�	
�	
���F�#rBc���[5n[UR5nURSSSS5 URSSSS5 URSSSS5 UR	S	5 URS	5nUR
X5nUR[RURS
5 UR[RURS
5 URU5 g)Nr�ryr�r�r��rvr{)r��GhostRevisionsHaveNoRevnosMThe reivison {revid} was not found because there was a ghost at {ghost-revid})r�r{sghost-revidrsr{)rr�rr�r�ryr�r�r�GhostRevisionsHaveNoRevnor�r4r�s    r@�test_ghost_revid�,TestBranchRevisionIdToRevno.test_ghost_revid�	s���#�%�	��I�N�N�+��� � �(����		
�	� � �*�!��
�	
	
�	� � �*�!��
�			
�	���� ��O�O�G�,�	��(�(��;������,�,��.�.��	
�
	
����,�,��.�.��	
�
	
���F�#rBc��UR5 URS5nURS5 UR5 UR	SUR
"S55 UR
SUR5 g)Nr5r�r�r&�)rhrxrjrir�r�r�rlr�s  r@�test_dotted_no_smart_verb�5TestBranchRevisionIdToRevno.test_dotted_no_smart_verb(
sh���-�-�/��!�!�#�&�����8�9��!�!�#�����v�A�A�(�K�L����!�T�_�_�-rBr�N)	r�r�r�r�r�r�r�r�r�r�rBr@r�r��	s��"$�H"$�H-$�^.rBr�c�&�\rSrSrSrSrSrSrg)�TestBzrDirGetSetConfigi1
c��[5nURSS5 [5nURX!5nUR"5nURSUR"55 URS/UR5 g)Nsdefault_stack_on = /
r�r)r��BzrDir.get_config_filer�)r�r�rr�r�r��get_default_stack_onr�)r>r!rrrs     r@�test__get_config�'TestBzrDirGetSetConfig.test__get_config2
st������-�-�.G��O�#�%�	��(�(��;���"�"�$������f�9�9�;�<����
Q�R��M�M�	
rBc���UR5 URS5nUR5 UR"5nUR"S5 URSUR5 g)Nr5r�)rhr�rir��set_default_stack_onr�rl)r>rrs   r@�test_set_option_uses_vfs�/TestBzrDirGetSetConfig.test_set_option_uses_vfs>
sZ���-�-�/��%�%�c�*���!�!�#��"�"�$���#�#�C�(����!�T�_�_�-rBc�$�UR5 URS5nSnURU5 UR5 UR	SUR
"5R
S55 URSUR5 g)Nr5r��default_stack_onr�)	rhr�rjrir�r�r�r�rl)r>rr�s   r@� test_backwards_compat_get_option�7TestBzrDirGetSetConfig.test_backwards_compat_get_optionF
sv���-�-�/��%�%�c�*��(�����$���!�!�#�����v�1�1�3�>�>�?Q�R�S����!�T�_�_�-rBr�N)r�r�r�r�r�r�rr�r�rBr@r�r�1
s��

�.�.rBr�c�&�\rSrSrSrSrSrSrg)�TestTransportIsReadonlyiP
c���[5nURS5 [SSUS9nURSUR	55 URS/UR
5 g)Nrr6Fr=T�r��Transport.is_readonlyr��r�r�rr��is_readonlyr�r�s   r@�	test_true�!TestTransportIsReadonly.test_trueQ
sX������#�#�F�+�#�$8��PV�W�	�����y�4�4�6�7����@�A�6�=�=�QrBc���[5nURS5 [SSUS9nURSUR	55 URS/UR
5 g)Nr�r6Fr=rrr�s   r@�
test_false�"TestTransportIsReadonly.test_falseX
sX������#�#�E�*�#�$8��PV�W�	�����	� 5� 5� 7�8����@�A�6�=�=�QrBc���[5nURS5 [SSUS9nURSUR	55 URS/UR
5 g)z�Bzr 0.15 and earlier servers don't recognise the is_readonly verb.

Clients should treat it as a "no" response, because is_readonly is only
advisory anyway (a transport could be read-write, but then the
underlying filesystem could be readonly anyway).
rr6Fr=rN)r�r�rr�r	r�r�s   r@�test_error_from_old_server�2TestTransportIsReadonly.test_error_from_old_server_
s[������*�*�+C�D�#�$8��PV�W�	�����	� 5� 5� 7�8����@�A�6�=�=�QrBr�N)r�r�r�r�r
r
rr�r�rBr@rrP
s��R�R�RrBrc��\rSrSrSrSrg)�TestTransportMkdirim
c��[5nURSSS5 [SSUS9nUR[R
URS5n[R
"SS	5nURXC5 g)
Nr]�remote pathsextrar6Fr=zclient pathz/client pathr_)r�r�rr�rr^r�r�)r>r!r�exc�expected_errors     r@�test_permissiondenied�(TestTransportMkdir.test_permissiondeniedn
sj������!�!�"5�~�x�P�#�$8��PV�W�	����� 7� 7����-�X���0�0���I������-rBr�N)r�r�r�r�rr�r�rBr@rrm
s��.rBrc� �\rSrSrSrSrSrg)�$TestRemoteSSHTransportAuthenticationiw
c�`�[S5nURSUR5S5 g)N�bzr+ssh://example.comr)r�assertIs�_get_credentials)r>r|s  r@�test_defaults_to_none�:TestRemoteSSHTransportAuthentication.test_defaults_to_nonex
s)���6�7���
�
�d�A�.�.�0��3�4rBc���[R"5nUR5RSSSSS.05 UR	5 [S5nUR
SUR5S5 g)Nzbzr+sshtest�sshr�zexample.com)rM�user�hostrr)r�AuthenticationConfigr��update�_saverr�r)r>�confr|s   r@�test_uses_authentication_config�DTestRemoteSSHTransportAuthentication.test_uses_authentication_config|
sj���*�*�,������!�!�
�u�e�]�S�T�	
�	
�
�
���6�7������� 2� 2� 4�Q� 7�8rBr�N)r�r�r�r�r r*r�r�rBr@rrw
s��5�9rBrc��\rSrSrSrSrSrg)�TestRemoteRepositoryi�
aBase for testing RemoteRepository protocol usage.

These tests contain frozen requests and responses.  We want any changes to
what is sent or expected to be require a thoughtful update to these tests
because they might break compatibility with different-versioned servers.
c���[5nURU5 [UR5nUR	U5n[U[
5SS9n[USUS9nXS4$)z�Create the fake client and repository for testing with.

There's no real server here; we just have canned responses sent
back one by one.

:param transport_path: Path below the root of the MemoryTransport
    where the repository will be created.
FrN)rr�r�rryr%r&r')r>�transport_pathrr!rrXs      r@� setup_fake_client_and_repository�5TestRemoteRepository.setup_fake_client_and_repository�
s\��$�%�	�����'��I�N�N�+���O�O�N�3�	��i�);�)=�u�M�����f�=���|�rBr�N)r�r�r�r�r�r0r�r�rBr@r-r-�
s���rBr-c�(�SUR5-$)NzRemote: )�get_format_descriptionrts r@�remoted_descriptionr4�
s����5�5�7�7�7rBc��\rSrSrSrSrg)�TestBranchFormati�
c���[5n[RR5nUR	5UlUR
[U5UR55 grD)	r$rr*�get_defaultr��
_network_namer�r4r3)r>�
remote_format�real_formats   r@�test_get_format_description�,TestBranchFormat.test_get_format_description�
sP��*�,�
��,�,�8�8�:��&1�&>�&>�&@�
�#������,�m�.R�.R�.T�	
rBr�N)r�r�r�r�r<r�r�rBr@r6r6�
���
rBr6c� �\rSrSrSrSrSrg)�TestRepositoryFormati�
c�@�[R"5R5n[5nXlURSUR5 [R"5R5n[5nX4lURSUR5 g)NTF)	r�RepositoryFormat2ar�r(r9r��fast_deltasr�RepositoryFormatKnitPack1)r>�	true_name�true_format�
false_name�false_formats     r@�test_fast_delta�$TestRepositoryFormat.test_fast_delta�
sx��&�9�9�;�H�H�J�	�,�.��$-�!�����{�6�6�7�"�<�<�>�K�K�M�
�-�/��%/�"������ 8� 8�9rBc���[5n[RR5nUR	5UlUR
[U5UR55 grD)	r(r	r*r8r�r9r�r4r3)r>�remote_repo_formatr;s   r@r<�0TestRepositoryFormat.test_get_format_description�
sS��3�5�� �0�0�<�<�>��+6�+C�+C�+E��(������,��5�5�7�	
rBr�N)r�r�r�r�rIr<r�r�rBr@r@r@�
s��:�
rBr@c� �\rSrSrSrSrSrg)�TestRepositoryAllRevisionIdsi�
c���SnURU5up#URSS5 UR/UR55 URS/UR5 g)NrsrBr��r�sRepository.all_revision_idsry)r0r�r��all_revision_idsr��r>r/rXr!s    r@�
test_empty�'TestRepositoryAllRevisionIds.test_empty�
s]�� ���<�<�^�L����-�-�c�5�9�����T�2�2�4�5����
R�S��M�M�	
rBc���SnURU5up#URSS5 UR1Sk[UR	555 URS/UR
5 g)Nrssrev1
rev2
anotherrev
r�>�rev1�rev2�
anotherrevrQ)r0r�r�r�rRr�rSs    r@�test_with_some_content�3TestRepositoryAllRevisionIds.test_with_some_content�
sh�� ���<�<�^�L����-�-�.I�5�Q����-�s�4�3H�3H�3J�/K�	
�	
���
R�S��M�M�	
rBr�N)r�r�r�r�rTrZr�r�rBr@rOrO�
s��
�

rBrOc�&�\rSrSrSrSrSrSrg)�TestRepositoryGatherStatsi�
c���SnURU5up#URSS5 URS5nURS/UR5 URSSS.U5 g)Nrssrevisions: 2
size: 18
r�)r��Repository.gather_stats)rvrBr�r�)�	revisions�size)r0r��gather_statsr�r��r>r/rXr!r�s     r@�test_revid_none�)TestRepositoryGatherStats.test_revid_none�
sr�� ���<�<�^�L����-�-�.I�5�Q��"�"�4�(������
�
�M�M�		
�	
���q�"�5�v�>rBc��SnSnSR5nURU5upEURUS5 URU5nUR	SSSUS44/UR
5 UR	S	S
SSS
.U5 g)NsHfirstrev: 123456.300 3600
latestrev: 654231.400 0
revisions: 2
size: 18
�quickr+r�r�r_�quick/r�rr`�g����$�@i�g����.�#Ar)rarb�firstrev�	latestrev�rSr0r�rcr�r��r>r�r/rYrXr!r�s       r@�test_revid_no_committers�2TestRepositoryGatherStats.test_revid_no_committers�
s���
�	
�!���
�
����<�<�^�L����-�-�d�E�:��"�"�5�)�����*�.���u�-��
�
�M�M�		
�	
�����.�,�	
�
�	
rBc��SnSnSR5nURU5upEURUS5 URUS5nUR	SSSUS	44/UR
5 UR	S
SSS
SS.U5 g)NsXcommitters: 128
firstrev: 123456.300 3600
latestrev: 654231.400 0
revisions: 2
size: 18
�buickr+r�Tr�r_sbuick/rrr`�rjrk)rarb�
committersrlrmrnros       r@�test_revid_with_committers�4TestRepositoryGatherStats.test_revid_with_committerss���
�	
�!���
�
����<�<�^�L����-�-�d�E�:��"�"�5�$�/�����*�.���v�.��
�
�M�M�		
�	
�����!�.�,�
�
�		
rBr�N)r�r�r�r�rerprvr�r�rBr@r]r]�
s��?�$
�B!
rBr]c��\rSrSrSrSrg)�TestRepositoryBreakLocki4c��SnURU5up#URS5 UR5 URS/UR5 g)Nrsr�)r�sRepository.break_lockry)r0r�r�r�r�rSs    r@r��'TestRepositoryBreakLock.test_break_lock5sK�� ���<�<�^�L����#�#�E�*��������
=�>��
�
�	
rBr�Nr�r�rBr@ryry4s��
rBryc��\rSrSrSrSrg)�!TestRepositoryGetSerializerFormati?c���SnURU5up#URSS5 URSUR55 URS/UR5 g)N�hillr��7)r�s-VersionedFileRepository.get_serializer_format)�hill/)r0r�r��get_serializer_formatr�rSs    r@�test_get_serializer_format�<TestRepositoryGetSerializerFormat.test_get_serializer_format@s]�����<�<�^�L����#�#�E�4�0�����t�9�9�;�<����
T�U��M�M�	
rBr�N)r�r�r�r�r�r�r�rBr@r}r}?s��
rBr}c��\rSrSrSrSrg)�TestRepositoryReconcileiKc�J�SnURU5up#SnURSSSS5 URUS5 UR5nUR	SS	/UR
5 UR	S
UR5 UR	SUR5 g)Nrs/garbage_inventories: 2
inconsistent_parents: 3
�Repository.lock_write�r�rBr��r��a tokenr�)r�r�r�)r�sRepository.reconcile)r�r�rr)r0r�r��	reconciler�r��garbage_inventories�inconsistent_parents)r>r/rXr!r��
reconcilers      r@�test_reconcile�&TestRepositoryReconcile.test_reconcileLs������<�<�^�L���C��� � �$�o�z�CV�	
�	�-�-�d�E�:��^�^�%�
����C��
�
�M�M�
	
�	
����J�:�:�;�����J�;�;�<rBr�N)r�r�r�r�r�r�r�rBr@r�r�Ks��=rBr�c� �\rSrSrSrSrSrg)�&TestRepositoryGetRevisionSignatureTextidc���SnURU5up#URSS5 URSURS55 URS/UR5 g)NrssTHETEXTr�r{)r��&Repository.get_revision_signature_textr�)r0r�r��get_signature_textr�rSs    r@�	test_text�0TestRepositoryGetRevisionSignatureText.test_textese�� ���<�<�^�L����-�-�j�%�@�����T�%<�%<�X�%F�G�����
�
�M�M�		
rBc���SnURU5up#URSS5 UR[RUR
S5 UR
S/UR5 g)Nrh�nosuchrevisionr�)r�r�)rir�)r0r�r�rrcr�r�r�rSs    r@�test_no_signature�8TestRepositoryGetRevisionSignatureText.test_no_signaturevsi�� ���<�<�^�L����!�!�"3�Z�@����&�/�/��1H�1H�*�U�����
�
�M�M�		
rBr�N)r�r�r�r�r�r�r�r�rBr@r�r�ds��
�"
rBr�c��\rSrSrSrSrg)�TestRepositoryGetGraphi�c��SnURU5up#UR5nURURU5 g�Nrs)r0�	get_graph�assertNotEqual�_parents_provider)r>r/rXr!�graphs     r@�test_get_graph�%TestRepositoryGetGraph.test_get_graph�s;�� ���<�<�^�L������ �����E�3�3�T�:rBr�N)r�r�r�r�r�r�r�rBr@r�r��s��;rBr�c��\rSrSrSrSrg)�TestRepositoryAddSignatureTexti�c�j�SnURU5up#URSSSS5 URSSSS5 URS	S
SSS5 UR5 UR5 UR	SURSS
55 UR
SURS5 g)Nrsr��rvrBr�r��Repository.start_write_group�rvr��r�)�token1�Repository.add_signature_text�rvr�rWr�r�rW�every bloody emperor)rr�r�r�r�)r0r�rQ�start_write_groupr�add_signature_textr�r�rSs    r@�test_add_signature_text�6TestRepositoryAddSignatureText.test_add_signature_text�s��� ���<�<�^�L���� � �$�&6�
�DW�	
�	� � �+�#��!�		
�	� � �,�7����	
�	
������� ��
�
�d�D�3�3�G�=T�U�V����
�
�M�M�"��	
rBr�N)r�r�r�r�r�r�r�rBr@r�r��s��
rBr�c�J�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
g)
�TestRepositoryGetParentMapi�c��SR5nSR5nSRX!/5U/n[R"SRU55nSnUR	U5upgURUS5 URUS5 UR
5 UR5nURU/5n	URX!40U	5 UR
5 UR5 URU/5n	URU[40U	5 URSSS	S
U4S4/UR5 UR5 UR
5 UR5nURU/5n	URU[40U	5 URSSS	S
U4S4SSS	S
U4S4/UR5 UR5 g)N�ำ�ණ� rWrsr�r�Repository.get_parent_maprv�include-missing:�

0)
rSrZrXrYr0r�rr��get_parent_mapr�rrr�)
r>�r1�r2r[r\r/rXr!r��parentss
          r@�test_get_parent_map_caching�6TestRepositoryGetParentMap.test_get_parent_map_caching�s����_�_�
��
�_�_�
�����B�8�$�b�)���|�|�E�J�J�u�$5�6�� ���<�<�^�L����-�-�l�E�B��-�-�l�E�B�������� ���&�&��t�,�����"�e��g�.��������
��&�&��t�,�����"�}�.�/��9����:�0�� 3�R�8��	�
�
�M�M�
	
�	
���
�������� ���&�&��t�,�����"�}�.�/��9����:�0�� 3�R�8��	�:�0�� 3�R�8��	�

�
�M�M�	
�"	
���
rBc��SnSnURU5up4URS5 URUS5 URURRS55 UR
U/5nURSSSSU4S	4S
S/UR5 URURRS55 URUS0U5 g)
Nrs�revision-idr�r��r�rrrvr�r�r�r��Repository.get_revision_graphr��r&)
r0r�r�rTr�rUr�r�r�rW)r>r/rPrXr!r�s      r@�0test_get_parent_map_reconnects_if_unknown_method�KTestRepositoryGetParentMap.test_get_parent_map_reconnects_if_unknown_method�s��� �����<�<�^�L����*�*�+G�H��-�-�f�e�<�������9�9�&�A�B��%�%�v�h�/�����:�0�� 3�V�<��	�'��

�
�M�M�	
�$	
������8�8��@�A����&�+�.��8rBc��SnSnURU5up4URUS5 URRS5 UR	U/5nURS/UR5 URUS0U5 g)azget_parent_map falls back to get_revision_graph on old servers.  The
results from get_revision_graph are tweaked to match the get_parent_map
API.

Specifically, a {key: ()} result from get_revision_graph means "no
parents" for that key, which in get_parent_map results should be
represented as {key: ('null:',)}.

This is the test for https://bugs.launchpad.net/bzr/+bug/214894
r�rsr�r�r�r�N)r0r�r�r]r�r�r�)r>rPr/rXr!r�s      r@�,test_get_parent_map_fallback_parentless_node�GTestRepositoryGetParentMap.test_get_parent_map_fallback_parentless_node	s��� �� ���<�<�^�L����-�-�f�e�<����1�1�&�9��%�%�v�h�/������
�
�M�M�		
�	
���&�+�.��8rBc��URS5upURS5 UR[RUR
S/5 g)Nr�ssomething unexpected!rt)r0r�r�r�UnexpectedSmartServerResponser��r>rXr!s   r@�'test_get_parent_map_unexpected_response�BTestRepositoryGetParentMap.test_get_parent_map_unexpected_response&sI���<�<�V�D����#�#�$<�=�����0�0����
��	
rBc��UR5 URS5nURU[5 UR	5 URUR5 UR5 UR5nUR0URSS/55 URSUR5 UR5 UR5nUR0URSS/55 URSUR5 UR5 UR5nUR0UR/SQ55 URSUR5 g)Nr��some-missing�
other-missingr�r)r�r�smore-missing)
rhrrEr'rr;rrir�r�r�r�rl)r>rXr�s   r@�0test_get_parent_map_negative_caches_missing_keys�KTestRepositoryGetParentMap.test_get_parent_map_negative_caches_missing_keys/s1���-�-�/��#�#�E�*�����d�$4�5�����������$��!�!�#���� ������U�1�1�?�DT�2U�V�W����!�T�_�_�-��!�!�#���� ������U�1�1�?�DT�2U�V�W����!�T�_�_�-��!�!�#���� ������� � �!U�V�	
�	
���!�T�_�_�-rBc�2�UR[SS5 g)N�no_extra_resultsT)�overrideAttrr-r�s r@�disableExtraResults�.TestRepositoryGetParentMap.disableExtraResultsGs�����;�=O�QU�VrBc��UR5 URS5nUR5 URSS/SS9 UR	5 UR5nURnURU[5 UR5 UR5 URUR5 UR5 UR5nURSS0UR!SS/55 UR0UR!S/55 UR#SUR$5 g)	Nr�rsfirstr
r�r&sanother-keyr)rhrrrrrr	rEr'r�rr;rrir�r�r�r�rl)r>rrrXr�s     r@�%test_null_cached_missing_and_stop_key�@TestRepositoryGetParentMap.test_null_cached_missing_and_stop_keyJs���-�-�/��*�*�5�1����������=�>�H�	�	
�	�����#�#�%��� � �����d�$4�5�� � �"�����������$��!�!�#���� ��
	
���
�{�#�U�%9�%9�8�X�:N�%O�	
�	
����U�1�1�>�2B�C�D�	
���!�T�_�_�-rBc���UR5 URS5nUR5 [R"5nURU5 UR
/5 UR5 URS/SS9 URS5nSSS5 UR5 URUR5 URRnURU[ 5 UR#W/5 UR%5 UR'0UR#S/55 UR)SUR*5 g!,(df   N�=f)Nr�snon-existantT)�allow_leftmost_as_ghostr�r)rh�make_branch_and_memory_treerQr�TreeBuilder�
start_tree�build�finish_tree�set_parent_idsrVrr;rrr	rEr'r�rir�r�rl)r>�treerrPrXs     r@�+test_get_parent_map_gets_ghosts_from_result�FTestRepositoryGetParentMap.test_get_parent_map_gets_ghosts_from_resultls��	
�-�-�/��/�/��6��
�_�_�
�!�-�-�/�G����t�$��M�M�"�����!����� 1�4��P��[�[��_�F�
�	
����������$��{�{�%�%�����d�$4�5����V�H�%��!�!�#�����T�0�0�/�1B�C�D����!�T�_�_�-�!�
�s�A*E�
E*c��SR5nSR5nSRX!/5U/n[R"SRU55nSnUR	U5upgURUS5 UR
5 UR0URU/55 UR/UR5 URX!40URU/55 URU[40URU/55 URSSS	S
U4S4/UR5 UR5 g)
zIRemoteRepository exposes get_cached_parent_map from
_unstacked_provider.
r�r�r�rWrsr�rr�rvr�r�N)
rSrZrXrYr0r�rr��get_cached_parent_mapr�r�rr)r>r�r�r[r\r/rXr!s        r@�"test_exposes_get_cached_parent_map�=TestRepositoryGetParentMap.test_exposes_get_cached_parent_map�s2���_�_�
��
�_�_�
�����B�8�$�b�)���|�|�E�J�J�u�$5�6�� ���<�<�^�L����-�-�l�E�B���������T�7�7���=�>�����V�]�]�+����"�e��d�&9�&9�2�$�&?�@����"�}�.�/��1K�1K�R�D�1Q�R����:�0�� 3�R�8��	�
�
�M�M�
	
�	
���
rBr�N)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rBr@r�r��s2��7�r9�:9�:
�.�0W� .�D.�.rBr�c��\rSrSrSrSrg)�TestGetParentMapAllowsNewi�c�t�[R"5nURU5 URS5 [R
"UR
5S-5nUR"SSS9nUR5 URUR5 URRR5nUR0URS/55 UR!SSS9 URRR5nURSS	0URS/55 g
)z2get_parent_map's results can be updated by commit.rz/branchr�T)�lightweightrWrO�rPr�N)rr��start_serverrxr
rerz�create_checkoutrQr;rrr	r�r�r�rV)r>�smart_serverrr�r�s     r@�test_allows_new_revisions�3TestGetParentMapAllowsNew.test_allows_new_revisions�s���"�=�=�?�����,�'�����"����\�1�1�3�i�?�@���%�%�f�$�?������������$����&�&�0�0�2������U�1�1�7�)�<�=����I�g��.����&�&�0�0�2�����'�;�/��1E�1E�w�i�1P�QrBr�N)r�r�r�r�r�r�r�rBr@r�r��s��RrBr�c� �\rSrSrSrSrSrg)�TestRepositoryGetRevisionsi�c���SnURU5up#URSSS5 UR[RUR
SS/5 UR
S/UR5 g)NrsrBr��10�somerev1sanotherrev2)r�Repository.iter_revisionsryssomerev1
anotherrev2)r0r�r�rrc�
get_revisionsr�r�rSs    r@�test_hpss_missing_revision�5TestRepositoryGetRevisions.test_hpss_missing_revision�st�� ���<�<�^�L����-�-�c�5�%�@�����!�!�4�#5�#5��^�7T�	
�	
����
�
�M�M�
	
rBc��SnURU5up#[S5nSUlSUlSUlSUlSUl[R"SR[R"U555nURUSS	US	S/S
S5 URS/5nURXd/5 URS/UR5 g)
Nrsr�zJoe Committer <joe@example.com>i?��Ni���s(691b39be74c67b1212a75fcb19c433aaed903c2b�MessagerB�
r�r�)rrryr�)r0r�	committer�	timestamp�timezone�inventory_sha1rO�zlibrYrZr"�write_revision_to_linesr�rr�r�)r>r/rXr!�somerev1r��revss       r@�test_hpss_get_single_revision�8TestRepositoryGetRevisions.test_hpss_get_single_revision�s��� ���<�<�^�L����K�(��>���'������"M���$����}�}��H�H�+�C�C�H�M�N�
��
	�-�-�t�C�R�y�$�r�s�)�.D�e�U�S��!�!�;�-�0������z�*�����
�
�M�M�
	
rBr�N)r�r�r�r�rrr�r�rBr@r�r��s��
�&
rBr�c�2�\rSrSrSrSrSrSrSrSr	g)	�TestRepositoryGetRevisionGraphi�c���SnURU5up#URS5 UR[5nUR	/UR
5 UR	0U5 g)N�emptysnotused)r0r��_get_revision_graphrr�r�rds     r@�test_null_revision�1TestRepositoryGetRevisionGraph.test_null_revision�s_��!���<�<�^�L����#�#�J�/��)�)�-�8������V�]�]�+�����V�$rBc�d�SR5nSR5nSRX!/5U/nSRU5nSnURU5upgURUS5 UR	S5nURS/UR5 URUSX!40U5 g)	Nr�r�r�rW�sinhalar�)r�r�)�sinhala/rBr��rSrZr0r�rr�r�)	r>r�r�r[r\r/rXr!r�s	         r@�test_none_revision�1TestRepositoryGetRevisionGraph.test_none_revision�s���
�_�_�
��
�_�_�
�����B�8�$�b�)���z�z�%�(��"���<�<�^�L����-�-�l�E�B��)�)�$�/������
�
�M�M�		
�	
���"�b�"�e�,�f�5rBc	��SR5nSR5nSR5nSRX1U/5X/nSRU5nSnURU5upxURUS5 UR	U5n	URSS	S
U44/UR5 URUSUSX1U40U	5 g)Nr��Ér�r�rWrr�r�r�rr�r)
r>�r11�r12r�r[r\r/rXr!r�s
          r@�test_specific_revision�5TestRepositoryGetRevisionGraph.test_specific_revision

s����o�o����m�m�o��
�_�_�
�����B�S�>�*�C�5���z�z�%�(��"���<�<�^�L����-�-�l�E�B��)�)�"�-�����*�4� �"�%��
�
�M�M�		
�	
����R��R��#�J�
�

�
	
rBc���SnSnURU5up4URSU5 UR[RUR
U5 UR
SSSU44/UR5 g)Ns123rr�r�r�r)r0r�r�rrcrr�r�)r>rYr/rXr!s     r@rd�4TestRepositoryGetRevisionGraph.test_no_such_revision-
s~����"���<�<�^�L����!�!�"3�U�;����&�/�/��1I�1I�5�Q����*�4� �%�(��
�
�M�M�		
rBc���SnSnURU5up4URS5 UR[URU5nURSUR5 g)N�123r�AnUnexpectedError)r()r0r�r�r)rr�r�)r>rYr/rXr!r�s      r@r��4TestRepositoryGetRevisionGraph.test_unexpected_error?
sa����"���<�<�^�L����!�!�"6�7����'��)A�)A�5�
��	
���0�!�-�-�@rBr�N)
r�r�r�r�rrr"rdr�r�r�rBr@rr�s��
%�6�2
�@
�$ArBrc�>�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)�TestRepositoryGetRevIdForRevnoiJ
c��URS5upURSSSS5 URSS5nURSU5 UR	U5 g)	Nrs�Repository.get_rev_id_for_revno�rvr\��*r�r�)r��rev-fiver\r/)Tr1�r0r��get_rev_id_for_revnor�r4�r>rXr!r�s    r@�test_ok�&TestRepositoryGetRevIdForRevno.test_okK
sb���<�<�W�E���� � �.�,�� �		
��*�*�1�.>�?�����,�f�5����F�#rBc��URS5upURSSSS5 URSS5nURSU5 UR	U5 g)	Nrsr-r.r�)�history-incompleter�rev-tenr\r/)F)rr9r2r4s    r@�test_history_incomplete�6TestRepositoryGetRevIdForRevno.test_history_incompleteW
sb���<�<�W�E���� � �.�,��3�		
��*�*�1�.>�?�����2�F�;����F�#rBc��[R"SSSUR5R545nUR	S5up#XlUR	S5upEX4lXlURU5 URSSSS5 URSS	SS
5 URSS5nURS
U5 URU5 g)zaA 'history-incomplete' response causes the fallback repository to be
queried too, if one is set.
rr�rs�fallbackr-)rvr�r/r�)r8r�rev-two)s	fallback/r�)rr>)r��rev-oner�r/)Tr?N)r�response_tuple_to_repo_formatr1r�r0rzr�add_fallback_repositoryr�r3r�r4)r>rurXr!�
fallback_repo�ignoredr�s       r@�%test_history_incomplete_with_fallback�DTestRepositoryGetRevIdForRevno.test_history_incomplete_with_fallbackc
s���
�5�5�
�U�F�D�$8�$8�$:�$G�$G�$I�J�
���<�<�W�E�����!%�!F�!F�z�!R��
� &�� &���$�$�]�3�� � �.�,��2�		
�	� � �.�.���		
��*�*�1�.>�?�����+�V�4����F�#rBc���URS5upURSSSS5 UR[RUR
SS5 UR
U5 g)Nrsr-r.r�)r�r�r\r/)r0r�r�rrcr3r4r�s   r@�test_nosuchrevision�2TestRepositoryGetRevIdForRevno.test_nosuchrevision�
sf���<�<�W�E���� � �.�,��+�		
�	
����!�!�4�#<�#<�a�AQ�	
�	
���F�#rBc���URS5upURSSSS5 UR[RUR
SS5 UR
U5 g)Nrsr-�rv�+r/r�)�revno-outofboundsrKrr0rKr/�r0r�r�r�RevnoOutOfBoundsr3r4r�s   r@�test_outofbounds�/TestRepositoryGetRevIdForRevno.test_outofbounds�
sd���<�<�W�E���� � �.�-��-�		
�	
����#�#�T�%>�%>��DT�	
�	
���F�#rBc���URS5upURSSSS5 UR[RUR
SS5 UR
U5 g)Nrsr-rJr�)r�s
ValueErrors9requested revno (43) is later than given known revno (42)rKr/rMr�s   r@�test_outofbounds_old�3TestRepositoryGetRevIdForRevno.test_outofbounds_old�
sf���<�<�W�E���� � �.�-��
�			
�	
����#�#�T�%>�%>��DT�	
�	
���F�#rBc�f�UR5 URS5nUR5 URS5 UR	S5nUR	S5 UR5 URnURUR"55 UR5 SnURU5 URX#R"S55 URSURVs/sH oURR U:XdMUPM" sn5 gs snf)z�RemoteBranch.get_rev_id takes a read lock, and tries to call the
get_rev_id_for_revno verb.  If the verb is unknown the VFS fallback
will be invoked, which will fail if the repo is unlocked.
r5r��First�Secondr-r�N)rhr�rQrrVrrrT�	is_lockedrirjr��
get_rev_idr�rlr�r�)r>r��rev1rr�r�s      r@�test_branch_fallback_locking�;TestRepositoryGetRevIdForRevno.test_branch_fallback_locking�
s���
	
�-�-�/��/�/��4������������{�{�7�#�����H�����
���������)�)�+�,��!�!�#�1�����$������0�0��3�4����
����M���I�I�4D�4D��4L���M�	
��Ms�?D.
� D.
r�N)r�r�r�r�r5r:rDrGrOrRrZr�r�rBr@r+r+J
s&��
$�
$�$�B
$�$�$�$
rBr+c� �\rSrSrSrSrSrg)�'TestRepositoryHasSignatureForRevisionIdi�
c���SnURU5up#URS5 URS5nURS/UR5 URSU5 g)Nrsr�A)r��(Repository.has_signature_for_revision_id)rvr_T�r0r��has_signature_for_revision_idr�r�rds     r@�"test_has_signature_for_revision_id�JTestRepositoryHasSignatureForRevisionId.test_has_signature_for_revision_id�
sd�� ���<�<�^�L����#�#�F�+��3�3�D�9�����
U�V��M�M�	
�	
����v�&rBc���SnURU5up#URS5 URS5nURS/UR5 URSU5 g)N�qwackr�r_)r�r`)�qwack/r_Frards     r@�test_is_not_shared�:TestRepositoryHasSignatureForRevisionId.test_is_not_shared�
sd�� ���<�<�^�L����#�#�E�*��3�3�D�9�����
U�V��M�M�	
�	
�����'rBr�N)r�r�r�r�rcrhr�r�rBr@r]r]�
s��
'�
(rBr]c� �\rSrSrSrSrSrg)� TestRepositoryPhysicalLockStatusi�
c���SnURU5up#URS5 UR5nURS/UR5 URSU5 g)Nrfr�r�s#Repository.get_physical_lock_status�rgT�r0r�r�r�r�rds     r@r��BTestRepositoryPhysicalLockStatus.test_get_physical_lock_status_yes�
sb�� ���<�<�^�L����#�#�F�+��.�.�0�����
K�L��M�M�	
�	
����v�&rBc���SnURU5up#URS5 UR5nURS/UR5 URSU5 g)Nrfr�rmFrords     r@r��ATestRepositoryPhysicalLockStatus.test_get_physical_lock_status_no�
sb�� ���<�<�^�L����#�#�E�*��.�.�0�����
K�L��M�M�	
�	
�����'rBr�Nr�r�rBr@rkrk�
���	'�	(rBrkc� �\rSrSrSrSrSrg)�TestRepositoryIsSharedi�
c���SnURU5up#URS5 UR5nURS/UR5 URSU5 g)Nrsr)r��Repository.is_sharedryT�r0r��	is_sharedr�r�rds     r@�test_is_shared�%TestRepositoryIsShared.test_is_shared�
s_�� ���<�<�^�L����#�#�F�+����!�����
<�=�v�}�}�	
�	
����v�&rBc���SnURU5up#URS5 UR5nURS/UR5 URSU5 g)Nrfr�)r�rwrnFrxrds     r@rh�)TestRepositoryIsShared.test_is_not_shareds_�� ���<�<�^�L����#�#�E�*����!�����
<�=�v�}�}�	
�	
�����'rBr�N)r�r�r�r�rzrhr�r�rBr@ruru�
rsrBruc� �\rSrSrSrSrSrg)�TestRepositoryMakeWorkingTreesic���SnURU5up#URS5 UR5nURS/UR5 URSU5 g)Nrsr)r��Repository.make_working_treesryT�r0r��make_working_treesr�r�rds     r@�test_make_working_trees�6TestRepositoryMakeWorkingTrees.test_make_working_treessa�� ���<�<�^�L����#�#�F�+��(�(�*�����
E�F��
�
�	
�	
����v�&rBc���SnURU5up#URS5 UR5nURS/UR5 URSU5 g)Nrfr�)r�r�rnFr�rds     r@�test_no_working_trees�4TestRepositoryMakeWorkingTrees.test_no_working_treessa�� ���<�<�^�L����#�#�E�*��(�(�*�����
E�F��
�
�	
�	
�����'rBr�N)r�r�r�r�r�r�r�r�rBr@rrrsrBrc�&�\rSrSrSrSrSrSrg)�TestRepositoryLockWritei+c���SnURU5up#URSS5 UR5RnUR	S/UR
5 UR	SU5 g)Nrsr�r��r�r�r�)r0r�rQ�repository_tokenr�r�)r>r/rXr!�tokens     r@�test_lock_write�'TestRepositoryLockWrite.test_lock_write,sg�� ���<�<�^�L����#�#�E�:�6����!�2�2�����
A�B�F�M�M�	
�	
����U�+rBc���SnURU5up#URS5 UR[RUR
5 UR
S/UR5 g)Nrs�LockContentionr�)r0r�r�r�LockContentionrQr�r�rSs    r@�test_lock_write_already_locked�6TestRepositoryLockWrite.test_lock_write_already_locked6s\�� ���<�<�^�L����!�!�"3�4����&�/�/����A����
A�B�F�M�M�	
rBc���SnURU5up#URS5 UR[RUR
5 UR
S/UR5 g)Nrsr�r�)r0r�r�rr�rQr�r�rSs    r@r��2TestRepositoryLockWrite.test_lock_write_unlockable?s\�� ���<�<�^�L����!�!�"8�9����&�4�4�d�o�o�F����
A�B�F�M�M�	
rBr�N)r�r�r�r�r�r�r�r�r�rBr@r�r�+s��,�
�
rBr�c�8�\rSrSrSrSrSrSrSrSr	Sr
g	)
�TestRepositoryWriteGroupsiIc��SnURU5up#URSSSS5 URSSSS5 UR5 UR5 g)	Nrsr�r�r�r�r�r�r�)r0r�rQr�rSs    r@�test_start_write_group�0TestRepositoryWriteGroups.test_start_write_groupJsf�� ���<�<�^�L���� � �$�&6�
�DW�	
�	� � �+�#��!�		
�	
������� rBc�"^^�SnURU5ummUU4SjnUTlTRSSSS5 TRSSS	S
5 TR5 TR	5 URTRSSSS
/5 g)Nrsc�p>�TRRS5 [TR5Tlg�N��_ensure_real�r�r��_StubRealPackRepositoryrA�r!rXs��r@�stub_ensure_real�XTestRepositoryWriteGroups.test_start_write_group_unsuspendable.<locals>.stub_ensure_real_�'����M�M� � �!2�3�$;�F�M�M�$J�D�!rBr�r�r�r�r�r�r�)sUnsuspendableWriteGroup���r��r�)r0r�r�rQr�r�r��r>r/r�r!rXs   @@r@�$test_start_write_group_unsuspendable�>TestRepositoryWriteGroups.test_start_write_group_unsuspendableYs����!���<�<�^�L���f�	K�-���� � �$�&6�
�DW�	
�	� � �+�#��)�		
�	
������� �����M�M�"�#��!2�4J� K�	
rBc��SnURU5up#URSSSS5 URSSSSS	/45 URS
SSS	/4SS
5 UR5 UR5 UR	5 g)Nrsr�r�r�r�r�r�r�r�sRepository.commit_write_grouprvr�r�)r0r�rQr��commit_write_grouprSs    r@�test_commit_write_group�1TestRepositoryWriteGroups.test_commit_write_groupss��� ���<�<�^�L���� � �$�&6�
�DW�	
�	� � �+�#��
�Y�K� �		
�	� � �,�
�
�Y�K�0���		
�	
������� ����!rBc��SnURU5up#URSSSS5 URSSSSS	/45 URS
SSS	/4SS
5 UR5 UR5 UR	S5 g)Nrsr�r�r�r�r�r�r�r�sRepository.abort_write_grouprvr�r�F)r0r�rQr��abort_write_grouprSs    r@�test_abort_write_group�0TestRepositoryWriteGroups.test_abort_write_group�s��� ���<�<�^�L���� � �$�&6�
�DW�	
�	� � �+�#��
�Y�K� �		
�	� � �+�
�
�Y�K�0���		
�	
������� ����u�%rBc�n�SnURU5up#UR/UR55 gr�)r0r��suspend_write_grouprSs    r@�test_suspend_write_group�2TestRepositoryWriteGroups.test_suspend_write_group�s2�� ���<�<�^�L�������T�5�5�7�8rBc���SnURU5up#URSSSS5 URSSSS	/4SS
5 UR5 URS/5 g)Nrsr�r�r�r�sRepository.check_write_grouprvr�r�r��token1)r0r�rQ�resume_write_grouprSs    r@�test_resume_write_group�1TestRepositoryWriteGroups.test_resume_write_group�ss�� ���<�<�^�L���� � �$�&6�
�DW�	
�	� � �+�
�
�Y�K�0���		
�	
��������
�+rBr�N)r�r�r�r�r�r�r�r�r�r�r�r�rBr@r�r�Is ��
!�
�4"�,&�,9�

,rBr�c� �\rSrSrSrSrSrg)�!TestRepositorySetMakeWorkingTreesi�c�^�UR5 URS5nUR5 SnURU5 UR	S5 [URVs/sH o3RRU:XdMUPM" sn5nURSU5 gs snf)Nr5�!Repository.set_make_working_treesTr�)
rhrrirj�set_make_working_treesr�rlr�r�r�)r>rXr�r�ros     r@rp�7TestRepositorySetMakeWorkingTrees.test_backwards_compat�s����-�-�/��#�#�C�(���!�!�#�3�����$���#�#�D�)��4�?�?�W�?�4�i�i�>N�>N�RV�>V�$�?�W�X�
�����J�'��Xs�)B*�
B*c���SnURU5up#URSSSS5 URSSSS5 URS5 URS5 g)	Nrsr�)rvr�r�r�ruTF)r0r�r�rSs    r@�test_current�.TestRepositorySetMakeWorkingTrees.test_current�sm�� ���<�<�^�L���� � �0� ���		
�	� � �0�!���		
�	
�#�#�D�)��#�#�E�*rBr�N)r�r�r�r�rpr�r�r�rBr@r�r��s��(�+rBr�c� �\rSrSrSrSrSrg)�TestRepositoryUnlocki�c���SnURU5up#URSS5 URS5 UR5 UR5 UR	SS/UR
5 g)Nrsr�r�r�)r��Repository.unlockr�)r0r�rQrr�r�rSs    r@�test_unlock� TestRepositoryUnlock.test_unlock�sl�� ���<�<�^�L����#�#�E�:�6��#�#�E�*��������
����D�G�
�
�M�M�	
rBc���SnURU5up#URSS5 URS5 UR5 UR	[
RUR5 g)Nrsr�r��
TokenMismatch)r0r�r�rQr�r�
TokenMismatchrrSs    r@�test_unlock_wrong_token�,TestRepositoryUnlock.test_unlock_wrong_token�s\�� ���<�<�^�L����#�#�E�:�6��!�!�"2�3��������&�.�.����<rBr�N)r�r�r�r�r�r�r�r�rBr@r�r��s��

�=rBr�c��\rSrSrSrSrg)�TestRepositoryHasRevisioni�c��SnURU5up#URSUR[55 UR/UR5 g)NrsT)r0r�rUrr�rSs    r@�	test_none�#TestRepositoryHasRevision.test_none�sL�� ���<�<�^�L���	
����t�0�0��?�@�	
����V�]�]�+rBr�N)r�r�r�r�r�r�r�rBr@r�r��s��	,rBr�c�$�\rSrSrSrSrSrSrg)�TestRepositoryIterFilesBytesi�z Test Repository.iter_file_bytes.c
�4�SnURU5up#URSSSS[SS[R"S5/55 URS	/5H8upEUR
S
U5 UR
SRU5S5 M: g)Nrs�Repository.iter_files_bytesryr�r�sok0rWs<mydatamydatamydatamydatamydatamydatamydatamydatamydatamydata��somefile�somerev�myidr�rB)r0r��iterrrY�iter_files_bytesr�rZ)r>r/rXr!�
identifier�byte_streams      r@�test_single�(TestRepositoryIterFilesBytes.test_single�s��� ���<�<�^�L���� � �*�����*�e�T�]�]�>�%B�C�D�	
�(,�'<�'<�
/�0�(
�#�J�
���W�j�1����S�X�X�k�2�N�C�	(
rBc	���SnURU5up#URSSSS[S/55 UR[R
[URS/55 g)Nrsr�ryr�)sRevisionNotPresentr�r�sabsentsomefilesomerev
r�)r0r�r�r�r�RevisionNotPresentr
r�rSs    r@�test_missing�)TestRepositoryIterFilesBytes.test_missingsm�� ���<�<�^�L���� � �*���<��0�1�2�	
�	
����%�%���!�!�#E�"F�G�	
rBr�N)r�r�r�r�r�r�r�r�r�rBr@r�r��s��*�D� 
rBr�c��\rSrSrSrSrSrg)�TestRepositoryInsertStreamBaseizGBase class for Repository.insert_stream and .insert_stream_1.19
tests.
c��UR5n[RR5nUR	/U/5upVUR/U5 UR[
5U5 URU5 g)z�Insert an empty stream, checking the result.

This checks that there are no resume_tokens or missing_keys, and that
the client is finished.
N)�	_get_sinkr	r*r8�
insert_streamr�r�r4)r>rXr!�sinkra�
resume_tokens�missing_keyss       r@�checkInsertEmptyStream�5TestRepositoryInsertStreamBase.checkInsertEmptyStream"sk���~�~����(�(�4�4�6��&*�&8�&8��S�"�&E�#�
�����]�+�������-����F�#rBr�N)r�r�r�r�r�r�r�r�rBr@r�r�s���$rBr�c�J^�\rSrSrSrU4SjrSrSrSrSr	Sr
S	rU=r$)
�TestRepositoryInsertStreami0z�Tests for using Repository.insert_stream verb when the _1.19 variant is
not available.

This test case is very similar to TestRepositoryInsertStream_1_19.
c�D>�[TU]5 URS5 g)N�Repository.insert_stream_1.19)r6r7rjr=s �r@r7� TestRepositoryInsertStream.setUp7s���
��
�����:�;rBc���SnURU5up#URSSSS5 URSSSS5 URSSSS5 URX#5 g)	Nrsr�r�r��r��Repository.insert_streamr�r��r0r�r�rSs    r@�test_unlocked_repo�-TestRepositoryInsertStream.test_unlocked_repo;sw�� ���<�<�^�L���� � �,���/�		
�	� � �'�)9�:�x�	
�	� � �'�)9�:�x�	
�	
�#�#�D�1rBc��SnURU5up#URSSSS5 URSSSS5 URS	SSS
5 URS	SSS
5 UR5 URX#5 g)Nrsr�r�r��r�rBr�r�r�r�r��r0r�rQr�rSs    r@�#test_locked_repo_with_no_lock_token�>TestRepositoryInsertStream.test_locked_repo_with_no_lock_tokenLs��� ���<�<�^�L���� � �$�&6�
�L�	
�	� � �,���/�		
�	� � �'�)9�:�x�	
�	� � �'�)9�:�x�	
�	
�����#�#�D�1rBc��SnURU5up#URSSSS5 URSSSS	5 URS
SSS5 URS
SSS5 UR5 URX#5 g)Nrsr�r�r�r�r��rvrBr�r�r�sRepository.insert_stream_lockedr�rrSs    r@� test_locked_repo_with_lock_token�;TestRepositoryInsertStream.test_locked_repo_with_lock_tokenas��� ���<�<�^�L���� � �$�&6�
�DW�	
�	� � �,�(��/�		
�	� � �.�(���		
�	� � �.�(���		
�	
�����#�#�D�1rBc�^^�SnURU5up#URSSSS5 URSSSS5 URSSSS5 "S	S
5nU"5m"U4SjS5nU"5UlUR5n[R
R
5nURU5nURX�/5up�S
SS/4SS/4/nURUTR5 URS/U	5 URS/U
5 URU5 g)a'inventory-deltas' substreams cannot be sent to the
Repository.insert_stream verb, because not all servers that implement
that verb will accept them.  So when one is encountered the RemoteSink
immediately stops using that verb and falls back to VFS insert_stream.
rsr�r�r�r�r�r�r�c� �\rSrSrSrSrSrg)�RTestRepositoryInsertStream.test_stream_with_inventory_deltas.<locals>.FakeRealSinki�c��/UlgrD��recordsr�s r@r��[TestRepositoryInsertStream.test_stream_with_inventory_deltas.<locals>.FakeRealSink.__init__�s	��!��rBc��UH;upEURRXEVs/sHofRPM sn45 M= S/S/4$s snf)N�fake tokens�fake missing keys)rr��key)r>r�
src_formatr��substream_kind�	substream�records       r@r��`TestRepositoryInsertStream.test_stream_with_inventory_deltas.<locals>.FakeRealSink.insert_stream�sT��17�-�N��L�L�'�'�'�9�)M�9��*�*�9�)M�N��28�'�'�*>�)?�?�?��*Ns�ArN)r�r�r�r�r�r�r�r�rBr@�FakeRealSinkr	�s
��
"�
@rBrc�.>�\rSrSrU4SjrSrSrSrg)�XTestRepositoryInsertStream.test_stream_with_inventory_deltas.<locals>.FakeRealRepositoryi�c�>�T$rDr�)r>�fake_real_sinks �r@r��bTestRepositoryInsertStream.test_stream_with_inventory_deltas.<locals>.FakeRealRepository._get_sink�s	���%�%rBc��gr�r�r�s r@�is_in_write_group�jTestRepositoryInsertStream.test_stream_with_inventory_deltas.<locals>.FakeRealRepository.is_in_write_group�s��rBc��g)NTr�r�s r@�refresh_data�eTestRepositoryInsertStream.test_stream_with_inventory_deltas.<locals>.FakeRealRepository.refresh_data�s��rBr�N)r�r�r�r�r�rr!r�)rs�r@�FakeRealRepositoryr�s���
&�
�
rBr#�inventory-deltas�rX��rev3�texts�ssome-revs	some-filerrN)r0r�rAr�r	r*r8�make_stream_with_inv_deltasr�r�rr4)
r>r/rXr!rr#r�rarr�r��expected_recordsrs
            @r@�!test_stream_with_inventory_deltas�<TestRepositoryInsertStream.test_stream_with_inventory_deltas|sN���!���<�<�^�L���� � �,���/�		
�	� � �'�)9�:�x�	
�	� � �'�)9�:�x�	
�		@�		@�&���	�	�!3� 4����~�~����(�(�4�4�6���1�1�#�6��&*�&8�&8��b�&I�#�
� �*�j�!9�:�
�2�3�4�
��	
���)�>�+A�+A�B�	
���.�)�=�9����.�/��>����F�#rBc�^^^^�[R"SS9mSTRlUU4SjnUU4SjmU4SjmU"5$)a:Make a simple stream with an inventory delta followed by more
records and more substreams to test that all records and substreams
from that point on are used.

This sends, in order:
   * inventories substream: rev1, rev2, rev3.  rev2 and rev3 are
     inventory-deltas.
   * texts substream: (some-rev, some-file)
rWr
c3�v># �ST"54v� ST"54v� S[R"SSSS5/4v� g7f)N�inventoriesr$r(r)r�scontent)r�FulltextContentFactory)�inventories_substream�inventory_delta_substreams��r@�stream_with_inv_delta�UTestRepositoryInsertStream.make_stream_with_inv_deltas.<locals>.stream_with_inv_delta�sM���� �"7�"9�:�:�%�'@�'B�C�C��!�8�8�3�R��z����
�s�69c3�x># �TRRT5n[R"SSSUSS9v� g7f)N�rWr�T)�chunks_are_lines)�_serializer�write_inventory_to_linesr�ChunkedContentFactory)�chunksra�invs ��r@r2�UTestRepositoryInsertStream.make_stream_with_inv_deltas.<locals>.inventories_substream�s8�����_�_�=�=�c�B�F��5�5��B��f�t��
�s�7:c3�\># �TRSSTRRS5nSUlSSSU4/n[R
"SSS9nUR
SS	U5n[R"S
SSU5v� UR
SSU5n[R"S
SSU5v� g7f)Nr	�newdirs	newdir-idsghostTF)�versioned_root�tree_referencesrWrXr%r7r'r&)	�
make_entry�root�file_id�revisionr�InventoryDeltaSerializer�delta_to_linesrr;)�entry�delta�
serializerr[r=s    �r@r3�YTestRepositoryInsertStream.make_stream_with_inv_deltas.<locals>.inventory_delta_substream�s������N�N��X�s�x�x�'7�'7���E�&�E�N��H�l�E�:�;�E�(�A�A�#�U��J��-�-�g�w��F�E��5�5��Z�$���
��-�-�g�w��F�E��5�5��Z�$���
�s�B)B,)r�	InventoryrDrF)r>rar4r=r2r3s ` @@@r@r*�6TestRepositoryInsertStream.make_stream_with_inv_deltas�s;����!�!�g�6��#�����
	�	�	�*%�&�&rBr�)
r�r�r�r�r�r7r�rrr,r*r�r�r�s@r@r�r�0s,����<�2�"2�*2�6?$�B6'�6'rBr�c�&�\rSrSrSrSrSrSrg)�TestRepositoryInsertStream_1_19i�c��SnURU5up#URSSSS5 URSSSS5 URX#5 g)Nrsr�r�r�r�r�rSs    r@r��2TestRepositoryInsertStream_1_19.test_unlocked_repo�s[�� ���<�<�^�L���� � �,�.>�
�H�	
�	� � �,�.>�
�H�	
�	
�#�#�D�1rBc���SnURU5up#URSSSS5 URSSSS5 URSSSS5 UR5 URX#5 g)Nrsr�r�r�r�r�r�rrSs    r@r�CTestRepositoryInsertStream_1_19.test_locked_repo_with_no_lock_tokens�� ���<�<�^�L���� � �$�&6�
�L�	
�	� � �,�.>�
�H�	
�	� � �,�.>�
�H�	
�	
�����#�#�D�1rBc���SnURU5up#URSSSS5 URSSSS5 URSSSS5 UR5 URX#5 g)	Nrsr�r�r�r�r�rr�rrSs    r@r�@TestRepositoryInsertStream_1_19.test_locked_repo_with_lock_tokens��� ���<�<�^�L���� � �$�&6�
�DW�	
�	� � �,�(���		
�	� � �,�(���		
�	
�����#�#�D�1rBr�N)r�r�r�r�r�rrr�r�rBr@rPrP�s��	2�
2�2rBrPc�>�\rSrSr\R
"S5rSrSrg)�TestRepositoryTarballi'a�QlpoOTFBWSZTWdGkj3wAAWF/k8aQACBIB//A9+8cIX/v33AACEAYABAECEACNzJqsgJJFPTSnk1A3qh6mTQAAAANPUHkagkSTEkaA09QaNAAAGgAAAcwCYCZGAEYmJhMJghpiaYBUkKammSHqNMZQ0NABkNAeo0AGneAevnlwQoGzEzNVzaYxp/1UkxXzA1CQX0BJMZZLcPBrluJir5SQyijWHYZ6ZUtVqqlYDdB2QoCwa9GyWwGYDMAOQYhkpLt/OKFnnlT8E0PmO8+ZNSo2WWqeCzGB5fBXZ3IvV7uNJVE7DYnWj6qwBk5DJDIrQ5OQHHIjkS9KqwG3mc3t+F1+iujb89ufyBNIKCgeZBWrl5cXxbMGoMsc9JuUkg5YsiVcaZJurc6KLi6yKOkgCUOlIlOpOoXyrTJjK8ZgbklReDdwGmFgtdkVsAIslSVCd4AtACSLbyhLHryfb14PKegrVDba+U8OL6KQtzdM5HLjAc8/p6n0lgaWU8skgO7xupPTkyuwheSckejFLK5T4ZOo0Gda9viaIhpD1Qn7JqqlKAJqCQplPKp2nqBWAfwBGaOwVrz3y1T+UZZNismXHsb2Jq18T+VaD9k4P8DqE3g70qVJLurpnDI6VS5oqDDPVbtVjMxMxMg4rzQVipn2Bv1fVNK0iq3Gl0hhnnHKm/egynWQ7QH/F3JFOFCQ0aSPfA=c�d�SnS/nURU5up4URURS5 URS5nUR	X$R
5 UR	URUR
55 UR5 g!UR5 f=f)NrX)r�sRepository.tarball)srepo/sbz2r�rX)r0r��tarball_content�_get_tarballr�r�r��close)r>r/�expected_callsrXr!�tarball_files      r@�test_repository_tarball�-TestRepositoryTarball.test_repository_tarball8s�����
�	
���<�<�^�L����-�-�d�.B�.B�E�J��(�(��/��	!����^�]�]�;����T�1�1�<�3D�3D�3F�G���� ��L��� �s
�AB�B/r�N)	r�r�r�r��base64�	b64decoderZr_r�r�rBr@rXrX's���&�&�	!�
�O�!rBrXc��\rSrSrSrSrSrg)�TestRemoteRepositoryCopyContentiPz1RemoteRepository.copy_content_into optimizations.c��[RUlURS5n[R
R
URS55nURS5n[R"U5nUR5nUR[U[55 UR[U[55 UR!U5 g)N�repo1�repo2)rr�r3rr	�
Repositoryrerzr4r �creater�rT�
isinstancer'rW�copy_content_into)r>�src_repo�dest_url�dest_bzrdir�	dest_repos     r@�!test_copy_content_remote_to_local�ATestRemoteRepositoryCopyContent.test_copy_content_remote_to_localSs��� +� F� F����'�'��0���(�(�-�-�d�l�l�7�.C�D��
�(�(��1���m�m�H�-���1�1�3�	�����I�/?�@�A����
�8�-=�>�?��"�"�9�-rBr*N)r�r�r�r�r�rpr�r�rBr@rdrdPs
��;�
.rBrdc�,�\rSrSrSrSrSrSrSrg)r�icc�0�Xl[U5UlgrD)r�_StubPackCollection�_pack_collection�r>rs  r@r�� _StubRealPackRepository.__init__ds���
� 3�E� :��rBc�:�URRS5 g)Nr�r�r�s r@r��)_StubRealPackRepository.start_write_grouphs���
�
���0�1rBc��gr�r�r�s r@r�)_StubRealPackRepository.is_in_write_groupks��rBc�:�URRS5 g)N�z!pack collection reload_pack_namesr�r�s r@r!�$_StubRealPackRepository.refresh_datans���
�
���@�ArB)rurN)	r�r�r�r�r�r�rr!r�r�rBr@r�r�cs��;�2��BrBr�c� �\rSrSrSrSrSrg)rtirc��XlgrDr�rvs  r@r��_StubPackCollection.__init__ss���
rBc�:�URRS5 g)N�zpack collection autopackr�r�s r@�autopack�_StubPackCollection.autopackvs���
�
���7�8rBr�N)r�r�r�r�r�r�r�r�rBr@rtrtrs���9rBrtc�0�\rSrSrSrSrSrSrSrSr	g)	� TestRemotePackRepositoryAutoPackizz3Tests for RemoteRepository.autopack implementation.c��SnURU5up#URSSSS5 UR5 URU5 g)zvWhen the server returns 'ok' and there's no _real_repository, then
nothing else happens: the autopack method is done.
rs�PackRepository.autopackryr�r�N)r0r�r�r4rSs    r@r5�(TestRemotePackRepositoryAutoPack.test_ok}sK��!���<�<�^�L���� � �&��j�(�	
�	
�
�
�����F�#rBc���SnURU5up#URSSSS5 [UR5UlUR5 UR
SS/UR5 g)	z�When the server returns 'ok' and there is a _real_repository, then
the _real_repository's reload_pack_name's method will be called.
rsr�ryr�r��r�r�ryr}N)r0r�r�r�rAr�r�rSs    r@�test_ok_with_real_repo�7TestRemotePackRepositoryAutoPack.test_ok_with_real_repo�sp��!���<�<�^�L���� � �&��j�(�	
�!8��
�
� F����
�
�����B�6�
�
�M�M�	
rBc��^^�SnURU5ummTRS5 UU4SjnUTlTR5 UR	/SQTR
5 g)zuIf the server does not recognise the PackRepository.autopack verb,
fallback to the real_repository's implementation.
rsr�c�p>�TRRS5 [TR5Tlgr�r�r�s��r@r��WTestRemotePackRepositoryAutoPack.test_backwards_compatibility.<locals>.stub_ensure_real�r�rB)r�r�r�N)r0r�r�r�r�r�r�s   @@r@r��=TestRemotePackRepositoryAutoPack.test_backwards_compatibility�sb���!���<�<�^�L���f��*�*�+E�F�	K�-����
�
�����
�

�M�M�
	
rBc���SnURU5up#URSSSS5 UR[RUR
5nUR
[U5S5 g)z=An out-of-memory condition on the server is reported clearly.rsr�ryr��sMemoryErrorz^remote server out of memN)r0r�r�r�BzrErrorr�rark)r>r/rXr!r`s     r@�test_oom_error_reporting�9TestRemotePackRepositoryAutoPack.test_oom_error_reporting�sb�� ���<�<�^�L���� � �&��h�@Q�	
����������?�����c�#�h�(C�DrBr�N)
r�r�r�r�r�r5r�r�r�r�r�rBr@r�r�zs��=�
$�
�&
�.ErBr�c�$�\rSrSrSrSrSrSrg)�TestErrorTranslationBasei�zABase class for unit tests for breezy.bzr.remote._translate_error.c�X�[R"U5nUR"U40UD6nU$)a0Call _translate_error with an ErrorFromSmartServer built from the
given error_tuple.

:param error_tuple: A tuple of a smart server response, as would be
    passed to an ErrorFromSmartServer.
:kwargs context: context items to call _translate_error with.

:returns: The error raised by _translate_error.
)rr��translateErrorFromSmartServer)r>r��context�server_error�translated_errors     r@�translateTuple�'TestErrorTranslationBase.translateTuple�s0���2�2�;�?���=�=�l�V�g�V���rBc��Ue![Ra<nUR"[R[R
U40UD6nSnAU$SnAff=f)z`Like translateTuple, but takes an already constructed
ErrorFromSmartServer rather than a tuple.
N)rr�r�r�r�_translate_error)r>�error_objectr�r�r�s     r@r��6TestErrorTranslationBase.translateErrorFromSmartServer�sU��	�����*�*�	�#�0�0�����!8�!8�,� �JQ� �� ���		�s��A�1A�Ar�N)r�r�r�r�r�r�r�r�r�rBr@r�r��s��K� �"
 rBr�c��\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrg)�TestErrorTranslationSuccessi�a�Unit tests for breezy.bzr.remote._translate_error.

Given an ErrorFromSmartServer (which has an error tuple from a smart
server) and some context, _translate_error raises more specific errors from
breezy.errors.

This test case covers the cases where _translate_error succeeds in
translating an ErrorFromSmartServer to something better.  See
TestErrorTranslationRobustness for other cases.
c��URS5nSnURSU4US9n[R"X5nUR	XC5 g)Nr�r{rb�r)rxr�rrcr�)r>rrYr�rs     r@�test_NoSuchRevision�/TestErrorTranslationSuccess.test_NoSuchRevision�sW���!�!�"�%�����.�.�
��&�v�/�
�� �.�.�v�=������:rBc��URS5nSnURSU4US9n[R"X5nUR	XC5 g)Nr�r{r�r')rr�rrcr�)r>r	rYr�rs     r@rG�/TestErrorTranslationSuccess.test_nosuchrevision�sW���)�)�"�-�
����.�.�
��&�:�/�
�� �.�.�z�A������:rBc��URS5nURSUS9n[R"URR
S9nUR
X25 g)Nr�)r��r�r��r�r�rr�r6rr��r>rr�rs    r@�
test_nobranch�)TestErrorTranslationSuccess.test_nobranch�sR���%�%�b�)���.�.�~�f�.�M���.�.�F�4I�4I�4N�4N�O������:rBc��URS5nURSUS9n[R"URR
SS9nUR
X25 g)Nr�)r�sextra detailr�zextra detail)r��detailr�r�s    r@�test_nobranch_one_arg�1TestErrorTranslationSuccess.test_nobranch_one_args`���%�%�b�)���.�.�*�6�/�
�� �.�.��&�&�+�+�N�
��	
����:rBc��URS5nURSUS9n[R"U5nUR	X25 g)Nr�)snorepositoryr�)r�r�r�NoRepositoryPresentr�r�s    r@�test_norepository�-TestErrorTranslationSuccess.test_norepository
sG���%�%�b�)���.�.�/A�&�.�Q���3�3�F�;������:rBc�t�URS5n[R"S5nURX!5 g)N)r�z
(remote lock))r�rr�r��r>r�rs   r@�test_LockContention�/TestErrorTranslationSuccess.test_LockContentions2���.�.�/C�D���.�.��?������:rBc��URS5nURSUS9n[R"UR5nURX25 g)Nr�r�r�)r�r�rr�r6r�r�s    r@�test_UnlockableTransport�4TestErrorTranslationSuccess.test_UnlockableTransportsN���%�%�b�)���.�.�/H�QW�.�X���3�3�F�4I�4I�J������:rBc��SnSnURSURS5URS545n[R"X5nUR	XC5 g)Nzstr() of a server lockzstr() of whys
LockFailedr�)r�rSr�
LockFailedr�)r>�lock�whyr�rs     r@�test_LockFailed�+TestErrorTranslationSuccess.test_LockFailedsY��'�����.�.�
�D�K�K��0�#�*�*�W�2E�F�
�� �*�*�4�5������:rBc�x�SnURSUS9n[R"US5nURX25 g)Nza lock token)r�)r�z(remote token))r�rr�r�)r>r�r�rs    r@�test_TokenMismatch�.TestErrorTranslationSuccess.test_TokenMismatch's?�����.�.�/B�%�.�P���-�-�e�5E�F������:rBc��URS5nURS5nURSXS9n[R"X5nUR	XC5 g)Nr�rG)sDiverged)r�other_branch)rxr�r�DivergedBranchesr�)r>rr�r�rs     r@�
test_Diverged�)TestErrorTranslationSuccess.test_Diverged-s]���!�!�#�&���'�'��,���.�.��6�/�
�� �0�0��F������:rBc��URS5nURSUS9n[R"U5nUR	X25 g)Nr�r�r�)rxr�r�
NotStackedr�)r>rr�rs    r@�test_NotStacked�+TestErrorTranslationSuccess.test_NotStacked6sG���!�!�"�%���.�.�/?��.�O���*�*�6�2������:rBc�v�SnURSUS9n[R"U5nURX25 g)N�a path��	ReadErrorr��r�r�	ReadErrorr��r>r�r�rs    r@�test_ReadError_no_args�2TestErrorTranslationSuccess.test_ReadError_no_args<s;�����.�.��T�.�J���)�)�$�/������:rBc��SnURSURS545n[R"U5nUR	X25 g)Nr�r�r�r�rSrr�r�r�s    r@�test_ReadError�*TestErrorTranslationSuccess.test_ReadErrorBsD�����.�.��d�k�k�'�>R�/S�T���)�)�$�/������:rBc�x�URS5n[R"SSS5nURX!5 g)N)sIncompatibleRepositoriessrepo1srepo2sdetails hererfrgzdetails here)r�r�IncompatibleRepositoriesr�r�s   r@�test_IncompatibleRepositories�9TestErrorTranslationSuccess.test_IncompatibleRepositoriesHs?���.�.�N�
�� �8�8��W�n�
��	
����:rBc�v�URS5n[R"SS5nURX!5 g)N)r��revid1�revid2r�r�)r�rr�r�r�s   r@�test_GhostRevisionsHaveNoRevno�:TestErrorTranslationSuccess.test_GhostRevisionsHaveNoRevnoQs8���.�.�@�
�� �9�9�)�Y�O������:rBc�v�SnURSUS9n[R"U5nURX25 g)Nr�)r]r�)r�rr^r�r�s    r@�test_PermissionDenied_no_args�9TestErrorTranslationSuccess.test_PermissionDenied_no_argsXs<�����.�.�/E�D�.�Q���0�0��6������:rBc��SnURSURS545n[R"U5nUR	X25 g)Nr�r]r�r�rSrr^r�r�s    r@�test_PermissionDenied_one_arg�9TestErrorTranslationSuccess.test_PermissionDenied_one_arg^sI�����.�.�
 �$�+�+�g�"6�7�
�� �0�0��6������:rBc��SnSnURSURS54US9n[R"U5nUR	XC5 g)z�Given a choice between a path from the local context and a path on
the wire, _translate_error prefers the path from the local context.
�
local path�remote pathr]rr�Nr�)r>�
local_path�remote_pathr�rs     r@�)test_PermissionDenied_one_arg_and_context�ETestErrorTranslationSuccess.test_PermissionDenied_one_arg_and_contextfsY��"�
�#���.�.�
 �+�"4�"4�W�"=�>�Z�/�
�� �0�0��<������:rBc��SnSnURSURS5URS545n[R"X5nUR	XC5 g)Nr�za string with extra infor]rr�)r>r�r_r�rs     r@�test_PermissionDenied_two_args�:TestErrorTranslationSuccess.test_PermissionDenied_two_argsrsY����*���.�.�
 �$�+�+�g�"6����W�8M�N�
�� �0�0��=������:rBc�v�SnURSUS9n[R"U5nURX25 g)Nr�)r�rr�r�)r>r�r�rs    r@�test_NoSuchFile_context_path�8TestErrorTranslationSuccess.test_NoSuchFile_context_path}sB��!�
��.�.�*��/�
�� �)�)�*�5������:rBc��SnURSURS545n[R"U5nUR	X25 g)Nr�r�rr�)r>r�r�rs    r@�test_NoSuchFile_without_context�;TestErrorTranslationSuccess.test_NoSuchFile_without_context�sK��#���.�.�
�;�-�-�g�6�7�
�� �)�)�+�6������:rBc�t�URS5n[R"S5nURX!5 g)N)s
ReadOnlyErrorzreadonly transport)r�r�TransportNotPossibler�r�s   r@�test_ReadOnlyError�.TestErrorTranslationSuccess.test_ReadOnlyError�s3���.�.�/B�C���4�4�5I�J������:rBc�\�URS5nUR[U5S5 g)Nr�zremote server out of memory)r�rjrk)r>r�s  r@�test_MemoryError�,TestErrorTranslationSuccess.test_MemoryError�s+���.�.�/@�A�����c�"2�3�5R�SrBc��[R"S5nURU5n[U5nUR	X25 g)N)r�slist index out of range�rr�r�r)r��r>r`r�rs    r@�$test_generic_IndexError_no_classname�@TestErrorTranslationSuccess.test_generic_IndexError_no_classname�s<���)�)�*P�Q���=�=�c�B��4�S�9������:rBc��[R"S5nURU5n[U5nUR	X25 g)N)r�sKeyErrorr�r
rs    r@�test_generic_KeyError�1TestErrorTranslationSuccess.test_generic_KeyError�s<���)�)�*G�H���=�=�c�B��4�S�9������:rBc�t�URSSS9n[R"SS5nURX!5 g)N)rLr\rrrUr�r\)rr)r�rrNr�r�s   r@�test_RevnoOutOfBounds�1TestErrorTranslationSuccess.test_RevnoOutOfBounds�s?���.�.�
,�G�/�
�� �0�0��F�;������:rBr�N) r�r�r�r�r�r�rGr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr�r�rBr@r�r��s���	�;�;�;�;�;�;�
;�;�;�;�;�;�;�;�;�;�;�
;�;�;�;�;�
T�;�;�;rBr�c�*�\rSrSrSrSrSrSrSrg)�TestErrorTranslationRobustnessi�aUnit tests for breezy.bzr.remote._translate_error's robustness.

TestErrorTranslationSuccess is for cases where _translate_error can
translate successfully.  This class about how _translate_err behaves when
it fails to translate: it re-raises the original error.
c��Sn[R"U5nURU5n[U5nUR	XC5 g)zqIf the error code from the server is not recognised, the original
ErrorFromSmartServer is propagated unmodified.
)sAn unknown error tupleNr
)r>r�r�r�rs     r@�test_unrecognised_server_error�=TestErrorTranslationRobustness.test_unrecognised_server_error�sB��3���2�2�;�?���=�=�l�K��4�\�B������:rBc��Sn[R"U5nURU5nURX#5 UR	UR5S5 g)z�In case of a bug in the client, or perhaps an unexpected response
from a server, _translate_error returns the original error tuple from
the server and mutters a warning.
)rbr{zMissing key 'branch' in contextN�rr�r�r�rar`�r>r�r�r�s    r@�test_context_missing_a_key�9TestErrorTranslationRobustness.test_context_missing_a_key�sQ��4���2�2�;�?���=�=�l�K������8�	
���d�l�l�n�.O�PrBc��Sn[R"U5nURU5nURX#5 UR	UR5S5 g)z�Some translations (PermissionDenied, ReadError) can determine the
'path' variable from either the wire or the local context.  If neither
has it, then an error is raised.
r�zMissing key 'path' in contextNrrs    r@�test_path_missing�0TestErrorTranslationRobustness.test_path_missing�sQ��
&���2�2�;�?���=�=�l�K������8�	
���d�l�l�n�.M�NrBr�N)	r�r�r�r�r�rrrr�r�rBr@rr�s���;�Q� OrBrc�^�\rSrSrSrSrSrSrSrSr	SS	jr
S
rSrSr
S
rSrSrg)�TestStackingi�zhTests for operations on stacked remote repositories.

The underlying format type must support stacking.
c�`�URSSS9nUR5 URSS/SSS9nUR5 UR	SSS9nURS	5 [R"5nURU5 [R"UR5S
-5nUR5nURnUR5 URSUR 5 UR#UR S[$5 UR'UR)U/55 UR'UR+U55 UR-UR/U5R0S5 UR35 g!UR35 f=f)
Nrrwrt)r)r�Nr	NrOr`r
r2r?z/stackedr�r)rrrrrxr5rr�r�r rerzrKr	rr�r@rEr'rW�
has_revisionsrUr��get_revisionrOr)r>�base_builder�
base_revidr9r��
remote_bzrdir�
remote_branch�remote_repos        r@�test_access_stacked_remote�'TestStacking.test_access_stacked_remote�s��
�/�/��u�/�E���!�!�#�!�0�0��
3�4��!�	1�
�
�	�"�"�$��)�)�)�E�)�B���)�)�)�4�"�=�=�?�����,�'����L�$8�$8�$:�Z�$G�H�
�%�1�1�3�
�#�.�.������
	!�
���a��!C�!C�D��!�!��2�2�1�5�7G�
�

�O�O�K�5�5�z�l�C�D��O�O�K�4�4�Z�@�A����[�5�5�j�A�I�I�9�U���� ��K��� �s
�B+F�F-c���UR5 URSSS9nURSSS9 URRRSSS	9R
5nURRS
5nURS5 [R"URS55nUR5 URUR5 URU4$)z;Get stacked_upon and stacked branches with content in each.�tree1rwrtrYrWr��tree2T�r2�localz local changes make me feel good.)rh�make_branch_and_treerVrr�sproutr�r�r
rerzrr;r)r>r.r/�
local_tree�branch2s     r@�prepare_stacked_remote_branch�*TestStacking.prepare_stacked_remote_branch	s����-�-�/��)�)�'�%�)�@��
���V�G��,����'�'�.�.�w��.�E�V�V�X���\�\�1�1�'�:�
����<�=��+�+�d�l�l�7�3�4������������'��|�|�W�$�$rBc��UR5upURnURS1[UR	S/555 g�NrW)r6r	r�r�r�)r>�_rrXs    r@�test_stacked_get_parent_map�(TestStacking.test_stacked_get_parent_mapsA���6�6�8�	��� � �����'��C��(;�(;�W�I�(F�$G�HrBc��UR5upURRnUR[	5[	URS/555 gr9)r6r	�_unstacked_providerr�r�r�)r>r:r�providers    r@�test_unstacked_get_parent_map�*TestStacking.test_unstacked_get_parent_mapsG���6�6�8�	���$�$�8�8��������H�$;�$;�W�I�$F� G�HrBc��/nUH?up4US:wa
[U5 MUH!nURURS5 M# MA U$)Nrar�)r
r�r)r>rr��kindr�contents      r@�fetch_stream_to_rev_order�&TestStacking.fetch_stream_to_rev_order"sG����%�O�D��{�"��Y��(�G��M�M�'�+�+�b�/�2� )�	 &��
rBNc���[RRU5"5nURnUR	X%R
5 UcURnU"5upgURRU5nUR5n	URR5 URR5n
U
RU	/5VVs/sHup�U[:wdMUPM n
nnU
R5 [R "U	/UR5nUR#5 UR%U5nUR'U5U
4$s snnf)a�Get a list of the revisions in a stream to format format.

:param format: The format of the target.
:param order: the order that target should have requested.
:param branch_factory: A callable to create a trunk and stacked branch
    to fetch from. If none, self.prepare_stacked_remote_branch is used.
:result: The revision ids in the stream, in the order seen,
    the topological order of revisions in the source.
)rr*r�r0r��_fetch_orderr6r	�_get_source�
last_revisionr�r��
iter_ancestryr�reverser�PendingAncestryResultri�
get_streamrE)r>ru�order�branch_factory�unordered_format�target_repository_formatr:r2�source�tipr�r��psr�searchrs                r@�get_ordered_revs�TestStacking.get_ordered_revs,s-��&�5�5�9�9�&�A�C��#3�#E�#E� ����� E� E�F��!�!�?�?�N�#�%�
���#�#�/�/�0H�I���#�#�%�����'�'�)��"�"�,�,�.��!&�!4�!4�c�U�!;�R�!;�g�q�q�M�?Q��!;��R������0�0�#���8J�8J�K���!�!�#��"�"�6�*��
�-�-�f�5�t�;�;��Ss�E�,Ec��URSS5upUR[U5[U55 URSUR5 g)Nrw�	unorderedr�rWr�r�r�rl�r>�rev_ord�
expected_revss   r@�!test_stacked_get_stream_unordered�.TestStacking.test_stacked_get_stream_unorderedLsH��"&�!6�!6�u�k�!J�������]�+�S��\�:�	
���!�T�_�_�-rBc�^�U4SjnTRSSUS9up#TR[U5[U55 TRSTR5 g)Nc�z>�TR5upURRSSS9R5nURRS5nUR
S5 [R"TRS55nUR"5 TRUR5 SU4$)N�tree3Tr0zlocal-tree3zmore local changes are better)
r6rr3r�rr�rVr
rerzrr;r)r:r2r�r4rr>s     �r@�make_stacked_stacked�WTestStacking.test_stacked_on_stacked_get_stream_unordered.<locals>.make_stacked_stackedYs�����;�;�=�J�A��%�%�,�,�W�d�,�C�T�T�V�D����4�4�]�C�J����=�>��[�[����g�!6�7�F������O�O�F�M�M�*���<�rBrwrZ)rPrr[)r>rdr]r^s`   r@�,test_stacked_on_stacked_get_stream_unordered�9TestStacking.test_stacked_on_stacked_get_stream_unorderedVs[���	 �"&�!6�!6��;�/C�"7�"
���	
����]�+�S��\�:�	
���!�T�_�_�-rBc��URSS5upURX!5 URSUR5 g)Nr��topologicalr�)rWr�r�rlr\s   r@�#test_stacked_get_stream_topological�0TestStacking.test_stacked_get_stream_topologicalks=��"&�!6�!6�v�}�!M�������0�	
���"�d�o�o�.rBc�.�[R"S5e)Nz)No groupcompress ordered format available)r
�TestSkippedrWr��reversedr�rlr\s   r@�%test_stacked_get_stream_groupcompress�2TestStacking.test_stacked_get_stream_groupcompressus����� K�L�LrBc�h�UR5 URSSS9nURS5 URR	URS5URRS9nURSSS9nURRURUR55 g)N�trunkz
1.9-rich-rootrt�startr2)�
stacked_onr1)rhr2rVr�create_clone_on_transportr8rrxr	�fetchrJ)r>rrr9r1s    r@�3test_stacked_pull_more_than_stacking_has_bug_360791�@TestStacking.test_stacked_pull_more_than_stacking_has_bug_360791�s���	
�-�-�/��)�)�'�/�)�J��
���W�����?�?����y�)�e�l�l�6G�6G�@�
��� � ��� �A��
������%�%�~�'C�'C�'E�	
rBr�rD)r�r�r�r�r�r+r6r;r@rErWr_rfrjrorwr�r�rBr@r"r"�sB���
%!�N%�I�I��<�@.�.�*/�	.�
rBr"c�F^�\rSrSrU4SjrSrSrSrSrSr	Sr
U=r$)	�TestRemoteBranchEfforti�c�>�[TU]5 [R"5UlURURUR
55 [RRSURS5 /Ulg)Nr�)r6r7rr�r�r��
get_serverr,�hooks�install_named_hook�capture_hpss_callrlr=s �r@r7�TestRemoteBranchEffort.setUp�sa���
��
��(�B�B�D������$�+�+�T�_�_�->�?����-�-�f�d�6L�6L�d�S���rBc�N�URRUR5 grD)rlr�r�)r>�paramss  r@r�(TestRemoteBranchEffort.capture_hpss_call�s�������v�}�}�-rBc��URS5nURS5nURSS9 URR	5S-n[
RRU5R5nURRUR5 /UlURU5 URSUR;5 g)Nr1r�Commit.�rOsBranch.revision_history)rxr�build_commitr�rzrr rerKr	rvrlrkrT�r>r1r�remote_branch_urlr)s     r@�.test_copy_content_into_avoids_revision_history�ETestRemoteBranchEffort.test_copy_content_into_avoids_revision_history�s���� � ��)���*�*�8�4�����Y��/� �-�-�5�5�7�(�B���
�
�*�*�+<�=�I�I�K�
�
�����}�7�7�8�����'�'��.����3�t���F�GrBc���URS5nURS5nURSS9 URR	5S-n[
RRU5R5n/Ul	URRUR[R"UR5S9 URS/UR5 g)Nr1rr�r���
fetch_spec�Repository.get_stream_1.19)rxrr�r�rzrr rerKrlr	rvr�EverythingResultr�r�s     r@�)test_fetch_everything_needs_just_one_call�@TestRemoteBranchEffort.test_fetch_everything_needs_just_one_call�s���� � ��)���*�*�8�4�����Y��/� �-�-�5�5�7�(�B���
�
�*�*�+<�=�I�I�K�
����
������$�$� �1�1�-�2J�2J�K�	�	
�	
���7�8�$�/�/�JrBc���[RnURU5nURU5nUR	XSS9 URURUUSUS9 g)NT)�override_existing)r��info)r+�request_handlersr��get_info�registerr;)r>�	verb_namer�r��	orig_verb�	orig_infos      r@�
override_verb�$TestRemoteBranchEffort.override_verb�sg��"�3�3��$�(�(��3�	�$�-�-�i�8�	��!�!�)�T�!�J�����%�%���"��	�	
rBc�L^�/m"U4SjS[5nURSU5 URS5nURS5nUR	SS9 UR
R
5S-n[RRU5R5n/UlURRUR[R"UR5S9 UR!S	T5 UR#[%UR5S	:�5 g
)z�Can fetch with EverythingResult even with pre 2.4 servers.

Pre-2.4 do not support 'everything' searches with the
Repository.get_stream_1.19 verb.
c�4>^�\rSrSrSrSUU4SjjrSrU=r$)�WTestRemoteBranchEffort.test_fetch_everything_backwards_compat.<locals>.OldGetStreamVerbi�zuA version of the Repository.get_stream_1.19 verb patched to
reject 'everything' searches the way 2.3 and earlier do.
c�>�TRURSS5S5 US:XaS[R"S54$[TU]XUS9$)NrWr�rs
everything)s	BadSearch)�discard_excess)r��splitr+�FailedSmartServerResponser6�recreate_search)r>r	�search_bytesr�r?�verb_logs    ��r@r��gTestRemoteBranchEffort.test_fetch_everything_backwards_compat.<locals>.OldGetStreamVerb.recreate_search�s[������� 2� 2�5�!� <�Q� ?�@��=�0� �'�"C�"C�O�"T�U�U��w�.��^�/��rBr�)F)r�r�r�r�r�r�r�r�)r?r�s@�r@�OldGetStreamVerbr��s���
�
�
rBr�r�r1rr�r�r�r�N)r.r�rxrr�r�rzrr rerKrlr	rvrr�r�rWr�)r>r�r1rr�r)r�s      @r@�&test_fetch_everything_backwards_compat�=TestRemoteBranchEffort.test_fetch_everything_backwards_compat�s������	�B�	�	
���8�:J�K�� � ��)���*�*�8�4�����Y��/� �-�-�5�5�7�(�B���
�
�*�*�+<�=�I�I�K�
����
������$�$� �1�1�-�2J�2J�K�	�	
�
	
���!�X�&�	
����D�O�O�,�q�0�1rB)rlr�)r�r�r�r�r7rr�r�r�r�r�r�r�s@r@rzrz�s(����.�	H�K�
�$2�$2rBrzc�J^�\rSrSrSrU4SjrSrSrSrSr	Sr
S	rU=r$)
�.TestUpdateBoundBranchWithModifiedBoundLocationi�z�Ensure correct handling of bound_location modifications.

This is tested against a smart server as http://pad.lv/786980 was about a
ReadOnlyError (write attempt during a read-only transaction) which can only
happen in this context.
c�L>�[TU]5 [RUlgrD)r6r7rr�r3r=s �r@r7�4TestUpdateBoundBranchWithModifiedBoundLocation.setUp�s���
��
�� +� F� F��rBc�L�URU5UlURRRU5UlURRS5 URRS5UlURRR5Ulg)Nz	add stuffzeven more stuff)	r2�masterrr��checkoutrV�
last_revid�get_bound_location�bound_location)r>�master_name�
checkout_names   r@�make_master_and_checkout�GTestUpdateBoundBranchWithModifiedBoundLocation.make_master_and_checkout�st���/�/��<������*�*�:�:�=�I��
������;�'��+�+�,�,�->�?���"�m�m�2�2�E�E�G��rBc���URRRU5 URR5 UR	UR
URR
55 grD)r�r�set_bound_locationr'r�r�rJ)r>�new_locations  r@�assertUpdateSucceeds�CTestUpdateBoundBranchWithModifiedBoundLocation.assertUpdateSucceedssK���
�
���/�/��=��
�
����������$�-�-�*E�*E�*G�HrBc��URSS5 URURS5 URURR	S55 g)Nr�r�r)r��assertEndsWithr�r��rstripr�s r@�test_without_final_slash�GTestUpdateBoundBranchWithModifiedBoundLocation.test_without_final_slashsI���%�%�h�
�;�	
���D�/�/��5��!�!�$�"5�"5�"<�"<�S�"A�BrBc��URSS5 URURRSSS55 g)Nz+masterr�z%2B�+r��r�r�r��replacer�s r@�test_plus_sign�=TestUpdateBoundBranchWithModifiedBoundLocation.test_plus_sign
s5���%�%�i��<��!�!�$�"5�"5�"=�"=�e�S�!�"L�MrBc��URSS5 URURRSSS55 g)Nzmas~terr�z%2E�~r�r�r�s r@�
test_tilda�9TestUpdateBoundBranchWithModifiedBoundLocation.test_tildas7��	
�%�%�i��<��!�!�$�"5�"5�"=�"=�e�S�!�"L�MrB)r�r�r�r�r3)
r�r�r�r�r�r7r�r�r�r�r�r�r�r�s@r@r�r��s2����G�H�I�
C�N�N�NrBr�c� �\rSrSrSrSrSrg)�TestWithCustomErrorHandleric��^�"SS[R5m[RR	SU4Sj5 [5n[
UR5nURSSSS5 URS	SSS
5 URS5 URS5nURX5nURTUR5 URU5 g)Nc��\rSrSrSrSrSrg)�?TestWithCustomErrorHandler.test_no_context.<locals>.OutOfCoffeeizA dummy exception for testing.c��XlgrD��urgency)r>r�s  r@r��HTestWithCustomErrorHandler.test_no_context.<locals>.OutOfCoffee.__init__s��&�rBr�N)r�r�r�r�r�r�r�r�rBr@�OutOfCoffeer�s
��0�
'rBr��OutOfCoffeec�.>�T"URS5$)Nr)�
error_args)r`r�s �r@r�<TestWithCustomErrorHandler.test_no_context.<locals>.<lambda>!s����C�N�N�1�4E�(FrBr�ryr�r�r�)r��lowrs)rr�r�no_context_error_translatorsr�rr�rr�r�ryr�r�r'r4)r>rr!rr�s    @r@�test_no_context�*TestWithCustomErrorHandler.test_no_contexts����	'�&�/�/�	'�	�+�+�4�4��F�	
�$�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �(���$�		
�	���� ��O�O�G�,�	��(�(��;�����+�v�'@�'@�A����F�#rBc��^�"SS[R5m[RR	SU4Sj5 [5n[
UR5nURSSSS5 URS	SSS
5 URS5 URS5nURX5nURTUR5 URU5 g)Nc��\rSrSrSrSrg)�>TestWithCustomErrorHandler.test_with_context.<locals>.OutOfTeai5c��XlX lgrD�rr�)r>rr�s   r@r��GTestWithCustomErrorHandler.test_with_context.<locals>.OutOfTea.__init__6s��$��&�rBr�N)r�r�r�r�r�r�r�rBr@�OutOfTear�5s��
'rBr��OutOfTeac�Z>�T"URSRS5U"S55$)Nrrr)r��decode)r`�findr�r�s   �r@r�>TestWithCustomErrorHandler.test_with_context.<locals>.<lambda><s'���H����q�!�(�(��1�4��>�%rBr�ryr�r�r�)r�r�rs)rr�r�error_translatorsr�rr�rr�r�ryr�r�r'r4)r>rr!rr�s    @r@�test_with_context�,TestWithCustomErrorHandler.test_with_context4s����	'�v���	'�
	� � �)�)��
�	
�$�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �(�,��BW�	
�	���� ��O�O�G�,�	��(�(��;�����(�F�$=�$=�>����F�#rBr�N)r�r�r�r�r�r�r�r�rBr@r�r�s��$�6$rBr�c� �\rSrSrSrSrSrg)�TestRepositoryPackiOc���SnURU5up#URSSSS5 URSSSS5 URS	S
SS5 UR5 g)Nrsr�r�r��r��token�Repository.pack�rvr�rwr�r�)rvr��r0r��packrSs    r@�	test_pack�TestRepositoryPack.test_packPss�� ���<�<�^�L���� � �$�&6�
�DU�	
�	� � ��+���		
�	� � � �"7��X�	
�	
�	�	�rBc���SnURU5up#URSSSS5 URSSSS5 URS	SSS5 URS
S/5 g)Nrsr�r�r�r�r�r�r�r��hinta�hintbr�rSs    r@�test_pack_with_hint�&TestRepositoryPack.test_pack_with_hintas{�� ���<�<�^�L���� � �$�&6�
�DU�	
�	� � ��+���		
�	� � � �"A�:�x�	
�	
�	�	�7�G�$�%rBr�N)r�r�r�r�r�r�r�r�rBr@r�r�Os���"&rBr�c�0�\rSrSrSrSrSrSrSrSr	g)	�TestRepositoryIterInventoriesis�!Test Repository.iter_inventories.c�r�[R"SS5nSRURXU55$�NTFrB�rrGrZrH�r>�old_name�new_namerJrKs     r@�_serialize_inv_delta�2TestRepositoryIterInventories._serialize_inv_deltav�0��$�=�=�d�E�J�
��x�x�
�1�1�(�e�L�M�MrBc���SnURU5up#[RRS5"5RnXBlS[R"SSSURSS/55/4/nURSSSS	[XT55 [URS/55nURS
U5 USnURSUR5 g)Nrs�2ar$�	somerevidr&�'VersionedFileRepository.get_inventories�rvs	unorderedr�r�r�r)r0rr*r�r0rzrr1rr�r/r
�iter_inventoriesr�r�r)r>r/rXr!rar�retr=s        r@�test_single_empty�/TestRepositoryIterInventories.test_single_emptyzs��� ���<�<�^�L����(�(�,�,�T�2�4�F�F����#�!�8�8�$����1�1�(�L�"�M�	��

�
��	� � �6�%���"�6�/�	
��4�(�(�,��8�9�����!�S�!��!�f������s���7rBc��SnURU5up#[UR/55nURU/5 gr�)r0r
rr�)r>r/rXr!rs     r@rT�(TestRepositoryIterInventories.test_empty�s>�� ���<�<�^�L����4�(�(��,�-������b�!rBc	���SnURU5up#URSSSS[/55 UR[R
[URS/55 g)Nrsrrr�r�r
)r0r�r�r�rrcr
rrSs    r@r��*TestRepositoryIterInventories.test_missing�sd�� ���<�<�^�L���� � �6�%�����H�	
�	
����!�!�4��)>�)>��~�)N�	
rBr�N)
r�r�r�r�r�rrrTr�r�r�rBr@rrss��+�N�8�<"�
rBrc�$�\rSrSrSrSrSrSrg)�!TestRepositoryRevisionTreeArchivei�rc�r�[R"SS5nSRURXU55$rrrs     r@r�6TestRepositoryRevisionTreeArchive._serialize_inv_delta�r
rBc�R�SnURU5up#[RRS5"5RnXBlS[R"SSSURSS/55/4/nURSSSS	[XT55 [5n[R"S
US9n[R"S5nS
UlSn	[R UlSUl['U	5UlUR+U[U	55 SSS5 URSSSS	UR-55 UR/S5n
UR1UR-5SR3U
R5SS555 g!,(df   N�=f)Nrsrr$r
r&rrr�r�r�)�mode�fileobj�somefilei0�s	some datai�sRepository.revision_archive)rvr
starsfoo.tarrBrBNrB�tarzfoo.tar)r0rr*r�r0rzrr1rr�r/r�tarfilere�TarInfo�mtime�REGTYPEr|rr�rb�addfiler��
revision_treer�rZ�archive)r>r/rXr!rar�f�tfr��contentsr�s           r@r��-TestRepositoryRevisionTreeArchive.test_simple�sr�� ���<�<�^�L����(�(�,�,�T�2�4�F�F����#�!�8�8�$����1�1�(�L�"�M�	��

�
��	� � �6�%���"�6�/�	
�
�I��
�\�\�s�A�
.�"��?�?�:�.�D��D�J�#�H����D�I��D�I��H�
�D�I��J�J�t�W�X�.�/�/�	� � �*�I���
�J�J�L�	
��!�!�,�/���������s�x�x����U�I�0N�'O�P�!/�
.�s
�5A'F�
F&r�N�r�r�r�r�r�rr�r�r�rBr@rr�s��+�N�*QrBrc�$�\rSrSrSrSrSrSrg)�TestRepositoryAnnotatei�z"Test RemoteRevisionTree.annotate..c�r�[R"SS5nSRURXU55$rrrs     r@r�+TestRepositoryAnnotate._serialize_inv_delta�r
rBc��SnURU5up#[RRS5"5RnXBlS[R"SSSURSS/55/4/nURSSSS	[XT55 URS
SSS	[R"SS
/SS//55 URS5nURSS/[URS555 g)Nrsrr$r
r&rrr�r�s!Repository.annotate_file_revision)rvr
sfilenamerBscurrent:�	baserevid�line 1
�line2
)r2r3)r
r4r")r0rr*r�r0rzrr1rr�r/r�r&r�r
�
annotate_iter)r>r/rXr!rarr�s       r@r��"TestRepositoryAnnotate.test_simple�s�� ���<�<�^�L����(�(�,�,�T�2�4�F�F����#�!�8�8�$����1�1�(�L�"�M�	��

�
��	� � �6�%���"�6�/�	
�	� � �0�D����O�O�l�K�8�<��:T�U�V�	
��!�!�,�/�����
(�*D�E���#�#�J�/�0�	
rBr�Nr,r�rBr@r.r.�s��,�N�$
rBr.c��\rSrSrSrSrg)�TestBranchGetAllReferenceInfoic	��[5n[UR5nURSSSS5 URSSSS[R"S/55 URS	5 UR
S	5nURX5nUR"5nURU5 URS
S0U5 g)Nr�ryr�r�sBranch.get_all_reference_infor�r�)�file-idshttps://www.example.com/rBrsr:)zhttps://www.example.com/N)rr�rr�r�r�ryr��_get_all_reference_infor4r�r�s     r@�test_get_all_reference_info�9TestBranchGetAllReferenceInfo.test_get_all_reference_infos���#�%�	��I�N�N�+��� � �(�,��BR�	
�	� � �,�����O�O�K�L�M�	
�	���� ��O�O�G�,�	��(�(��;���/�/�1�����F�#����*�&H�I�6�RrBr�N)r�r�r�r�r<r�r�rBr@r8r8s��SrBr8c��\rSrSrSrSrg)�
TestErrorsi%c��Sn[R"U5n[U5nURS[	U55 g)N)�error�tuplez3Server sent an unexpected error: ('error', 'tuple'))rr�r)r�rk)r>r��orig_errr`s    r@�,test_untranslateable_error_from_smart_server�7TestErrors.test_untranslateable_error_from_smart_server&s8��(���.�.�{�;��)�(�3�����A�3�s�8�	
rBr�N)r�r�r�r�rDr�r�rBr@r?r?%r>rBr?)�r�rarXr!r�ior�fastbencoder�r�rrrrr	r
rrr9r
rFrrr�tests.scenariosr�transport.memoryr�transport.remoterrrrrrrrrrrrr r!�chk_serializerr"r#r$r%r&r'r(r)�smartr*r+�smart.clientr,�smart.repositoryr-r.r/�
load_tests�TestCaseWithTransportr1r�r�rr��TestCaser�TestCaseWithMemoryTransportr&r7rQrer�r�r�r�r�r�r�rr,r4rRrkrr~r�r�r�r�r�r�r�r�r#r0rGrqr�r�r�r�r�rr�TestCaseInTempDirrr-r4r6r@rOr]ryr}r�r�r�r�r�r�r�rr+r]rkrurr�r�r�r�r�r�r�r�rPrXrdr�rtr�r�r�rr"rzr�r�r�rrr.r8r?r�rBr@�<module>rTs���"��
�����R�R�R�+��/� �9�/�W�W�
�
�
�*�3����$�'���(�
�Y
�U�8�8�Y
�x��.x+��x+�v:��)�)�:�
 ����
 �$��2�2�$�'N�5�>�>�'N�TA�5�>�>�A�>OS�z�OS�d$$�
�$$�N,
�J�,
�^$�j�$�$�z�$�4$�*�$�R$�Z�R$�jL
�:�L
�^C>�Z�C>�L+>��+>�\\D�z�\D�~o
�:�o
�d��	 �	 �M�:�M�I�/�I�6$�.�$�"(�&:�(�D-$�.�-$�`./�"6�./�b%�1�%�84U�1�4U�nx
�1�x
�v$-�!5�$-�NHC�J�HC�VN$� 4�N$�by7�$8�y7�xnN�1�nN�bZ
�"6�Z
�z$�.�$�.~.�"6�~.�B.�1�.�>R�e�n�n�R�:.����.�9�5�+B�+B�9��:��68�
�u�~�~�
�
�/�
�*
�#7�
�0U
� 4�U
�p
�2�
�	
�(<�	
�=�2�=�2 
�-A� 
�F;�1�;�
�%9�
�Dn�!5�n�bR�� ;� ;�R�$/
�!5�/
�d`A�%9�`A�F|
�%9�|
�~(�.B�(�4(�';�(�0(�1�(�0(�%9�(�0
�2�
�<h,� 4�h,�V+�(<�+�<=�/�=�4
,� 4�
,�!
�#7�!
�H$�%9�$�&C'�!?�C'�L.2�&D�.2�b&!�0�&!�R.�e�&A�&A�.�&B�B�9�9�AE�';�AE�H �u�@�@� �BJ;�":�J;�Z-O�%=�-O�`s
�5�.�.�s
�lW2�U�8�8�W2�t)N�U�5P�5P�)N�X4$�!5�4$�n!&�-�!&�H7
�$8�7
�t1Q�(<�1Q�h+
�1�+
�\S�$8�S�,
����
rB

Youez - 2016 - github.com/yon3zu
LinuXploit