HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/mercurial.cpython-37.pyc
B

L��g��@s�ddlZddlZddlZddlmZmZmZddlmZm	Z	ddl
mZmZddl
mZddlmZddlmZmZmZmZe�e�ZGdd	�d	e�Ze�e�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�vcscseZdZdZdZdZdZeee	ed�dd��Z
eeee
dd	�d
d�Zeeedd�d
d�Zeeedd�dd�Zeeed�dd��Zeeed�dd��Zeeed�dd��Zeeeeed�dd��Zeeeed�dd��Zeeeed��fdd��Z�ZS)�	Mercurial�hgz.hg�clone)zhg+filezhg+httpzhg+httpszhg+sshzhg+static-http)�rev�returncCsd|��gS)Nz--rev=�)rrr�?/tmp/pip-unpacked-wheel-hv55ucu3/pip/_internal/vcs/mercurial.py�get_base_rev_args szMercurial.get_base_rev_argsN)�dest�url�rev_options�	verbosityrcCs�|��}t�d||t|��|dkr*d}n |dkr8d}n|dkrFd}nd}|�td
|||f���|jtd||��f��|d�dS)NzCloning hg %s%s to %sr)z--quiet�r�)z	--verbose)z	--verbosez--debugr�
--noupdate�update)�cwd)rr)r)�
to_display�logger�infor�run_commandr	�to_args)�selfrrrr�rev_display�flagsrrr�	fetch_new$s"
zMercurial.fetch_new)rrrrc	
Cs�tj�||jd�}t��}y>|�|�|�dd|j�t	|d��}|�
|�WdQRXWn6ttjfk
r�}zt
�d||�Wdd}~XYn Xtdd|���}|j||d�dS)	N�hgrc�paths�default�wz/Could not switch Mercurial repository to %s: %srz-q)r)�os�path�join�dirname�configparser�RawConfigParser�read�set�secret�open�write�OSError�NoSectionErrorr!�warningr	r$r#)	r%rrr�repo_config�config�config_file�exc�cmd_argsrrr�switch<s
 zMercurial.switchcCs4|jddg|d�tdd|���}|j||d�dS)N�pullz-q)rr)r#r	r$)r%rrrr?rrrrJszMercurial.update)�locationrcCs4|jddgdd|d���}|�|�r,t|�}|��S)N�
showconfigz
paths.defaultFT)�show_stdout�stdout_onlyr)r#�strip�_is_local_repositoryr
)�clsrBrrrr�get_remote_urlOs
zMercurial.get_remote_urlcCs|jddgdd|d���}|S)zW
        Return the repository-local changeset revision number, as an integer.
        �parentsz--template={rev}FT)rDrEr)r#rF)rHrB�current_revisionrrr�get_revision[szMercurial.get_revisioncCs|jddgdd|d���}|S)zh
        Return the changeset identification hash, as a 40-character
        hexadecimal string
        rJz--template={node}FT)rDrEr)r#rF)rHrB�current_rev_hashrrr�get_requirement_revisionhsz"Mercurial.get_requirement_revision)r�namercCsdS)z&Always assume the versions don't matchFr)rHrrOrrr�is_commit_id_equalvszMercurial.is_commit_id_equalcCsD|jdgdd|d���}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.
        �rootFT)rDrEr)r#rFr-r.�isabs�abspathr/r
)rHrB�	repo_rootrrr�get_subdirectory{s
zMercurial.get_subdirectorycsvt��|�}|r|Sy|jdg|ddddd�}Wn2tk
rPt�d|�dStk
rbdSXtj�	|�
d��S)NrQFT�raise)rrDrE�
on_returncode�log_failed_cmdzIcould not determine if %s is under hg control because hg is not availablez
)�super�get_repository_rootr#rr!�debugrr-r.�normpath�rstrip)rHrB�loc�r)�	__class__rrrZ�s&zMercurial.get_repository_root)�__name__�
__module__�__qualname__rOr0�	repo_name�schemes�staticmethod�strrrrr�intr(r@r�classmethodrIrLrNr�boolrPrUrZ�
__classcell__rr)r`rrs,

r)r1�loggingr-�typingrrr�pip._internal.exceptionsrr�pip._internal.utils.miscrr�pip._internal.utils.subprocessr	�pip._internal.utils.urlsr
� pip._internal.vcs.versioncontrolrrr
r�	getLoggerrar!r�registerrrrr�<module>s