Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/subversion.cpython-312.pyc

�

4Μg�-��f�ddlZddlZddlZddlmZmZmZddlmZm	Z	m
Z
mZmZddl
mZmZddlmZmZmZmZmZej,e�Zej2d�Zej2d�Zej2d�Zej2d	�ZGd
�de�Zej>e�y)�N)�List�Optional�Tuple)�
HiddenText�display_path�is_console_interactive�is_installable_dir�split_auth_from_netloc)�CommandArgs�make_command)�AuthInfo�RemoteNotFoundError�
RevOptions�VersionControl�vcsz
url="([^"]+)"zcommitted-rev="(\d+)"z\s*revision="(\d+)"z<url>(.*)</url>c���eZdZdZdZdZdZedede	fd��Z
ededeefd	��Z
ed
edefd��Zeded
edeeeeeeefff�fd��Zededeeeeeff�fd��Zedeedeedefd��Zed
edefd��Zed
edeeeeffd��Zededeede	fd��Zd%dee	ddf�fd�
Zdeedffd�Zdeedffd�Zdefd�Zdeded ed!eddf
d"�Z deded eddfd#�Z!deded eddfd$�Z"�xZ#S)&�
Subversion�svnz.svn�checkout)zsvn+sshzsvn+httpz	svn+httpszsvn+svnzsvn+file�
remote_url�returnc��y)NT�)�clsrs  �G/usr/local/lib/python3.12/site-packages/pip/_internal/vcs/subversion.py�should_add_vcs_url_prefixz$Subversion.should_add_vcs_url_prefix$s����revc�
�d|gS)Nz-rr)rs r�get_base_rev_argszSubversion.get_base_rev_args(s���c�{�r�locationc���d}tj|�D]�\}}}|j|vrg|dd�|j|j�tjj||jd�}tjj
|�s��|j|�\}}||k(r
|�J�|dz}n|r|j|�sg|dd��t||�}��t|�S)zR
        Return the maximum revision for all files under a given location
        rN�entries�/)�os�walk�dirname�remove�path�join�exists�_get_svn_url_rev�
startswith�max�str)	rr!�revision�base�dirs�_�
entries_fn�dirurl�localrevs	         r�get_revisionzSubversion.get_revision,s������W�W�X�.�M�D�$���{�{�$�&���Q����K�K����$������d�C�K�K��C�J��7�7�>�>�*�-��"�3�3�D�9��F�H��x���)�)�)���|���6�#4�#4�T�#:���Q����8�X�.�H�%/�&�8�}�r�netloc�schemec�D��|dk(rt�|�||�St|�S)z�
        This override allows the auth information to be passed to svn via the
        --username and --password options instead of via the URL.
        �ssh)�super�get_netloc_and_authr
)rr8r9�	__class__s   �rr=zSubversion.get_netloc_and_authIs+����U�?��7�.�v�v�>�>�%�f�-�-r�urlc�`��t�|�|�\}}}|jd�rd|z}|||fS)Nzssh://zsvn+)r<�get_url_rev_and_authr-)rr?r�	user_passr>s    �rrAzSubversion.get_url_rev_and_authXs=���$�g�:�3�?���S�)��>�>�(�#��3�,�C��C��"�"r�username�passwordc�.�g}|r|d|gz
}|r|d|gz
}|S)Nz
--usernamez
--passwordr)rCrD�
extra_argss   r�
make_rev_argszSubversion.make_rev_args`s3��#%�
���<��2�2�J���<��2�2�J��rc���|}t|�sN|}tjj|�}||k(rtjd|�t�t|�s�N|j|�\}}|�t�|S)NzMCould not find Python project for directory %s (tried all parent directories))r	r%r)r'�logger�warningrr,)rr!�
orig_location�
last_locationr?�_revs      r�get_remote_urlzSubversion.get_remote_urlls~��!�
�$�X�.�$�M��w�w���x�0�H��=�(����*�!��
*�)�%�X�.��(�(��2�	��T��;�%�%��
rc���ddlm}tjj	||j
d�}tjj
|�r%t|�5}|j�}ddd�nd}d}jd�s"|jd�s|jd�rwtttj|jd���}|dd=|dd	}|D�cgc]%}t|�d
kDs�|d
s�t!|d
���'c}dgz}	�n|jd�rvt"j%|�}
|
st'd|����|
j)d
�}t*j-|�D�cgc]}t!|j)d
����c}dgz}	n|	|j/dd|gdd��}t0j%|�}
|
�J�|
j)d
�}t2j-|�D�cgc]}t!|j)d
����}	}|	rt5|	�}
||
fSd}
||
fS#1swY���xYwcc}wcc}wcc}w#|$rdg}	}Y�>wxYw)Nr)�InstallationErrorr#��8�9�10z

