Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.11/site-packages/pip/_internal/vcs/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.11/site-packages/pip/_internal/vcs/__pycache__/mercurial.cpython-311.pyc

�

�@�e�����ddlZddlZddlZddlmZmZmZddlmZm	Z	ddl
mZmZddl
mZddlmZddlmZmZmZmZeje��ZGd�d	e��Zeje��dS)
�N)�List�Optional�Tuple)�
BadCommand�InstallationError)�
HiddenText�display_path)�make_command)�path_to_url)�
RevOptions�VersionControl�(find_path_to_project_root_from_repo_root�vcsc
���eZdZdZdZdZdZedede	efd���Z
ded	ed
ede
ddf
d
�Zded	ed
eddfd�Zded	ed
eddfd�Zededefd���Zededefd���Zededefd���Zededeedefd���Zededeefd���Zededeef�fd���Z�xZS)�	Mercurial�hgz.hg�clone)zhg+filezhg+httpzhg+httpszhg+sshzhg+static-http�rev�returnc��d|��gS)Nz--rev=�)rs �F/usr/local/lib/python3.11/site-packages/pip/_internal/vcs/mercurial.py�get_base_rev_argszMercurial.get_base_rev_args s���������dest�url�rev_options�	verbosityNc�r�|���}t�d||t|����|dkrd}n|dkrd}n|dkrd}nd}|�td	d
g|�|�|�R���|�tdg|�|����R�|���dS)
NzCloning hg %s%s to %sr)z--quiet�r�)�	--verbose)r"z--debugrz
--noupdate�update��cwd)�
to_display�logger�infor	�run_commandr
�to_args)�selfrrrr�rev_display�flagss       r�	fetch_newzMercurial.fetch_new$s���"�,�,�.�.�����#�������		
�	
�	
���>�>�%1�E�E�
�!�^�^��E�E�
�!�^�^�"�E�E�,�E�����g�|�O�e�O�S�O�$�O�O�O�P�P�P������A�E�A�;�+>�+>�+@�+@�A�A�A��	�	
�	
�	
�	
�	
rc�J�tj�||jd��}t	j��}	|�|��|�dd|j��t|d��5}|�
|��ddd��n#1swxYwYtdd|�����}|�
||���dS#ttjf$r'}t �d||��Yd}~dSd}~wwxYw)	N�hgrc�paths�default�wr#�-qr$z/Could not switch Mercurial repository to %s: %s)�os�path�join�dirname�configparser�RawConfigParser�read�set�secret�open�writer
r*r)�OSError�NoSectionErrorr'�warning)	r+rrr�repo_config�config�config_file�cmd_args�excs	         r�switchzMercurial.switch<sa���g�l�l�4���v�>�>���-�/�/��		1��K�K��$�$�$��J�J�w�	�3�:�6�6�6��k�3�'�'�
*�;����[�)�)�)�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*����
*�
*�
*�
*�
$�H�d�K�4G�4G�4I�4I�J�J�H����X�4��0�0�0�0�0��	��4�5�	X�	X�	X��N�N�L�c�SV�W�W�W�W�W�W�W�W�W�����	X���s<�AC%�<B�C%�B"�"C%�%B"�&C%�%D"�;D�D"c��|�ddg|���tdd|�����}|�||���dS)N�pullr4r$r#)r)r
r*)r+rrrrFs     rr#zMercurial.updateJs[�����&�$��T��2�2�2���$��0C�0C�0E�0E�F�F������t��,�,�,�,�,r�locationc���|�ddgdd|������}|�|��rt|��}|���S)N�
showconfigz
paths.defaultFT��show_stdout�stdout_onlyr%)r)�strip�_is_local_repositoryr)�clsrKrs   r�get_remote_urlzMercurial.get_remote_urlOsl���o�o�
�?�+����	�
�
�
�%�'�'�	��#�#�C�(�(�	#��c�"�"�C��y�y�{�{�rc�`�|�ddgdd|������}|S)zW
        Return the repository-local changeset revision number, as an integer.
        �parentsz--template={rev}FTrN�r)rQ)rSrK�current_revisions   r�get_revisionzMercurial.get_revision[sD��
�?�?�
�*�+����	+�
�
�
�%�'�'�	� �rc�`�|�ddgdd|������}|S)zh
        Return the changeset identification hash, as a 40-character
        hexadecimal string
        rVz--template={node}FTrNrW)rSrK�current_rev_hashs   r�get_requirement_revisionz"Mercurial.get_requirement_revisionhsD���?�?�
�+�,����	+�
�
�
�%�'�'�	� �r�namec��dS)z&Always assume the versions don't matchFr)rSrr]s   r�is_commit_id_equalzMercurial.is_commit_id_equalvs	���urc�2�|�dgdd|������}tj�|��s=tj�tj�||����}t||��S)z�
        Return the path to Python project root, relative to the repo root.
        Return None if the project root is in the repo root.
        �rootFTrN)r)rQr5r6�isabs�abspathr7r)rSrK�	repo_roots   r�get_subdirectoryzMercurial.get_subdirectory{s���O�O�
�H�%�T�x�$�
�
�
�%�'�'�	��w�}�}�Y�'�'�	K���������X�y�(I�(I�J�J�I�7��)�L�L�Lrc�^��t���|��}|r|S	|�dg|dddd���}n8#t$rt�d|��YdSt$rYdSwxYwtj�	|�
d����S)NraFT�raise)r%rOrP�
on_returncode�log_failed_cmdzIcould not determine if %s is under hg control because hg is not availablez
)�super�get_repository_rootr)rr'�debugrr5r6�normpath�rstrip)rSrK�loc�r�	__class__s    �rrkzMercurial.get_repository_root�s�����g�g�)�)�(�3�3���	��J�	�������!� �%�$�
 ���A�A���	�	�	��L�L�.��
�
�
�
�4�4� �	�	�	��4�4�	�����w������� 0� 0�1�1�1s�A�%A:�-	A:�9A:)�__name__�
__module__�__qualname__r]r8�	repo_name�schemes�staticmethod�strrrrr�intr.rHr#�classmethodrTrYr\r�boolr_rerk�
__classcell__)rqs@rrrs:��������D��G��I��G�� �s� �t�C�y� � � ��\� �
��
�(�
�7A�
�NQ�
�	
�
�
�
�
�01�3�1�Z�1�j�1�T�1�1�1�1�-�3�-�Z�-�j�-�T�-�-�-�-�
�	�c�	�c�	�	�	��[�	��
 �C�
 �C�
 �
 �
 ��[�
 �� �� �� � � ��[� ���c���#���4�����[���M��M���
�M�M�M��[�M��2�3�2�8�C�=�2�2�2�2�2��[�2�2�2�2�2rr)r9�loggingr5�typingrrr�pip._internal.exceptionsrr�pip._internal.utils.miscrr	�pip._internal.utils.subprocessr
�pip._internal.utils.urlsr� pip._internal.vcs.versioncontrolrr
rr�	getLoggerrrr'r�registerrrr�<module>r�s2����������	�	�	�	�(�(�(�(�(�(�(�(�(�(�B�B�B�B�B�B�B�B�=�=�=�=�=�=�=�=�7�7�7�7�7�7�0�0�0�0�0�0�������������
��	�8�	$�	$��L2�L2�L2�L2�L2��L2�L2�L2�^
���Y�����r

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