HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/site-packages/pip/_internal/vcs/__pycache__/mercurial.cpython-311.pyc
�

�mi�����ddlmZddlZddlZddlZddlmZmZddlm	Z	m
Z
ddlmZddl
mZddlmZmZmZmZeje��ZGd�d	e��Zeje��dS)
�)�annotationsN)�
BadCommand�InstallationError)�
HiddenText�display_path)�make_command)�path_to_url)�
RevOptions�VersionControl�(find_path_to_project_root_from_repo_root�vcsc����eZdZdZdZdZdZed d	���Zd!d�Z		d"d!d�Z
	d"d!d�Zed#d���Z
ed#d���Zed#d���Zed$d���Zed%d���Zed%�fd���Z�xZS)&�	Mercurial�hgz.hg�clone)zhg+filezhg+httpzhg+httpszhg+sshzhg+static-http�rev�str�return�	list[str]c��d|��gS)Nz--rev=�)rs �=D:\Python311\Lib\site-packages\pip/_internal/vcs/mercurial.py�get_base_rev_argszMercurial.get_base_rev_args!s���������dest�urlr�rev_optionsr
�	verbosity�int�Nonec�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��	�	
�	
�	
�	
�	
rrc��g}tj�||jd��}t	j��}|dkr|�d��	|�|��|�dd|j	��t|d��5}|�|��ddd��n#1swxYwYtdg|�|�
���R�}	|�|	|���dS#ttjf$r'}
t"�d	||
��Yd}
~
dSd}
~
wwxYw)
N�hgrcr�-q�paths�default�wr%r&z/Could not switch Mercurial repository to %s: %s)�os�path�join�dirname�configparser�RawConfigParser�append�read�set�secret�open�writerr,r+�OSError�NoSectionErrorr)�warning)r-rrrr�extra_flags�repo_config�config�config_file�cmd_args�excs           r�switchzMercurial.switch=s������g�l�l�4���v�>�>���-�/�/����>�	%����t�$�$�$�		1��K�K��$�$�$��J�J�w�	�3�:�6�6�6��k�3�'�'�
*�;����[�)�)�)�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*����
*�
*�
*�
*�
$�H�R�{�R�K�<O�<O�<Q�<Q�R�R�R�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=�AD�B;�/D�;B?�?D�B?�D�D=�D8�8D=c���g}|dkr|�d��|�dg|�|���tdg|�|����R�}|�||���dS)Nrr3�pullr&r%)r=r+rr,)r-rrrrrFrJs       rr%zMercurial.updateVs�������>�	%����t�$�$�$����&�/�;�/�T��:�:�:���N�;�N��8K�8K�8M�8M�N�N�N������t��,�,�,�,�,r�locationc���|�ddgdd|������}|�|��rt|��}|���S)N�
showconfigz
paths.defaultFT��show_stdout�stdout_onlyr')r+�strip�_is_local_repositoryr	)�clsrOrs   r�get_remote_urlzMercurial.get_remote_urlfsl���o�o�
�?�+����	�
�
�
�%�'�'�	��#�#�C�(�(�	#��c�"�"�C��y�y�{�{�rc�`�|�ddgdd|������}|S)zW
        Return the repository-local changeset revision number, as an integer.
        �parentsz--template={rev}FTrR�r+rU)rWrO�current_revisions   r�get_revisionzMercurial.get_revisionrsD��
�?�?�
�*�+����	+�
�
�
�%�'�'�	� �rc�`�|�ddgdd|������}|S)zh
        Return the changeset identification hash, as a 40-character
        hexadecimal string
        rZz--template={node}FTrRr[)rWrO�current_rev_hashs   r�get_requirement_revisionz"Mercurial.get_requirement_revisionsD���?�?�
�+�,����	+�
�
�
�%�'�'�	� �r�name�
str | None�boolc��dS)z&Always assume the versions don't matchFr)rWrras   r�is_commit_id_equalzMercurial.is_commit_id_equal�s	���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.
        �rootFTrR)r+rUr7r8�isabs�abspathr9r)rWrO�	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)NrgFT�raise)r'rSrT�
on_returncode�log_failed_cmdzIcould not determine if %s is under hg control because hg is not availablez
)�super�get_repository_rootr+rr)�debugrr7r8�normpath�rstrip)rWrO�loc�r�	__class__s    �rrqzMercurial.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:)rrrr)
rrrrrr
rrrr )r)rOrrr)rrrarbrrc)rOrrrb)�__name__�
__module__�__qualname__rar:�	repo_name�schemes�staticmethodrr0rLr%�classmethodrXr]r`rerkrq�
__classcell__)rws@rrrss��������D��G��I��G�� � � ��\� �
�
�
�
�:�1�1�1�1�1�<�-�-�-�-�-� �	�	�	��[�	��
 �
 �
 ��[�
 �� � � ��[� ������[���M�M�M��[�M��2�2�2�2�2��[�2�2�2�2�2rr)�
__future__rr;�loggingr7�pip._internal.exceptionsrr�pip._internal.utils.miscrr�pip._internal.utils.subprocessr�pip._internal.utils.urlsr	� pip._internal.vcs.versioncontrolr
rrr
�	getLoggerrxr)r�registerrrr�<module>r�s&��"�"�"�"�"�"���������	�	�	�	�B�B�B�B�B�B�B�B�=�=�=�=�=�=�=�=�7�7�7�7�7�7�0�0�0�0�0�0�������������
��	�8�	$�	$��b2�b2�b2�b2�b2��b2�b2�b2�J
���Y�����r