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/lib/python3.9/site-packages/pip/_internal/vcs/__pycache__/mercurial.cpython-39.pyc
a

?�f*�@s�ddlmZddlZddlZddlmZddlmZmZddl	m
Z
ddlmZddl
mZddlmZdd	lmZdd
lmZmZmZer�ddl	mZddlmZe�e�ZGd
d�de�Ze�e�dS)�)�absolute_importN)�configparser)�
BadCommand�SubProcessError)�display_path)�make_command)�
TempDirectory)�MYPY_CHECK_RUNNING)�path_to_url)�VersionControl�!find_path_to_setup_from_repo_root�vcs)�
HiddenText)�
RevOptionscs�eZdZdZdZdZdZedd��Zdd�Z	d	d
�Z
dd�Zd
d�Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
�fdd��Z�ZS)�	Mercurial�hgz.hg�clone)rzhg+filezhg+httpzhg+httpszhg+sshzhg+static-httpcCs|gS)N�)Zrevrr�?/usr/lib/python3.9/site-packages/pip/_internal/vcs/mercurial.py�get_base_rev_args'szMercurial.get_base_rev_argscCsRtdd��4}|j|j|d�|jd|g|jd�Wd�n1sD0YdS)z?Export the Hg repository at the url to the destination location�export)�kind)�url�archive��cwdN)r�unpack�path�run_command)�self�locationrZtemp_dirrrrr+s

�zMercurial.exportcCsP|��}t�d||t|��|�tddd||��|jtdd|���|d�dS)NzCloning hg %s%s to %srz
--noupdate�-q�updater)Z
to_display�logger�inforrr�to_args)r�destr�rev_optionsZrev_displayrrr�	fetch_new5s��zMercurial.fetch_newc	
Cs�tj�||jd�}t��}zR|�|�|�dd|j�t	|d��}|�
|�Wd�n1s`0YWn8ttjfy�}zt
�d||�WYd}~n(d}~00tdd|���}|j||d�dS)	NZhgrc�paths�default�wz/Could not switch Mercurial repository to %s: %sr"r!r)�osr�join�dirnamerZRawConfigParser�read�setZsecret�open�write�OSErrorZNoSectionErrorr#Zwarningrr%r)	rr&rr'Zrepo_configZconfigZconfig_file�exc�cmd_argsrrr�switchDs
,�zMercurial.switchcCs4|jddg|d�tdd|���}|j||d�dS)NZpullr!rr")rrr%)rr&rr'r5rrrr"UszMercurial.updatecCs0|jddg|d���}|�|�r(t|�}|��S)NZ
showconfigz
paths.defaultr)r�stripZ_is_local_repositoryr
)�clsr rrrr�get_remote_url[s�

zMercurial.get_remote_urlcCs|jddg|d���}|S)zW
        Return the repository-local changeset revision number, as an integer.
        �parentsz--template={rev}r�rr7)r8r Zcurrent_revisionrrr�get_revisionds�
zMercurial.get_revisioncCs|jddg|d���}|S)zh
        Return the changeset identification hash, as a 40-character
        hexadecimal string
        r:z--template={node}rr;)r8r Zcurrent_rev_hashrrr�get_requirement_revisionms
�
z"Mercurial.get_requirement_revisioncCsdS)z&Always assume the versions don't matchFr)r8r&�namerrr�is_commit_id_equalxszMercurial.is_commit_id_equalcCs@|jdg|d���}tj�|�s6tj�tj�||��}t||�S)z~
        Return the path to setup.py, relative to the repo root.
        Return None if setup.py is in the repo root.
        �rootr)rr7r,r�isabs�abspathr-r)r8r Z	repo_rootrrr�get_subdirectory}s�
zMercurial.get_subdirectorycsttt|��|�}|r|Sz|jdg|dd�}Wn2tyNt�d|�YdSty`YdS0tj	�
|�d��S)Nr@F)rZlog_failed_cmdzIcould not determine if %s is under hg control because hg is not availablez
)�superr�get_repository_rootrrr#�debugrr,r�normpath�rstrip)r8r Zloc�r��	__class__rrrE�s"�
�zMercurial.get_repository_root)�__name__�
__module__�__qualname__r>r.Z	repo_nameZschemes�staticmethodrrr(r6r"�classmethodr9r<r=r?rCrE�
__classcell__rrrJrrs,







r)Z
__future__rZloggingr,Zpip._vendor.six.movesrZpip._internal.exceptionsrrZpip._internal.utils.miscrZpip._internal.utils.subprocessrZpip._internal.utils.temp_dirrZpip._internal.utils.typingr	Zpip._internal.utils.urlsr
Z pip._internal.vcs.versioncontrolrrr
rrZ	getLoggerrLr#r�registerrrrr�<module>s