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__/mercurial.cpython-312.pyc

�

4Μg�����ddlZddlZddlZddlmZmZmZddlmZm	Z	ddl
mZmZddl
mZddlmZddlmZmZmZmZej,e�ZGd�d	e�Zej4e�y)
�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
�F��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.12/site-packages/pip/_internal/vcs/mercurial.py�get_base_rev_argszMercurial.get_base_rev_args s���������dest�url�rev_options�	verbosityNc�4�|j�}tjd||t|��|dkrd}n|dk(rd}n
|dk(rd}nd}|j	td	d
g|�|�|����|j	tdg|�|j
����|��y)
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�����g�|�O�e�O�S�O�$�O�P������A�E�A�;�+>�+>�+@�A��	�	
rc��tjj||jd�}t	j
�}	|j
|�|jdd|j�t|d�5}|j|�ddd�tdd|j��}|j||��y#1swY�8xYw#ttjf$r!}t j#d||�Yd}~yd}~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<s����g�g�l�l�4����v�>���-�-�/��		1��K�K��$��J�J�w�	�3�:�:�6��k�3�'�;����[�)�(�
$�H�d�K�4G�4G�4I�J�H����X�4��0�
(�'����4�4�5�	X��N�N�L�c�SV�W�W��	X�s0�:C�;C�
C�C
�	C�D
�)D�D
c��|jddg|��tdd|j��}|j||��y)N�pullr4r$r#)r)r
r*)r+rrrrFs     rr#zMercurial.updateJsC�����&�$��T��2���$��0C�0C�0E�F������t��,r�locationc��|jddgdd|��j�}|j|�rt|�}|j�S)N�
showconfigz
paths.defaultFT��show_stdout�stdout_onlyr%)r)�strip�_is_local_repositoryr)�clsrKrs   r�get_remote_urlzMercurial.get_remote_urlOsX���o�o�
�?�+����	�
�
�%�'�	��#�#�C�(��c�"�C��y�y�{�rc�P�|jddgdd|��j�}|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[s=��
�?�?�
�*�+����	+�
�
�%�'�	� �rc�P�|jddgdd|��j�}|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_revisionhs=���?�?�
�+�,����	+�
�
�%�'�	� �r�namec��y)z&Always assume the versions don't matchFr)rSrr]s   r�is_commit_id_equalzMercurial.is_commit_id_equalvs��rc��|jdgdd|��j�}tjj	|�s=tjjtjj
||��}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{sl���O�O�
�H�%�T�x�$�
�
�%�'�	��w�w�}�}�Y�'�����������X�y�(I�J�I�7��)�L�Lrc���t�|�|�}|r|S	|jdg|dddd��}tjj|jd��S#t$rtjd|�Yyt$rYywxYw)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�)�(�3����J�	�������!� �%�$�
 ��A�"�w�w������� 0�1�1���	��L�L�.��
�
� �	��	�s�A�B�=B�B)�__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�-�3�-�Z�-�j�-�T�-�
�	�c�	�c�	��	��
 �C�
 �C�
 ��
 �� �� �� �� ���c���#���4�����M��M���
�M��M��2�3�2�8�C�=�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�s]����	�(�(�B�=�7�0���
��	�	�8�	$��L2��L2�^
����Y�r

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