��	z<?xmlzBadly formatted data: ��infoz--xmlFT��show_stdout�stdout_only)�pip._internal.exceptionsrPr%r)r*r'r+�open�readr-�list�mapr/�
splitlines�split�len�int�_svn_xml_url_re�search�
ValueError�group�_svn_rev_re�finditer�run_command�_svn_info_xml_url_re�_svn_info_xml_rev_rer.)rr!rP�entries_path�f�datar?r#�d�revs�match�m�xmlrs              rr,zSubversion._get_svn_url_rev�s4��>��w�w�|�|�H�c�k�k�9�E��
�7�7�>�>�,�'��l�#�q��v�v�x��$�#��D����?�?�3��4�?�?�3�#7�4�?�?�4�;P��3�s�~�~�t�z�z�*�/E�F�G�G���
�1�
��!�*�Q�-�C�'.�F�w�!�#�a�&�1�*��1��C��!��I�w�F�!��L�D�
�_�_�W�
%�#�*�*�4�0�E�� �#9�$��!B�C�C��+�+�a�.�C�-8�-A�-A�$�-G�H�-G��C�����
�O�-G�H�A�3�N�D�
%��o�o��W�h�/� %� $�&���
-�3�3�C�8���(�(�(��k�k�!�n��1E�1N�1N�s�1S�T�1S�A��A�G�G�A�J��1S��T���d�)�C��C�x���C��C�x��U$�#��G��I��"U��$�
%� �"�T��
%�sI�H>�1I�I�I�!I�,AI�!I�%I�>I�I�	I&�%I&�dest�namec��y)z&Always assume the versions don't matchFr)rrvrws   r�is_commit_id_equalzSubversion.is_commit_id_equal�s��rN�use_interactivec�V��|�
t�}||_d|_t�|��y�N)rrz�_vcs_versionr<�__init__)�selfrzr>s  �rr~zSubversion.__init__�s.����"�4�6�O�.���8<���
���r.c�.�d}|jdgdd��}|j|�sy|t|�dj�d}|j	d	�djd
�}	tt
t|��}|S#t$rYywxYw)aQuery the version of the currently installed Subversion client.

        :return: A tuple containing the parts of the version information or
            ``()`` if the version returned from ``svn`` could not be parsed.
        :raises: BadCommand: If ``svn`` is not installed.
        z
svn, version z	--versionFTrYrNr�-�.)	rkr-rcrb�	partition�tupler`rdrg)r�version_prefix�version�version_list�parsed_versions     r�call_vcs_versionzSubversion.call_vcs_version�s���)���"�"�K�=�e�QU�"�V���!�!�.�1���#�n�-�/�0�6�6�8��;���(�(��-�a�0�6�6�s�;��	�"�3�s�L�#9�:�N�����	��	�s�-B�	B�Bc�d�|j�|jS|j�}||_|S)a�Return the version of the currently installed Subversion client.

        If the version of the Subversion client has already been queried,
        a cached value will be used.

        :return: A tuple containing the parts of the version information or
            ``()`` if the version returned from ``svn`` could not be parsed.
        :raises: BadCommand: If ``svn`` is not installed.
        )r}r�)r�vcs_versions  r�get_vcs_versionzSubversion.get_vcs_version�s:�����(��$�$�$��+�+�-��'����rc�T�|jsdgS|j�}|dk\rdgSgS)aCReturn options to be used on calls to Subversion that contact the server.

        These options are applicable for the following ``svn`` subcommands used
        in this class.

            - checkout
            - switch
            - update

        :return: A list of command line arguments to pass to ``svn``.
        z--non-interactive)rW�z--force-interactive)rzr�)r�svn_versions  r�get_remote_call_optionsz"Subversion.get_remote_call_options�s>���#�#�(�(�(��*�*�,���&� �)�*�*��	r�rev_options�	verbosityc��|j�}tjd||t|��|dkrdg}ng}t	dg|�|j��|j
��|�|���}|j|�y)NzChecking out %s%s to %srz--quietr)�
to_displayrIrXrrr��to_argsrk)rrvr?r�r��rev_display�flags�cmd_argss        r�	fetch_newzSubversion.fetch_news���"�,�,�.�����%������		
���>��K�E��E���
�
�
�
�(�(�*�
�
���!�	
�

�
�
�

��	
����"rc�|�td|j�|j�||�}|j|�y)N�switch�rr�r�rk�rrvr?r�r�s     rr�zSubversion.switch0s=�����(�(�*����!���
��	
����"rc�z�td|j�|j�|�}|j|�y)N�updater�r�s     rr�zSubversion.update:s:�����(�(�*����!��	
��	
����"rr|)$�__name__�
__module__�__qualname__rwr'�	repo_name�schemes�classmethodr/�boolr�staticmethodrr r7rrr=r
rArrrGrNrdr,ryr~r�r�r�rr�r�r��
__classcell__)r>s@rrrsh����D��G��I�I�G���3��4������s��t�C�y������C��C����8�.��.�"%�.�	�s�E�(�3�-��#��6�7�7�	8�.��.��#�s�#�u�S�(�3�-��5Q�/R�#��#��	��3�-�	�+3�J�+?�	�	�	��	���c��c����.�/��/��h�s�m�S�6H�0I�/��/�b��c���#���4���������$���%��S��/��8��s�C�x���(���>#��#�(�#�7A�#�NQ�#�	
�#�0#�3�#�Z�#�j�#�T�#�#�3�#�Z�#�j�#�T�#rr) �loggingr%�re�typingrrr�pip._internal.utils.miscrrrr	r
�pip._internal.utils.subprocessrr� pip._internal.vcs.versioncontrolr
rrrr�	getLoggerr�rI�compilererirmrlr�registerrrr�<module>r�s����	�	�(�(���E���
��	�	�8�	$���"�*�*�_�-���b�j�j�1�2��!�r�z�z�"8�9��!�r�z�z�"4�5��c#��c#�L	
����Z�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists